Debugging Linux Kernel using KGDB Part-5 - kgdbreboot
If you want your debugger to run, when the target machine is going to reboot, you can use "kgdbreboot" parameter to kernel command line.
There are three values to this variable. The default value is 0.
If you want to enable this feature at runtime instead of adding kgdbreboot at commandline, you can use sysfs.
echo -1 > /sys/module/debug_core/parameters/kgdbreboot
There are three values to this variable. The default value is 0.
Kgdbreboot Value
|
Significance
|
0
|
Detach message is sent to gdb. Gdb exits
the debugging, and you will get the following message.
[Inferior 1 (Remote target)
exited with code 01]
|
1
|
GDB Provides you option to debug
|
-1
|
No notification is sent to gdb debugger
|
If you want to enable this feature at runtime instead of adding kgdbreboot at commandline, you can use sysfs.
echo -1 > /sys/module/debug_core/parameters/kgdbreboot
echo 0 > /sys/module/debug_core/parameters/kgdbreboot
echo 1 > /sys/module/debug_core/parameters/kgdbreboot
Comments
Post a Comment