Table of Contents
It is possible to transition between kdb and kgdb dynamically. The debug core will remember which you used the last time and automatically start in the same mode.
There are two ways to switch from kgdb to kdb: you can use gdb to
issue a maintenance packet, or you can blindly type the command $3#33.
Whenever kernel debugger stops in kgdb mode it will print the
message KGDB or $3#33 for KDB
. It is important
to note that you have to type the sequence correctly in one pass.
You cannot type a backspace or delete because kgdb will interpret
that as part of the debug stream.
Change from kgdb to kdb by blindly typing:
$3#33
Change from kgdb to kdb with gdb
maintenance packet 3
NOTE: Now you must kill gdb. Typically you press control-z and issue the command: kill -9 %
There are two ways you can change from kdb to kgdb. You can manually enter kgdb mode by issuing the kgdb command from the kdb shell prompt, or you can connect gdb while the kdb shell prompt is active. The kdb shell looks for the typical first commands that gdb would issue with the gdb remote protocol and if it sees one of those commands it automatically changes into kgdb mode.
From kdb issue the command:
kgdb
Now disconnect your terminal program and connect gdb in its place
At the kdb prompt, disconnect the terminal program and connect gdb in its place.