Commit 9a5d878f6e7c9c87d92d391f97a593e94be92031
1 parent
3ee89922
Fix exception debug output.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3885 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
36 additions
and
39 deletions
target-mips/helper.c
... | ... | @@ -319,43 +319,40 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, |
319 | 319 | } |
320 | 320 | |
321 | 321 | #if !defined(CONFIG_USER_ONLY) |
322 | -static struct _excp_names { | |
323 | - int excp; | |
324 | - char *name; | |
325 | -} excp_names[EXCP_LAST + 1] = { | |
326 | - { EXCP_RESET, "reset" }, | |
327 | - { EXCP_SRESET, "soft reset" }, | |
328 | - { EXCP_DSS, "debug single step" }, | |
329 | - { EXCP_DINT, "debug interrupt" }, | |
330 | - { EXCP_NMI, "non-maskable interrupt" }, | |
331 | - { EXCP_MCHECK, "machine check" }, | |
332 | - { EXCP_EXT_INTERRUPT, "interrupt" }, | |
333 | - { EXCP_DFWATCH, "deferred watchpoint" }, | |
334 | - { EXCP_DIB, "debug instruction breakpoint" }, | |
335 | - { EXCP_IWATCH, "instruction fetch watchpoint" }, | |
336 | - { EXCP_AdEL, "address error load" }, | |
337 | - { EXCP_AdES, "address error store" }, | |
338 | - { EXCP_TLBF, "TLB refill" }, | |
339 | - { EXCP_IBE, "instruction bus error" }, | |
340 | - { EXCP_DBp, "debug breakpoint" }, | |
341 | - { EXCP_SYSCALL, "syscall" }, | |
342 | - { EXCP_BREAK, "break" }, | |
343 | - { EXCP_CpU, "coprocessor unusable" }, | |
344 | - { EXCP_RI, "reserved instruction" }, | |
345 | - { EXCP_OVERFLOW, "arithmetic overflow" }, | |
346 | - { EXCP_TRAP, "trap" }, | |
347 | - { EXCP_FPE, "floating point" }, | |
348 | - { EXCP_DDBS, "debug data break store" }, | |
349 | - { EXCP_DWATCH, "data watchpoint" }, | |
350 | - { EXCP_LTLBL, "TLB modify" }, | |
351 | - { EXCP_TLBL, "TLB load" }, | |
352 | - { EXCP_TLBS, "TLB store" }, | |
353 | - { EXCP_DBE, "data bus error" }, | |
354 | - { EXCP_DDBL, "debug data break load" }, | |
355 | - { EXCP_THREAD, "thread" }, | |
356 | - { EXCP_MDMX, "MDMX" }, | |
357 | - { EXCP_C2E, "precise coprocessor 2" }, | |
358 | - { EXCP_CACHE, "cache error" }, | |
322 | +static const char * const excp_names[EXCP_LAST + 1] = { | |
323 | + [EXCP_RESET] = "reset", | |
324 | + [EXCP_SRESET] = "soft reset", | |
325 | + [EXCP_DSS] = "debug single step", | |
326 | + [EXCP_DINT] = "debug interrupt", | |
327 | + [EXCP_NMI] = "non-maskable interrupt", | |
328 | + [EXCP_MCHECK] = "machine check", | |
329 | + [EXCP_EXT_INTERRUPT] = "interrupt", | |
330 | + [EXCP_DFWATCH] = "deferred watchpoint", | |
331 | + [EXCP_DIB] = "debug instruction breakpoint", | |
332 | + [EXCP_IWATCH] = "instruction fetch watchpoint", | |
333 | + [EXCP_AdEL] = "address error load", | |
334 | + [EXCP_AdES] = "address error store", | |
335 | + [EXCP_TLBF] = "TLB refill", | |
336 | + [EXCP_IBE] = "instruction bus error", | |
337 | + [EXCP_DBp] = "debug breakpoint", | |
338 | + [EXCP_SYSCALL] = "syscall", | |
339 | + [EXCP_BREAK] = "break", | |
340 | + [EXCP_CpU] = "coprocessor unusable", | |
341 | + [EXCP_RI] = "reserved instruction", | |
342 | + [EXCP_OVERFLOW] = "arithmetic overflow", | |
343 | + [EXCP_TRAP] = "trap", | |
344 | + [EXCP_FPE] = "floating point", | |
345 | + [EXCP_DDBS] = "debug data break store", | |
346 | + [EXCP_DWATCH] = "data watchpoint", | |
347 | + [EXCP_LTLBL] = "TLB modify", | |
348 | + [EXCP_TLBL] = "TLB load", | |
349 | + [EXCP_TLBS] = "TLB store", | |
350 | + [EXCP_DBE] = "data bus error", | |
351 | + [EXCP_DDBL] = "debug data break load", | |
352 | + [EXCP_THREAD] = "thread", | |
353 | + [EXCP_MDMX] = "MDMX", | |
354 | + [EXCP_C2E] = "precise coprocessor 2", | |
355 | + [EXCP_CACHE] = "cache error", | |
359 | 356 | }; |
360 | 357 | #endif |
361 | 358 | |
... | ... | @@ -364,13 +361,13 @@ void do_interrupt (CPUState *env) |
364 | 361 | #if !defined(CONFIG_USER_ONLY) |
365 | 362 | target_ulong offset; |
366 | 363 | int cause = -1; |
367 | - char *name; | |
364 | + const char *name; | |
368 | 365 | |
369 | 366 | if (logfile && env->exception_index != EXCP_EXT_INTERRUPT) { |
370 | 367 | if (env->exception_index < 0 || env->exception_index > EXCP_LAST) |
371 | 368 | name = "unknown"; |
372 | 369 | else |
373 | - name = excp_names[env->exception_index].name; | |
370 | + name = excp_names[env->exception_index]; | |
374 | 371 | |
375 | 372 | fprintf(logfile, "%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n", |
376 | 373 | __func__, env->PC[env->current_tc], env->CP0_EPC, name); | ... | ... |