KmodDebugging
Get your coredump.
Start kgdb:
kgdb /var/crash/kern.X /var/crash/vmcore.X
.Load some handy helper commands when you're at the kgdb prompt:
source /usr/src/test/debug/gdb.kernel
.Get the kld statistics from the kernel:
kldstat
at the kgdb prompt.Background kgdb (^Z).
Execute a helper utility to create another gdb script:
asf -s /modules
.Paste the output from the kgdb 'kldstat' command above.
Signal asf that you're ready (^D).
Foreground kgdb again:
fg
.Load the gdb script created by asf above to load kmod symbols:
source .asf
at the kgdb prompt.Print, list, backtrace to your heart's content! Be sure to have debug symbols compiled with your modules though ;).