From patchwork Wed Mar 12 13:49:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 26114 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1099E236AC for ; Wed, 12 Mar 2014 13:52:28 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf24200391qcx.9 for ; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=6hVK+hR+yH4+rSXjqJreFxOHydNDDi3ZJzZKM7mnaEY=; b=R+8tspgR1u2QCyHv9PAgi8Bpp0rG2oFVWqJpN06OZGHJdrJQKgA8Y8OKLtmk0EadYM MSa+p++VNmMXhnMrqHEA+1uoGuYYKCGvC0r/sJjkWxpLbj1nSIIbUYzilfqBqz+Rlhkn RmJgZL6QxzL6V31SzTCopPoIHVA7B8Rh3yLv+3EbbjNWI8cIERAksZi4ctkdWcaJ8e9S qc9R2fgt9tDoEweXfo7mgQH8tLcF/9QhbaoVy18ha5WCwXO901fMIO6V3HGOAB6rJihg +h0Sdeqg/hr8tIaw1ELQCZ2IfmqNhycy1WW5HHIYsTUDb/5MY6pN4RvJVS8Kmnu2giz+ p6qg== X-Gm-Message-State: ALoCoQkFC1WJCAXcm07457XOWtHXFkreMsREY2lnS4U6rL/ophX4guCaJv1a4g+PbBuc4EFNqMGz X-Received: by 10.236.27.33 with SMTP id d21mr15371036yha.23.1394632347883; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.210 with SMTP id g76ls1251200qge.69.gmail; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) X-Received: by 10.220.48.194 with SMTP id s2mr135529vcf.43.1394632347757; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id uc1si6792987vcb.128.2014.03.12.06.52.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:52:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so10038155veb.19 for ; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) X-Received: by 10.58.231.169 with SMTP id th9mr130753vec.49.1394632347667; Wed, 12 Mar 2014 06:52:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp290119vck; Wed, 12 Mar 2014 06:52:26 -0700 (PDT) X-Received: by 10.224.55.140 with SMTP id u12mr55983458qag.0.1394632346294; Wed, 12 Mar 2014 06:52:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e61si12490456qgf.26.2014.03.12.06.52.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Mar 2014 06:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNja5-0005wF-SD for patch@linaro.org; Wed, 12 Mar 2014 09:52:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNjXp-0001zk-0j for qemu-devel@nongnu.org; Wed, 12 Mar 2014 09:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNjXj-0004Wo-0R for qemu-devel@nongnu.org; Wed, 12 Mar 2014 09:50:04 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:33502 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNjXi-0004WK-RB for qemu-devel@nongnu.org; Wed, 12 Mar 2014 09:49:58 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaro.local) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1WNjXv-00033k-W3 for qemu-devel@nongnu.org; Wed, 12 Mar 2014 14:50:12 +0100 From: alex.bennee@linaro.org To: qemu-devel@nongnu.org Date: Wed, 12 Mar 2014 13:49:59 +0000 Message-Id: <1394632200-15633-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394632200-15633-1-git-send-email-alex.bennee@linaro.org> References: <1394632200-15633-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Subject: [Qemu-devel] [RCF PATCH 1/2] tcg: add tcg_abort_dbg() for additional debug info X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Alex Bennée There are times the tcg aborts with a fatal but terse error which isn't overly helpful. This adds an alternative macro that can be used to show a little more helper information when an abort occurs. diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index f832282..1a6c565 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -1342,7 +1342,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) } break; default: - tcg_abort(); + tcg_abort_dbg("bad opc:%x", opc); } /* Jump to the code corresponding to next IR of qemu_st */ @@ -1519,7 +1519,7 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg datalo, TCGReg datahi, } break; default: - tcg_abort(); + tcg_abort_dbg("bad memop=%x", memop); } } diff --git a/tcg/optimize.c b/tcg/optimize.c index 7777743..ae1a3f8 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -407,7 +407,7 @@ static bool do_constant_folding_cond_eq(TCGCond c) case TCG_COND_EQ: return 1; default: - tcg_abort(); + tcg_abort_dbg("bad condition:%d", c); } } diff --git a/tcg/tcg.h b/tcg/tcg.h index f7efcb4..bfde09f 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -657,12 +657,15 @@ typedef struct TCGTargetOpDef { const char *args_ct_str[TCG_MAX_OP_ARGS]; } TCGTargetOpDef; -#define tcg_abort() \ +#define tcg_abort_dbg(fmt, ...)\ do {\ - fprintf(stderr, "%s:%d: tcg fatal error\n", __FILE__, __LINE__);\ + fprintf(stderr, "%s:%d: tcg fatal error " fmt "\n",\ + __FILE__, __LINE__, ## __VA_ARGS__);\ abort();\ } while (0) +#define tcg_abort() tcg_abort_dbg("") + #ifdef CONFIG_DEBUG_TCG # define tcg_debug_assert(X) do { assert(X); } while (0) #elif QEMU_GNUC_PREREQ(4, 5)