The kgdbreboot feature allows you to change how the debugger deals with the reboot notification. You have 3 choices for the behavior. The default behavior is always set to 0.
echo -1 > /sys/module/debug_core/parameters/kgdbreboot
Ignore the reboot notification entirely.
echo 0 > /sys/module/debug_core/parameters/kgdbreboot
Send the detach message to any attached debugger client.
echo 1 > /sys/module/debug_core/parameters/kgdbreboot
Enter the debugger on reboot notify.