KGDB is a source level debugger for the STLinux kernel. It allows kernel developers to use sh4-linux-gdb or arm-linux-gdbto debug the kernel in a similar way to debugging application programs. This version of the kernel debugger is not distributed as a kernel patch, but is already included in the kernel tree. For more information on KGDB, see http://kgdb.sourceforge.net.

KGDB is an alternative to debugging the STLinux kernel using an ST Micro Connect or ST Micro Connect 2. In most cases, the latter approach is recommended. However, KGDB does not require access to a JTAG port, and can provide slightly better performance is highly-loaded systems.

Major KGDB features

  • KGDB interfaces with the kernel using either the serial ports or ethernet.

  • Kernel module debugging is supported.

  • It is possible to detach sh4-linux-gdb from a running kernel and reattach it. If gdb dies, or has to be killed because of some problem, a new instance can be started and reconnected to the kernel.

KGDB documentation

The KGDB documentation is included in the kernel sources. The internal documentation is available in various formats: sgmldocs (SGML), psdocs (Postscript), pdfdocs (PDF), htmldocs (HTML) and mandocs (man pages).

For example, executing the make pdfdocs command in the Documentation/DocBook directory creates the kgdb.pfd file.