diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-03 16:49:57 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-03 16:49:57 +0000 |
commit | 085af4163440e66c1ea71ee72b02852896234624 (patch) | |
tree | 540fa257ccc5467c1721c3e0fd275999268d0b69 | |
parent | 3bc6d8216c3bb3121574a62d1f4b63b4b325d267 (diff) |
Add "show panic" command to ddb, to easily retrieve the panic message.
Will hopefully bring us better panic reports.
From Joris Vink.
-rw-r--r-- | share/man/man4/ddb.4 | 8 | ||||
-rw-r--r-- | sys/arch/arm/arm/db_interface.c | 3 | ||||
-rw-r--r-- | sys/arch/arm/arm/db_machdep.c | 20 | ||||
-rw-r--r-- | sys/arch/arm/include/db_machdep.h | 3 | ||||
-rw-r--r-- | sys/ddb/db_command.c | 16 | ||||
-rw-r--r-- | sys/ddb/db_command.h | 3 |
6 files changed, 27 insertions, 26 deletions
diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 5345e90d921..f0139cc656d 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ddb.4,v 1.36 2004/02/01 12:23:47 jmc Exp $ +.\" $OpenBSD: ddb.4,v 1.37 2005/01/03 16:49:54 miod Exp $ .\" $NetBSD: ddb.4,v 1.5 1994/11/30 16:22:09 jtc Exp $ .\" .\" Mach Operating System @@ -677,6 +677,12 @@ If the modifier is specified the complete page is printed. .\" -------------------- .It Xo +.Ic show panic +.Xc +Prints the +.Li panic string. +.\" -------------------- +.It Xo .Ic show pool .Op Cm /clp .Ar addr diff --git a/sys/arch/arm/arm/db_interface.c b/sys/arch/arm/arm/db_interface.c index 4974e57f1c8..4f4974f01e7 100644 --- a/sys/arch/arm/arm/db_interface.c +++ b/sys/arch/arm/arm/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.2 2004/02/01 06:10:33 drahn Exp $ */ +/* $OpenBSD: db_interface.c,v 1.3 2005/01/03 16:49:56 miod Exp $ */ /* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */ /* @@ -347,7 +347,6 @@ Debugger(void) const struct db_command db_machine_command_table[] = { { "frame", db_show_frame_cmd, 0, NULL }, - { "panic", db_show_panic_cmd, 0, NULL }, #ifdef ARM32_DB_COMMANDS ARM32_DB_COMMANDS, #endif diff --git a/sys/arch/arm/arm/db_machdep.c b/sys/arch/arm/arm/db_machdep.c index 79fe2883fa7..15d7193cba6 100644 --- a/sys/arch/arm/arm/db_machdep.c +++ b/sys/arch/arm/arm/db_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.c,v 1.2 2004/02/01 06:10:33 drahn Exp $ */ +/* $OpenBSD: db_machdep.c,v 1.3 2005/01/03 16:49:56 miod Exp $ */ /* $NetBSD: db_machdep.c,v 1.8 2003/07/15 00:24:41 lukem Exp $ */ /* @@ -40,24 +40,6 @@ #include <ddb/db_sym.h> #include <ddb/db_output.h> - -void -db_show_panic_cmd(addr, have_addr, count, modif) - db_expr_t addr; - int have_addr; - db_expr_t count; - char *modif; -{ - int s; - - s = splhigh(); - - db_printf("Panic string: %s\n", panicstr); - - (void)splx(s); -} - - void db_show_frame_cmd(addr, have_addr, count, modif) db_expr_t addr; diff --git a/sys/arch/arm/include/db_machdep.h b/sys/arch/arm/include/db_machdep.h index 25221717e79..640552199a6 100644 --- a/sys/arch/arm/include/db_machdep.h +++ b/sys/arch/arm/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.2 2004/05/19 03:17:07 drahn Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.3 2005/01/03 16:49:56 miod Exp $ */ /* $NetBSD: db_machdep.h,v 1.5 2001/11/22 18:00:00 thorpej Exp $ */ /* @@ -111,7 +111,6 @@ void db_machine_init (void); #define DB_ELFSIZE 32 #define DB_NO_AOUT -void db_show_panic_cmd (db_expr_t, int, db_expr_t, char *); void db_show_frame_cmd (db_expr_t, int, db_expr_t, char *); #endif /* _ARM_DB_MACHDEP_H_ */ diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index c4ac1ec31d0..734f03ee03e 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.38 2004/06/25 08:41:19 art Exp $ */ +/* $OpenBSD: db_command.c,v 1.39 2005/01/03 16:49:56 miod Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -353,6 +353,19 @@ db_page_print_cmd(addr, have_addr, count, modif) uvm_page_printit((struct vm_page *) addr, full, db_printf); } +void +db_show_panic_cmd(addr, have_addr, count, modif) + db_expr_t addr; + int have_addr; + db_expr_t count; + char * modif; +{ + if (panicstr) + db_printf("%s\n", panicstr); + else + db_printf("the kernel did not panic\n"); /* yet */ +} + /*ARGSUSED*/ void db_extent_print_cmd(addr, have_addr, count, modif) @@ -418,6 +431,7 @@ struct db_command db_show_cmds[] = { { "map", db_map_print_cmd, 0, NULL }, { "object", db_object_print_cmd, 0, NULL }, { "page", db_page_print_cmd, 0, NULL }, + { "panic", db_show_panic_cmd, 0, NULL }, { "pool", db_pool_print_cmd, 0, NULL }, { "proc", db_proc_print_cmd, 0, NULL }, { "registers", db_show_regs, 0, NULL }, diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h index 1a040e8edd7..8cd2db2f87c 100644 --- a/sys/ddb/db_command.h +++ b/sys/ddb/db_command.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.h,v 1.18 2003/12/03 12:50:33 markus Exp $ */ +/* $OpenBSD: db_command.h,v 1.19 2005/01/03 16:49:56 miod Exp $ */ /* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */ /* @@ -59,6 +59,7 @@ void db_boot_reboot_cmd(db_expr_t, int, db_expr_t, char *); void db_boot_poweroff_cmd(db_expr_t, int, db_expr_t, char *); void db_stack_trace_cmd(db_expr_t, int, db_expr_t, char *); void db_dmesg_cmd(db_expr_t, int, db_expr_t, char *); +void db_show_panic_cmd(db_expr_t, int, db_expr_t, char *); extern db_addr_t db_dot, db_last_addr, db_prev, db_next; |