DragonFly BSD
DragonFly kernel List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: debugging kernel threads


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Jan 2005 10:04:41 -0800 (PST)

:At Wed, 26 Jan 2005 10:52:45 +0100,
:Richard Nyberg wrote:
:> 
:> I often use gdb's proc command to switch between different processes
:> when debugging kernel cores. Now I want to debug a kernel thread
:> and it doesn't seem to work. Does anyone know how to switch to a
:> kernel thread? Maybe proc could be tweaked to work for threads too.
:>
:Replying to myself...
: 
:I RTFS and it looked like proc should work with kernel threads.
:The problem seems to be that the threads td_pcb is invalid.
:
:Example:

    Theoretically you can give the 'proc' command a thread address (not a
    proc address, a thread address) and it should switch to it.

    But Joerg's recent upgrades of gdb seem to have broken some things
    that had been working before.

    Pure kernel threads do not have PCBs in the conventional sense.  The
    thread state is pushed onto the stack for the switch/restore instead.
    Most of the pcb structure will be unused for a kernel thread.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]