diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 21:48:06 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 21:48:06 +0000 |
commit | d12d51d5ba84817e2e7dcc95aeabebb230cc3781 (patch) | |
tree | 8be0db88a5e7970ca29a88aec04f6d7961864c1e /target-ppc/translate.c | |
parent | 40a4539e2041f4a9dd52d269f46926b7ed2b73ff (diff) | |
download | hqemu-d12d51d5ba84817e2e7dcc95aeabebb230cc3781.zip hqemu-d12d51d5ba84817e2e7dcc95aeabebb230cc3781.tar.gz |
Clean up debugging code #ifdefs (Eduardo Habkost)
Use macros to avoid #ifdefs on debugging code.
This patch doesn't try to merge logging macros from different files,
but just unify the debugging code #ifdefs onto a macro on each file. A
further cleanup can unify the debugging macros on a common header, later
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/translate.c')
-rw-r--r-- | target-ppc/translate.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 8a99228..4d62e28 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -42,6 +42,14 @@ //#define PPC_DEBUG_DISAS //#define DO_PPC_STATISTICS +#ifdef PPC_DEBUG_DISAS +# define LOG_DISAS(...) do { \ + if (loglevel & CPU_LOG_TB_IN_ASM) \ + fprintf(logfile, ## __VA_ARGS__); \ + } while (0) +#else +# define LOG_DISAS(...) do { } while (0) +#endif /*****************************************************************************/ /* Code translation helpers */ @@ -8232,13 +8240,9 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, gen_opc_icount[lj] = num_insns; } } -#if defined PPC_DEBUG_DISAS - if (loglevel & CPU_LOG_TB_IN_ASM) { - fprintf(logfile, "----------------\n"); - fprintf(logfile, "nip=" ADDRX " super=%d ir=%d\n", - ctx.nip, ctx.mem_idx, (int)msr_ir); - } -#endif + LOG_DISAS("----------------\n"); + LOG_DISAS("nip=" ADDRX " super=%d ir=%d\n", + ctx.nip, ctx.mem_idx, (int)msr_ir); if (num_insns + 1 == max_insns && (tb->cflags & CF_LAST_IO)) gen_io_start(); if (unlikely(ctx.le_mode)) { @@ -8246,13 +8250,9 @@ static always_inline void gen_intermediate_code_internal (CPUState *env, } else { ctx.opcode = ldl_code(ctx.nip); } -#if defined PPC_DEBUG_DISAS - if (loglevel & CPU_LOG_TB_IN_ASM) { - fprintf(logfile, "translate opcode %08x (%02x %02x %02x) (%s)\n", + LOG_DISAS("translate opcode %08x (%02x %02x %02x) (%s)\n", ctx.opcode, opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode), little_endian ? "little" : "big"); - } -#endif ctx.nip += 4; table = env->opcodes; num_insns++; |