KDB kernel debugger and kdb command

This document describes the KDB kernel debugger and kdb command. The KDB kernel debugger and the kdb command are the primary tools a developer uses for debugging device drivers, kernel extensions, and the kernel itself.

Although they appear similar to the user, the KDB kernel debugger and the kdb command are two separate tools:

KDB kernel debugger
The KDB kernel debugger is integrated into the kernel and allows full control of the system while a debugging session is in progress. The KDB kernel debugger allows for traditional debugging tasks such as setting breakpoints and single-stepping through code.
kdb command
This command is implemented as an ordinary user-space program and is typically used for post-mortem analysis of a previously-crashed system by using a system dump file. The kdb command includes subcommands specific to the manipulation of system dumps.

Both the KDB kernel debugger and kdb command allow the developer to display various structures normally found in the kernel's memory space. Both do the following:

  • Provide numerous subcommands to decode various data structures found throughout the kernel.
  • Print the data structures in a user-friendly format.
  • Perform debugging at the machine instruction level. Although this is less convenient than source level debugging, it allows the KDB kernel debugger and the kdb command to be used in the field where access to source code might not be possible.
  • Process the debugging information found in XCOFF objects. This allows the use of symbolic names for functions and global variables.