Fix exception debug output.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3885 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2008-01-03 21:26:23 +00:00
parent 3ee8992257
commit 9a5d878f6e
1 changed files with 36 additions and 39 deletions

View File

@ -319,43 +319,40 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
} }
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
static struct _excp_names { static const char * const excp_names[EXCP_LAST + 1] = {
int excp; [EXCP_RESET] = "reset",
char *name; [EXCP_SRESET] = "soft reset",
} excp_names[EXCP_LAST + 1] = { [EXCP_DSS] = "debug single step",
{ EXCP_RESET, "reset" }, [EXCP_DINT] = "debug interrupt",
{ EXCP_SRESET, "soft reset" }, [EXCP_NMI] = "non-maskable interrupt",
{ EXCP_DSS, "debug single step" }, [EXCP_MCHECK] = "machine check",
{ EXCP_DINT, "debug interrupt" }, [EXCP_EXT_INTERRUPT] = "interrupt",
{ EXCP_NMI, "non-maskable interrupt" }, [EXCP_DFWATCH] = "deferred watchpoint",
{ EXCP_MCHECK, "machine check" }, [EXCP_DIB] = "debug instruction breakpoint",
{ EXCP_EXT_INTERRUPT, "interrupt" }, [EXCP_IWATCH] = "instruction fetch watchpoint",
{ EXCP_DFWATCH, "deferred watchpoint" }, [EXCP_AdEL] = "address error load",
{ EXCP_DIB, "debug instruction breakpoint" }, [EXCP_AdES] = "address error store",
{ EXCP_IWATCH, "instruction fetch watchpoint" }, [EXCP_TLBF] = "TLB refill",
{ EXCP_AdEL, "address error load" }, [EXCP_IBE] = "instruction bus error",
{ EXCP_AdES, "address error store" }, [EXCP_DBp] = "debug breakpoint",
{ EXCP_TLBF, "TLB refill" }, [EXCP_SYSCALL] = "syscall",
{ EXCP_IBE, "instruction bus error" }, [EXCP_BREAK] = "break",
{ EXCP_DBp, "debug breakpoint" }, [EXCP_CpU] = "coprocessor unusable",
{ EXCP_SYSCALL, "syscall" }, [EXCP_RI] = "reserved instruction",
{ EXCP_BREAK, "break" }, [EXCP_OVERFLOW] = "arithmetic overflow",
{ EXCP_CpU, "coprocessor unusable" }, [EXCP_TRAP] = "trap",
{ EXCP_RI, "reserved instruction" }, [EXCP_FPE] = "floating point",
{ EXCP_OVERFLOW, "arithmetic overflow" }, [EXCP_DDBS] = "debug data break store",
{ EXCP_TRAP, "trap" }, [EXCP_DWATCH] = "data watchpoint",
{ EXCP_FPE, "floating point" }, [EXCP_LTLBL] = "TLB modify",
{ EXCP_DDBS, "debug data break store" }, [EXCP_TLBL] = "TLB load",
{ EXCP_DWATCH, "data watchpoint" }, [EXCP_TLBS] = "TLB store",
{ EXCP_LTLBL, "TLB modify" }, [EXCP_DBE] = "data bus error",
{ EXCP_TLBL, "TLB load" }, [EXCP_DDBL] = "debug data break load",
{ EXCP_TLBS, "TLB store" }, [EXCP_THREAD] = "thread",
{ EXCP_DBE, "data bus error" }, [EXCP_MDMX] = "MDMX",
{ EXCP_DDBL, "debug data break load" }, [EXCP_C2E] = "precise coprocessor 2",
{ EXCP_THREAD, "thread" }, [EXCP_CACHE] = "cache error",
{ EXCP_MDMX, "MDMX" },
{ EXCP_C2E, "precise coprocessor 2" },
{ EXCP_CACHE, "cache error" },
}; };
#endif #endif
@ -364,13 +361,13 @@ void do_interrupt (CPUState *env)
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
target_ulong offset; target_ulong offset;
int cause = -1; int cause = -1;
char *name; const char *name;
if (logfile && env->exception_index != EXCP_EXT_INTERRUPT) { if (logfile && env->exception_index != EXCP_EXT_INTERRUPT) {
if (env->exception_index < 0 || env->exception_index > EXCP_LAST) if (env->exception_index < 0 || env->exception_index > EXCP_LAST)
name = "unknown"; name = "unknown";
else else
name = excp_names[env->exception_index].name; name = excp_names[env->exception_index];
fprintf(logfile, "%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n", fprintf(logfile, "%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n",
__func__, env->PC[env->current_tc], env->CP0_EPC, name); __func__, env->PC[env->current_tc], env->CP0_EPC, name);