This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: (linux/threads) Interesting side-effect of "auto-solib-add 0"
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 12 Sep 2006 20:33:47 -0400
- Subject: Re: (linux/threads) Interesting side-effect of "auto-solib-add 0"
- References: <20060913002712.GF24293@adacore.com>
On Tue, Sep 12, 2006 at 05:27:13PM -0700, Joel Brobecker wrote:
> It seems to me that we should be able to fix this by adding an observer
> of the `solib_loaded' event to replace the hook that linux-thread-db
> installed. I actually gave it a try, using the sources from CVS, and
> found out something surprising: Although the solib_loaded observer
> I just created gets called as expected, the linux thread layers does
> not detect that threads are in use:
You've missed the pertinent fact here. We're not waiting for
libpthread.so to be loaded just for kicks! The only way libthread_db
can operate is by querying back through GDB for the locations of
symbols in the thread library. If we don't load that objfile, then
it can't initialize.
> The only difference I can see between the two runs is that symbols
> are read in one case, and not read in the other case. Is libthread_db.so
> dependent on having the symbol table being loaded or something of that
> sort?
Yes. Don't load libpthread, won't get threads.
--
Daniel Jacobowitz
CodeSourcery