summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-06-26 14:44:32 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-06-28 13:04:20 +0200
commit3007bbdba1283f03fb64c15fe8145090382c1f95 (patch)
tree11cf369ac0b702e25f3af1b5063d00040921bcb8
parent4b9758c8ec6103c26228e1cda9731ab8bf1113e9 (diff)
ddb: automatically display stack traces
* ddb/db_trap.c (db_task_trap): Automatically display stack traces if an unexpected trap occurs.
-rw-r--r--ddb/db_trap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ddb/db_trap.c b/ddb/db_trap.c
index b56ffdc..7e10731 100644
--- a/ddb/db_trap.c
+++ b/ddb/db_trap.c
@@ -44,6 +44,7 @@
#include <ddb/db_task_thread.h>
#include <ddb/db_trap.h>
#include <ddb/db_run.h>
+#include <machine/db_interface.h>
extern jmp_buf_t *db_recover;
@@ -88,6 +89,9 @@ db_task_trap(
db_print_loc_and_inst(db_dot, task_space);
else
db_printf("Trouble printing location %#X.\n", db_dot);
+
+ if (!bkpt && !watchpt && _setjmp(db_recover = &db_jmpbuf) == 0)
+ db_stack_trace_cmd(0, 0, -1, "");
db_recover = prev;
db_command_loop();