5544c1b
From e6f923b4e3e71661343f6d2eecd7f102022e5635 Mon Sep 17 00:00:00 2001
5544c1b
From: Richard Henderson <rth@twiddle.net>
5544c1b
Date: Tue, 18 Sep 2012 21:55:34 -0700
5544c1b
Subject: [PATCH] target-mips: Always evaluate debugging macro arguments
5544c1b
5544c1b
this will prevent some of the compilation errors with debugging
5544c1b
enabled from creeping back in.
5544c1b
5544c1b
Signed-off-by: Richard Henderson <rth@twiddle.net>
5544c1b
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1b
---
5544c1b
 target-mips/translate.c | 31 +++++++++++++++++--------------
5544c1b
 1 file changed, 17 insertions(+), 14 deletions(-)
5544c1b
5544c1b
diff --git a/target-mips/translate.c b/target-mips/translate.c
5544c1b
index 4937f6b..aba7935 100644
5544c1b
--- a/target-mips/translate.c
5544c1b
+++ b/target-mips/translate.c
5544c1b
@@ -28,7 +28,7 @@
5544c1b
 #define GEN_HELPER 1
5544c1b
 #include "helper.h"
5544c1b
 
5544c1b
-//#define MIPS_DEBUG_DISAS
5544c1b
+#define MIPS_DEBUG_DISAS 0
5544c1b
 //#define MIPS_DEBUG_SIGN_EXTENSIONS
5544c1b
 
5544c1b
 /* MIPS major opcodes */
5544c1b
@@ -566,22 +566,25 @@ static const char *fregnames[] =
5544c1b
       "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
5544c1b
       "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", };
5544c1b
 
5544c1b
-#ifdef MIPS_DEBUG_DISAS
5544c1b
-#define MIPS_DEBUG(fmt, ...)                         \
5544c1b
-        qemu_log_mask(CPU_LOG_TB_IN_ASM,                \
5544c1b
-                       TARGET_FMT_lx ": %08x " fmt "\n", \
5544c1b
-                       ctx->pc, ctx->opcode , ## __VA_ARGS__)
5544c1b
-#define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
5544c1b
-#else
5544c1b
-#define MIPS_DEBUG(fmt, ...) do { } while(0)
5544c1b
-#define LOG_DISAS(...) do { } while (0)
5544c1b
-#endif
5544c1b
+#define MIPS_DEBUG(fmt, ...)                                                  \
5544c1b
+    do {                                                                      \
5544c1b
+        if (MIPS_DEBUG_DISAS) {                                               \
5544c1b
+            qemu_log_mask(CPU_LOG_TB_IN_ASM,                                  \
5544c1b
+                          TARGET_FMT_lx ": %08x " fmt "\n",                   \
5544c1b
+                          ctx->pc, ctx->opcode , ## __VA_ARGS__);             \
5544c1b
+        }                                                                     \
5544c1b
+    } while (0)
5544c1b
+
5544c1b
+#define LOG_DISAS(...)                                                        \
5544c1b
+    do {                                                                      \
5544c1b
+        if (MIPS_DEBUG_DISAS) {                                               \
5544c1b
+            qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__);                 \
5544c1b
+        }                                                                     \
5544c1b
+    } while (0)
5544c1b
 
5544c1b
 #define MIPS_INVAL(op)                                                        \
5544c1b
-do {                                                                          \
5544c1b
     MIPS_DEBUG("Invalid %s %03x %03x %03x", op, ctx->opcode >> 26,            \
5544c1b
-               ctx->opcode & 0x3F, ((ctx->opcode >> 16) & 0x1F));             \
5544c1b
-} while (0)
5544c1b
+               ctx->opcode & 0x3F, ((ctx->opcode >> 16) & 0x1F))
5544c1b
 
5544c1b
 /* General purpose registers moves. */
5544c1b
 static inline void gen_load_gpr (TCGv t, int reg)
5544c1b
-- 
5544c1b
1.7.12.1
5544c1b