diff options
author | bde <bde@FreeBSD.org> | 1997-12-19 21:37:18 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-12-19 21:37:18 +0000 |
commit | 648446f9690f915d095fed661cd6d0c3b01dedbe (patch) | |
tree | 0f5fe8a004a5d941bf25b15523050a47f489660f /gnu/usr.bin/gdb | |
parent | e3217cf45896777fe03b9ce9a4cd8c41aec55723 (diff) | |
download | FreeBSD-src-648446f9690f915d095fed661cd6d0c3b01dedbe.zip FreeBSD-src-648446f9690f915d095fed661cd6d0c3b01dedbe.tar.gz |
Exec dmesg and awk to print everything in the message buffer
following "panic:" or "Fatal trap". `panicstr' is still printed,
although it is redundant if there is a valid message buffer and
incomplete if it contains `%'s. I think the awk command belongs
here and not in a script since a standard format with complete
messages is good for bug reports.
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r-- | gnu/usr.bin/gdb/gdb/kvm-fbsd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c index 9f96e5c..5f93334 100644 --- a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c @@ -338,7 +338,16 @@ kcore_open (filename, from_tty) *cp = '?'; *cp = '\0'; if (buf[0] != '\0') - printf ("panic: %s\n", buf); + printf ("panicstr: %s\n", buf); + + printf ("panic messages:\n---\n"); + snprintf (buf, sizeof buf, + "/sbin/dmesg -M %s | \ + /usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \ + { if (printing) print $0 }'", + filename); + system (buf); + printf ("---\n"); } if (!ontop) |