diff options
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index cb812d565e8..c42f34539f8 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.31 2006/12/24 20:30:35 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.32 2007/03/27 19:51:00 miod Exp $ */ /* tracked to 1.23 */ /* @@ -1115,7 +1115,9 @@ cpu_singlestep(p) #define MIPS_JR_RA 0x03e00008 /* instruction code for jr ra */ /* forward */ +#if !defined(DDB) char *fn_name(long addr); +#endif void stacktrace_subr(struct trap_frame *, int (*)(const char*, ...)); /* @@ -1164,7 +1166,7 @@ loop: /* Jump here after a nonstandard (interrupt handler) frame */ stksize = 0; subr = 0; - if (frames++ > 6) { + if (frames++ > 6) { (*printfn)("stackframe count exceeded\n"); return; } @@ -1320,13 +1322,16 @@ loop: } done: - (*printfn)("%s+%x ra %p sp %p (%p,%p,%p,%p)\n", - fn_name(subr), pc - subr, ra, sp, a0, a1, a2, a3); -#if defined(_LP64) - a0 = a1 = a2 = a3 = 0x00dead0000dead00; +#ifdef DDB + db_printsym(pc, DB_STGY_ANY, printfn); #else - a0 = a1 = a2 = a3 = 0x00dead00; + (*printfn)("%s+%x", fn_name(subr), pc - subr); #endif + if (frames == 1) + (*printfn)(" ra %p sp %p (%p,%p,%p,%p)\n", + ra, sp, a0, a1, a2, a3); + else + (*printfn)(" ra %p sp %p\n", ra, sp); if (ra) { if (pc == ra && stksize == 0) @@ -1345,6 +1350,7 @@ done: } } +#if !defined(DDB) /* * Functions ``special'' enough to print by name */ @@ -1373,5 +1379,6 @@ fn_name(long addr) snprintf(buf, sizeof(buf), "%x", addr); return (buf); } +#endif /* !DDB */ -#endif /* DDB */ +#endif /* DDB || DEBUG */ |