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.
This commit is contained in:
Bruce Evans 1998-01-17 17:07:53 +00:00
parent 18e5aee8c1
commit d76f78c43c
3 changed files with 27 additions and 6 deletions

View File

@ -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");
}

View File

@ -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");
}

View File

@ -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");
}