Debugging a running FreeBSD kernel in a VM using kgdb
Using KGDB Remote Debugging for FreeBSD VMs This guide explains how to debug a running FreeBSD kernel in a VM using kgdb. The default ddb debugger has decent functionality, but unless you somehow know dynamic memory addresses, those capabilities are effectively unusable. Conversely, kdb offers a more robust interface and set of features. While there is a handbook section on kgdb, it assumes you are running FreeBSD on bare-metal with a physical serial port connected to another serial host, not on modern virtualized infrastructure.
Read more...