Next: SVR4 Process Information, Up: Native [Contents][Index]

#### 21.1.1 BSD libkvm Interface

BSD-derived systems (FreeBSD/NetBSD/OpenBSD) have a kernel memory interface that provides a uniform interface for accessing kernel virtual memory images, including live systems and crash dumps. GDB uses this interface to allow you to debug live kernels and kernel crash dumps on many native BSD configurations. This is implemented as a special `kvm` debugging target. For debugging a live system, load the currently running kernel into GDB and connect to the `kvm` target:

    (gdb) target kvm

For debugging crash dumps, provide the file name of the crash dump as an argument:

    (gdb) target kvm /var/crash/bsd.0

Once connected to the `kvm` target, the following commands are available:

`kvm pcb`

  Set current context from the Process Control Block (PCB) address.

`kvm proc`

  Set current context from proc address. This command isn’t available on modern FreeBSD systems.