From patchwork Wed Sep 19 04:55:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 322B22C0084 for ; Wed, 19 Sep 2012 14:56:03 +1000 (EST) Received: from localhost ([::1]:35735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TECKO-0001Jj-Uz for incoming@patchwork.ozlabs.org; Wed, 19 Sep 2012 00:56:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TECK8-00019f-Mu for qemu-devel@nongnu.org; Wed, 19 Sep 2012 00:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TECK7-0004wN-NQ for qemu-devel@nongnu.org; Wed, 19 Sep 2012 00:55:44 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:41839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TECK7-0004vo-Gb for qemu-devel@nongnu.org; Wed, 19 Sep 2012 00:55:43 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so1579897pbb.4 for ; Tue, 18 Sep 2012 21:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=tD2HZvTkJvzh+nRyxAxpuQms6oBIsaMr2ufqvJGXqK4=; b=dffwm2RM4GS4G9LyteKL7w/JRHHSMlZwwk28LKOjnPsgovivbAPH5D+pKxP4wemxbb 0xaDmZjOXUqM/A7fQuXKurZxaF0wqVBrUD8S454o9q+fFqLy9lulBSTwlxShiajhJR5/ 6NzjHkXFa3tMrpqlehq2yzsvVTRnc6HESJBdhdNCm1k2k/1r7jOlyewuBVrxLMPlHoQc qof0fIbbKQdynaIqyxd0jX+nyMsiOTA9v+PBVZhatPuWCdjURVkZd0WzFIpAO2m8hk9N UJpwRryqT/4D5a5Un5XB23MBzAq2mi5Hxne4ETyTUny3TyyoWd7l+aH9m+0RXCJzMDuW xvkw== Received: by 10.66.85.70 with SMTP id f6mr4067324paz.7.1348030543076; Tue, 18 Sep 2012 21:55:43 -0700 (PDT) Received: from pebble.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id gj9sm1172837pbc.16.2012.09.18.21.55.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 21:55:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 18 Sep 2012 21:55:34 -0700 Message-Id: <1348030534-14059-4-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348030534-14059-1-git-send-email-rth@twiddle.net> References: <1348030534-14059-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 3/3] target-mips: Always evaluate debugging macro arguments 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org this will prevent some of the compilation errors with debugging enabled from creeping back in. Signed-off-by: Richard Henderson --- target-mips/translate.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index f93b444..4e04e97 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -28,7 +28,7 @@ #define GEN_HELPER 1 #include "helper.h" -//#define MIPS_DEBUG_DISAS +#define MIPS_DEBUG_DISAS 0 //#define MIPS_DEBUG_SIGN_EXTENSIONS /* MIPS major opcodes */ @@ -566,22 +566,25 @@ static const char *fregnames[] = "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", }; -#ifdef MIPS_DEBUG_DISAS -#define MIPS_DEBUG(fmt, ...) \ - qemu_log_mask(CPU_LOG_TB_IN_ASM, \ - TARGET_FMT_lx ": %08x " fmt "\n", \ - ctx->pc, ctx->opcode , ## __VA_ARGS__) -#define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) -#else -#define MIPS_DEBUG(fmt, ...) do { } while(0) -#define LOG_DISAS(...) do { } while (0) -#endif +#define MIPS_DEBUG(fmt, ...) \ + do { \ + if (MIPS_DEBUG_DISAS) { \ + qemu_log_mask(CPU_LOG_TB_IN_ASM, \ + TARGET_FMT_lx ": %08x " fmt "\n", \ + ctx->pc, ctx->opcode , ## __VA_ARGS__); \ + } \ + } while (0) + +#define LOG_DISAS(...) \ + do { \ + if (MIPS_DEBUG_DISAS) { \ + qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__); \ + } \ + } while (0) #define MIPS_INVAL(op) \ -do { \ MIPS_DEBUG("Invalid %s %03x %03x %03x", op, ctx->opcode >> 26, \ - ctx->opcode & 0x3F, ((ctx->opcode >> 16) & 0x1F)); \ -} while (0) + ctx->opcode & 0x3F, ((ctx->opcode >> 16) & 0x1F)) /* General purpose registers moves. */ static inline void gen_load_gpr (TCGv t, int reg)