From patchwork Wed Oct 10 07:06:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 981729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42VQCJ1TDfz9sC7 for ; Wed, 10 Oct 2018 18:07:22 +1100 (AEDT) Received: from localhost ([::1]:55564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA8aU-0002sG-JS for incoming@patchwork.ozlabs.org; Wed, 10 Oct 2018 03:07:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gA8a4-0002s5-RH for qemu-devel@nongnu.org; Wed, 10 Oct 2018 03:06:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gA8a1-0004Dz-Ly for qemu-devel@nongnu.org; Wed, 10 Oct 2018 03:06:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33764) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gA8a1-0004CG-EW; Wed, 10 Oct 2018 03:06:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA058307CEB1; Wed, 10 Oct 2018 07:06:48 +0000 (UTC) Received: from thuth.com (dhcp-200-199.str.redhat.com [10.33.200.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A22918233; Wed, 10 Oct 2018 07:06:44 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, "Edgar E. Iglesias" Date: Wed, 10 Oct 2018 09:06:38 +0200 Message-Id: <1539155198-5873-1-git-send-email-thuth@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 10 Oct 2018 07:06:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] target/cris/translate: Get rid of qemu_log_separate() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, philmd@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The gen_BUG() function calls already cpu_abort(), which prints the information to stderr and the log already. So instead of additionally printing the dc->pc via fprintf() and qemu_log here, too, we can simply pass this information to cpu_abort() instead. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- v2: Use "pc=" instead of "dc->pc=" in the string as suggested by Phil target/cris/translate.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 4ae1c04..11b2c11 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -137,11 +137,7 @@ typedef struct DisasContext { static void gen_BUG(DisasContext *dc, const char *file, int line) { - fprintf(stderr, "BUG: pc=%x %s %d\n", dc->pc, file, line); - if (qemu_log_separate()) { - qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line); - } - cpu_abort(CPU(dc->cpu), "%s:%d\n", file, line); + cpu_abort(CPU(dc->cpu), "%s:%d pc=%x\n", file, line, dc->pc); } static const char *regnames_v32[] =