kernel debugging question

Matthew Dillon dillon at apollo.backplane.com
Sat May 15 21:14:48 PDT 2004


:Dear folks,
:
:I've set up serial GDB now and I'm using it with growing fascination to 
:explore the internal workings of the kernel. But what techniques are 
:there to see what's going on _before_ the call to Debugger() in 
:machdep.c (except staring at the code)?
:
:Regards,
:Sascha
:
:-- 
:http://yoyodyne.ath.cx

    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 at xxxxxxxxxxxxx>





More information about the Kernel mailing list