gdb and cloned process

Daniel Jacobowitz drow@false.org
Thu Oct 23 17:19:00 GMT 2008


On Thu, Oct 23, 2008 at 10:13:11AM -0700, Lukasz Lempart wrote:
> On Wed, Oct 22, 2008 at 8:05 PM, Daniel Jacobowitz <drow@false.org> wrote:
> > On Wed, Oct 22, 2008 at 05:09:32PM -0700, Lukasz Lempart wrote:
> >> How does gdb (through libthread_db) figure out what threads belong to a process?
> >
> > The thread library maintains an internal list of threads.  If you've
> > cloned the process, without telling the C library about that, you're
> > going to end up with the same list of threads; so the behavior you
> > describe is not surprising.
> >
> Is there a way to do this? I can't seem to find anything in
> libthread_db that would allow me to do this. Furthermore, the two
> processes share their entire address space, so any change made to the
> internal list of threads for one process would have impact on the
> other one.

Not that I can think of.  You'd have to hack up gdb a bit.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list