summaryrefslogtreecommitdiff
path: root/debian/patches/immc0003-ddb-automatically-display-stack-traces.patch
blob: 6768f0d049c69e7fef29c98d4e81e3b516a85d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 19cc6fee48bc1ec62d8990228aa95864413fb190 Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Fri, 26 Jun 2015 14:44:32 +0200
Subject: [PATCH gnumach 3/3] ddb: automatically display stack traces

* ddb/db_trap.c (db_task_trap): Automatically display stack traces if
an unexpected trap occurs.
---
 ddb/db_trap.c | 4 ++++
 1 file changed, 4 insertions(+)

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();
-- 
2.1.4