Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_kdb.c
Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | kdb_sysctl_stack_overflow(SYSCTL_HANDLER_ARGS) | ||||
kdb_stack_overflow(&x); | kdb_stack_overflow(&x); | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
kdb_panic(const char *msg) | kdb_panic(const char *msg) | ||||
{ | { | ||||
kdb_why = KDB_WHY_PANIC; | |||||
printf("KDB: panic\n"); | printf("KDB: panic\n"); | ||||
panic("%s", msg); | panic("%s", msg); | ||||
} | } | ||||
void | void | ||||
kdb_reboot(void) | kdb_reboot(void) | ||||
{ | { | ||||
kdb_why = KDB_WHY_REBOOT; | |||||
printf("KDB: reboot requested\n"); | printf("KDB: reboot requested\n"); | ||||
shutdown_nice(0); | shutdown_nice(0); | ||||
mhorne: I don't think shutdown_nice() actually enters kdb. Do we need this WHY? | |||||
Not Done Inline ActionsI suspect that downstream wants to check kdb_why in the cnputc() called from printf(). I don't know though of the value of checking kdb_why in cnputc() if kdb hasn't been entered yet? Understanding the reason for that KASSERT may help understand this change better. jhb: I suspect that downstream wants to check kdb_why in the cnputc() called from printf(). I don't… | |||||
Done Inline ActionsThey allow cnputsn to print with interrupts enabled. To avoid deadlock that have special cased some subsystems which handle deadlock on their own. They assert that kdb_why is not KDB_WHY_UNSET when running with interrupts enabled in cnputsn. This part of their change is very specific to their code base. thj: They allow cnputsn to print with interrupts enabled. To avoid deadlock that have special cased… | |||||
} | } | ||||
/* | /* | ||||
* Solaris implements a new BREAK which is initiated by a character sequence | * Solaris implements a new BREAK which is initiated by a character sequence | ||||
* CR ~ ^b which is similar to a familiar pattern used on Sun servers by the | * CR ~ ^b which is similar to a familiar pattern used on Sun servers by the | ||||
* Remote Console. | * Remote Console. | ||||
* | * | ||||
* Note that this function may be called from almost anywhere, with interrupts | * Note that this function may be called from almost anywhere, with interrupts | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | |||||
* string than 'msg', and is relied upon by DDB scripting to identify the | * string than 'msg', and is relied upon by DDB scripting to identify the | ||||
* reason for entering the debugger so that the right script can be run. | * reason for entering the debugger so that the right script can be run. | ||||
*/ | */ | ||||
void | void | ||||
kdb_enter(const char *why, const char *msg) | kdb_enter(const char *why, const char *msg) | ||||
{ | { | ||||
if (kdb_dbbe != NULL && kdb_active == 0) { | if (kdb_dbbe != NULL && kdb_active == 0) { | ||||
kdb_why = why; | |||||
if (msg != NULL) | if (msg != NULL) | ||||
printf("KDB: enter: %s\n", msg); | printf("KDB: enter: %s\n", msg); | ||||
kdb_why = why; | |||||
breakpoint(); | breakpoint(); | ||||
kdb_why = KDB_WHY_UNSET; | kdb_why = KDB_WHY_UNSET; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Initialize the kernel debugger interface. | * Initialize the kernel debugger interface. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |
I don't think shutdown_nice() actually enters kdb. Do we need this WHY?