How to Boot a system with the Kernel Debugger (kmdb) enabled

This is a simple procedure which shows how to load the kernel debugger (kmdb)

  1. Halt the system, causing it to display the ok prompt. To halt the system cleanly, use the halt command.
  2. Type either boot kmdb or boot -k to request the loading of the kernel debugger.
  3. Access the kernel debugger. Note — The method used to enter the debugger depends on the type of console that is used to access the system:
    • If you are using a locally attached keyboard, press Stop-A or L1—A, depending on the type of keyboard.
    • If you are using a serial console, send a break by using the method that is appropriate for your type of serial console.
    A welcome message is displayed when you enter the kernel debugger for the first time.
    Rebooting with command: kadb
    Boot device: /iommu/sbus/espdma@4,800000/esp@4,8800000/sd@3,0
    .
    .
    .

Example

ok boot kmdb
Resetting...
Executing last command: boot kmdb -d
Boot device: /pci@1f,0/ide@d/disk@0,0:a File and args: kmdb -d
Loading kmdb...

Note:

  • Use the reboot command and the halt command with the -d option if you do not have time to debug the system interactively.
  • Running the halt command with the -d option requires a manual reboot of the system afterwards. However, if you use the reboot command, the system boots automatically. See the reboot(1M) for more information.