From d76f78c43cf886ee5a85618d6d64b0dd8aa0de9d Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 17 Jan 1998 17:07:53 +0000 Subject: [PATCH] Pass the system name to dmesg. Rev.1.7 only works when the symbols in /kernel aren't too different form those in the kernel being debugged. --- gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c | 11 +++++++++-- gnu/usr.bin/binutils/gdb/kvm-fbsd.c | 11 +++++++++-- gnu/usr.bin/gdb/gdb/kvm-fbsd.c | 11 +++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c index 5f93334c79a4..ed1504ec9ac6 100644 --- a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "frame.h" /* required by inferior.h */ #include "inferior.h" #include "symtab.h" +#include "symfile.h" +#include "objfiles.h" #include "command.h" #include "bfd.h" #include "target.h" @@ -339,13 +341,18 @@ kcore_open (filename, from_tty) *cp = '\0'; if (buf[0] != '\0') printf ("panicstr: %s\n", buf); + } + /* Print all the panic messages if possible. */ + if (symfile_objfile != NULL) + { printf ("panic messages:\n---\n"); snprintf (buf, sizeof buf, - "/sbin/dmesg -M %s | \ + "/sbin/dmesg -N %s -M %s | \ /usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \ { if (printing) print $0 }'", - filename); + symfile_objfile->name, filename); + fflush(stdout); system (buf); printf ("---\n"); } diff --git a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c index 5f93334c79a4..ed1504ec9ac6 100644 --- a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "frame.h" /* required by inferior.h */ #include "inferior.h" #include "symtab.h" +#include "symfile.h" +#include "objfiles.h" #include "command.h" #include "bfd.h" #include "target.h" @@ -339,13 +341,18 @@ kcore_open (filename, from_tty) *cp = '\0'; if (buf[0] != '\0') printf ("panicstr: %s\n", buf); + } + /* Print all the panic messages if possible. */ + if (symfile_objfile != NULL) + { printf ("panic messages:\n---\n"); snprintf (buf, sizeof buf, - "/sbin/dmesg -M %s | \ + "/sbin/dmesg -N %s -M %s | \ /usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \ { if (printing) print $0 }'", - filename); + symfile_objfile->name, filename); + fflush(stdout); system (buf); printf ("---\n"); } diff --git a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c index 5f93334c79a4..ed1504ec9ac6 100644 --- a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c @@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "frame.h" /* required by inferior.h */ #include "inferior.h" #include "symtab.h" +#include "symfile.h" +#include "objfiles.h" #include "command.h" #include "bfd.h" #include "target.h" @@ -339,13 +341,18 @@ kcore_open (filename, from_tty) *cp = '\0'; if (buf[0] != '\0') printf ("panicstr: %s\n", buf); + } + /* Print all the panic messages if possible. */ + if (symfile_objfile != NULL) + { printf ("panic messages:\n---\n"); snprintf (buf, sizeof buf, - "/sbin/dmesg -M %s | \ + "/sbin/dmesg -N %s -M %s | \ /usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \ { if (printing) print $0 }'", - filename); + symfile_objfile->name, filename); + fflush(stdout); system (buf); printf ("---\n"); }