summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2006-11-04 00:01:25 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2006-11-04 00:01:25 +0000
commitb19ceb87d797c912519a0749f6211bfbf438e5da (patch)
treea725a27ec4b748b241efbdc7817fff6e856e80b7
parent528310c8c90aa2cc16b121f5d8ff88bc1214a720 (diff)
make stack trace look as other flavoured stack traces look like
-rw-r--r--sys/arch/sh/sh/db_trace.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/arch/sh/sh/db_trace.c b/sys/arch/sh/sh/db_trace.c
index de5649fec68..dca9fcb7f49 100644
--- a/sys/arch/sh/sh/db_trace.c
+++ b/sys/arch/sh/sh/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.2 2006/10/17 04:20:08 drahn Exp $ */
+/* $OpenBSD: db_trace.c,v 1.3 2006/11/04 00:01:24 mickey Exp $ */
/* $NetBSD: db_trace.c,v 1.19 2006/01/21 22:10:59 uwe Exp $ */
/*-
@@ -118,9 +118,13 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
sym = db_search_symbol(callpc, DB_STGY_ANY, &offset);
db_symbol_values(sym, &name, NULL);
- if (lastframe == 0 && sym == 0) {
- printf("symbol not found\n");
- break;
+ (*print)("%s() at ", name ? name : "");
+ db_printsym(callpc, DB_STGY_PROC, print);
+ (*print)("\n");
+
+ if (lastframe == 0 && offset == 0) {
+ callpc = ddb_regs.tf_pr;
+ continue;
}
db_nextframe(callpc - offset, &frame, &callpc);
@@ -131,10 +135,6 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
callpc = (db_addr_t)ddb_regs.tf_pr;
DPRINTF(" (3)newpc 0x%lx, newfp 0x%lx\n",
callpc, frame);
-
- (*print)("%s() at ", name ? name : "");
- db_printsym(callpc, DB_STGY_PROC, print);
- (*print)("\n");
}
count--;
@@ -196,8 +196,8 @@ db_nextframe(
unsigned int disp = (int)(inst & 0xff);
int r3;
- r3 = (int)*(unsigned short *)(pc + (4 - 2)
- + (disp << 1));
+ r3 = db_get_value(pc + 4 - 2 + (disp << 1),
+ 2, FALSE);
if ((r3 & 0x00008000) == 0)
r3 &= 0x0000ffff;
else
@@ -216,6 +216,9 @@ db_nextframe(
}
out:
+#ifdef TRACE_DEBUG
+ printf("depth=%x fpdepth=0x%x prdepth=0x%x\n", depth, fpdepth, prdepth);
+#endif
if (fpdepth != -1)
*fp = frame[depth - fpdepth - 1];
else