summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2012-07-12 08:57:35 +0000
committerbluhm <bluhm@openbsd.org>2012-07-12 08:57:35 +0000
commit977aadf42b7d737c3c172a619a29e2fc03f166e5 (patch)
tree524e71509cfa6a2c51c555ae502f34b8b16c6fd4
parentminor fix (diff)
downloadwireguard-openbsd-977aadf42b7d737c3c172a619a29e2fc03f166e5.tar.xz
wireguard-openbsd-977aadf42b7d737c3c172a619a29e2fc03f166e5.zip
On i386 gdb failed to display the stack trace of a kernel core dump
correctly. The gdb backtrace command did not get over the trap stack frame. There is a pushl %esp in alltraps() that was not accounted for. Depending on wheter the analyzed kernel has debugging symbols or not, the symbol is calltrap or alltraps. Both get special treatment now. ok miod@ kettenis@
-rw-r--r--gnu/usr.bin/binutils/gdb/i386obsd-tdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gdb/i386obsd-tdep.c b/gnu/usr.bin/binutils/gdb/i386obsd-tdep.c
index 76f4d8f16f2..923e88932e7 100644
--- a/gnu/usr.bin/binutils/gdb/i386obsd-tdep.c
+++ b/gnu/usr.bin/binutils/gdb/i386obsd-tdep.c
@@ -363,6 +363,10 @@ i386obsd_trapframe_cache(struct frame_info *next_frame, void **this_cache)
find_pc_partial_function (func, &name, NULL, NULL);
if (name && strncmp (name, "Xintr", 5) == 0)
addr = sp + 8; /* It's an interrupt frame. */
+ else if (name && strcmp (name, "alltraps") == 0)
+ addr = sp + 4; /* It's a trap frame. */
+ else if (name && strcmp (name, "calltrap") == 0)
+ addr = sp + 4; /* It's a trap frame with debug symbols. */
else
addr = sp;
@@ -427,6 +431,7 @@ i386obsd_trapframe_sniffer (const struct frame_unwind *self,
find_pc_partial_function (frame_pc_unwind (next_frame), &name, NULL, NULL);
return (name && (strcmp (name, "calltrap") == 0
+ || strcmp (name, "alltraps") == 0
|| strcmp (name, "syscall1") == 0
|| strncmp (name, "Xintr", 5) == 0
|| strncmp (name, "Xsoft", 5) == 0));