kgdb - remote kernel debugging with gdb
Should a programmer be dissatisfied with the OpenBSD kernel's internal
debugger ddb(4), and have appropriate hardware available, a
option KGDB may be built to effect remote debugging with
To prepare for debugging over serial line one would:
+o Obtain a second system and a crossover serial cable.
+o Connect the systems and test the cable.
+o Build a kernel with option KGDB and makeoptions
+o Copy the resultant bsd.gdb to the control system, and
corresponding bsd on the target system.
+o On the control system, run gdb on the kernel just
+o Issue the command "target remote /dev/<serial port>"
The target system should enter kgdb at this point.
+o Debug as normal and detach when done, the target
gdb(1), ddb(4), options(4)
gdb info documents and online documentation.
The remote connection will introduce certain latencies a local debugger
would not see.
Not available on all architectures.
OpenBSD 3.6 August 23, 2001
[ Back ]