delphij's Chaos

选择chaos这个词是因为~~实在很难找到一个更合适的词来形容这儿了……

16 May 2004

How to debug a live FreeBSD kernel?

To quote Matthew Dillon:

    You can actually run gdb on a live kernel like this:

    gdb -k /dev/mem /path/to/kernel.debug

    You can then use the 'proc' command to switch to a process (give it a
    pid), and do a stack backtrace.  That part only really works if the
    process is blocked on something (i.e. not running).

    But you can also dig around kernel globals and various data structures
    and that can be quite useful on a live system.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>