render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0045-target-mips-Always-evaluate-debugging-macro-argument.patch

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