kgdb,debug-core,gdbstub: Hook the reboot notifier for debugger detach
authorJason Wessel <jason.wessel@windriver.com>
Fri, 16 Mar 2012 19:20:41 +0000 (14:20 -0500)
committerJason Wessel <jason.wessel@windriver.com>
Thu, 22 Mar 2012 20:07:15 +0000 (15:07 -0500)
commit2366e047840e33928803c0442176fb3991423da8
tree6c1488ee97a24c85dd4f2ddb1a06a5694de6e2f2
parent9fbe465efc76044dd87afe764db5464ae61aeabc
kgdb,debug-core,gdbstub: Hook the reboot notifier for debugger detach

The gdbstub and kdb should get detached if the system is rebooting.
Calling gdbstub_exit() will set the proper debug core state and send a
message to any debugger that is connected to correctly detach.

An attached debugger will receive the exit code from
include/linux/reboot.h based on SYS_HALT, SYS_REBOOT, etc...

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
kernel/debug/debug_core.c
kernel/debug/gdbstub.c