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
kvm debugging target. For debugging a live system, load
the currently running kernel into GDB and connect to the
(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
Set current context from the Process Control Block (PCB) address.
Set current context from proc address. This command isn’t available on modern FreeBSD systems.