Kernel execution can be stopped by pressing Ctrl+C on the GDB terminal, which is a signal to KGDB to take control of the kernel and contact GDB.
This enables the console device to interpret special characters as commands to dump state information or to invoke the kernel debugger.
To add this support, enable the CONFIG_MAGIC_SYSRQ option during the configuration phase, in the section:
Kernel hacking ---> Magic SysRq Key
The debugger can be entered by sending the letter g to the /proc/sysrq-trigger file as shown below:
target# echo "g" > /proc/sysrq-trigger
SysRq : GDB
Entering GDB stubTo continue kernel execution, use the GDB command continue, which instructs the KGDB stub to resume running the kernel.