How to debug a live FreeBSD kernel?
To quote Matthew Dillon:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| 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>
|
在线阅读本文并参与讨论
delphij's Chaos
https://blog.delphij.net/posts/2004/05/how-to-debug-a/