mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
kdb: set kdb_why when entered via reboot and panic
Reviewed by: jhb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #74 Differential Revision: https://reviews.freebsd.org/D34551
This commit is contained in:
parent
742e7210d0
commit
1ea833a572
2 changed files with 4 additions and 1 deletions
|
|
@ -292,6 +292,7 @@ void
|
|||
kdb_panic(const char *msg)
|
||||
{
|
||||
|
||||
kdb_why = KDB_WHY_PANIC;
|
||||
printf("KDB: panic\n");
|
||||
panic("%s", msg);
|
||||
}
|
||||
|
|
@ -300,6 +301,7 @@ void
|
|||
kdb_reboot(void)
|
||||
{
|
||||
|
||||
kdb_why = KDB_WHY_REBOOT;
|
||||
printf("KDB: reboot requested\n");
|
||||
shutdown_nice(0);
|
||||
}
|
||||
|
|
@ -498,9 +500,9 @@ kdb_enter(const char *why, const char *msg)
|
|||
{
|
||||
|
||||
if (kdb_dbbe != NULL && kdb_active == 0) {
|
||||
kdb_why = why;
|
||||
if (msg != NULL)
|
||||
printf("KDB: enter: %s\n", msg);
|
||||
kdb_why = why;
|
||||
breakpoint();
|
||||
kdb_why = KDB_WHY_UNSET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ extern const char * volatile kdb_why;
|
|||
#define KDB_WHY_POWERPC "powerpc" /* Unhandled powerpc intr. */
|
||||
#define KDB_WHY_UNIONFS "unionfs" /* Unionfs bug. */
|
||||
#define KDB_WHY_DTRACE "dtrace" /* DTrace action entered debugger. */
|
||||
#define KDB_WHY_REBOOT "reboot" /* reboot was requested. */
|
||||
|
||||
/* Return values for kdb_alt_break */
|
||||
#define KDB_REQ_DEBUGGER 1 /* User requested Debugger */
|
||||
|
|
|
|||
Loading…
Reference in a new issue