Guide to contribute to kernel video drivers
Arto Pekkanen
isoa at kapsi.fi
Sat Feb 20 21:39:00 UTC 2016
Eax Melanhovich kirjoitti 20.02.2016 09:43:
> Hello
>
> Thanks a lot for a guide!
>
> I have a few questions.
>
> Do I right understand that the only way to debug a kernel is to crash
> it and then analyze a dump using gdb? Is it possible to attach to a
> running kernel remotely?
>
What you probably want to do is force the target kernel (on the machine
to be debugged) to enter into DDB (kernel debugger) at boot, and then
use DDB to do the debugging work (set break points etc).
After DDB has started, you can make it work with GDB on another machine
via serial port.
Here is a short tutorial for using DDB, which explains how to break into
DDB on boot among other things:
https://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-ddb.html
And here is the part explaining how to use GDB on remote:
https://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-ddb.html
Intel also published a pretty good hands-on guide:
https://software.intel.com/sites/default/files/profiling_debugging_freebsd_kernel_321772.pdf
That being said, I've never done online kernel debugging myself. But the
resources I referenced here give a pretty good idea on what can be done.
--
Arto Pekkanen
More information about the freebsd-x11
mailing list