diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-16 07:10:48 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-16 07:10:48 +0000 |
commit | a496775f87da7f2c445b146e0b31d3895d4af1e0 (patch) | |
tree | cf216eb5fc64fda704327685859b4b825cda1834 /target-ppc/op_helper.c | |
parent | 9898128f55e46b695a3d39ac091356c1c296e9b4 (diff) |
Fix a lot of debug traces for PowerPC emulation: use logfile instead of stdout
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2677 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index a65da36b7b..140b7f5cb2 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -68,6 +68,12 @@ void do_raise_exception (uint32_t exception) do_raise_exception_err(exception, 0); } +void cpu_dump_EA (target_ulong EA); +void do_print_mem_EA (target_ulong EA) +{ + cpu_dump_EA(EA); +} + /*****************************************************************************/ /* Registers load and stores */ void do_load_cr (void) @@ -181,6 +187,25 @@ void do_store_fpscr (uint32_t mask) set_float_rounding_mode(rnd_type, &env->fp_status); } +target_ulong ppc_load_dump_spr (int sprn) +{ + if (loglevel) { + fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n", + sprn, sprn, env->spr[sprn]); + } + + return env->spr[sprn]; +} + +void ppc_store_dump_spr (int sprn, target_ulong val) +{ + if (loglevel) { + fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n", + sprn, sprn, env->spr[sprn], val); + } + env->spr[sprn] = val; +} + /*****************************************************************************/ /* Fixed point operations helpers */ #if defined(TARGET_PPC64) @@ -1250,10 +1275,14 @@ void do_load_dcr (void) target_ulong val; if (unlikely(env->dcr_env == NULL)) { - printf("No DCR environment\n"); + if (loglevel) { + fprintf(logfile, "No DCR environment\n"); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) { - printf("DCR read error\n"); + if (loglevel) { + fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); } else { T0 = val; @@ -1263,10 +1292,14 @@ void do_load_dcr (void) void do_store_dcr (void) { if (unlikely(env->dcr_env == NULL)) { - printf("No DCR environment\n"); + if (loglevel) { + fprintf(logfile, "No DCR environment\n"); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) { - printf("DCR write error\n"); + if (loglevel) { + fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); } } |