From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb@sources.redhat.com
Subject: Re: (linux/threads) Interesting side-effect of "auto-solib-add 0"
Date: Wed, 13 Sep 2006 02:21:00 -0000 [thread overview]
Message-ID: <20060913022113.GA26971@nevyn.them.org> (raw)
In-Reply-To: <20060913004720.GG24293@adacore.com>
On Tue, Sep 12, 2006 at 05:47:20PM -0700, Joel Brobecker wrote:
> > 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.
>
> It's really strange. I put traces everywhere inside linux-thread-db
> so that if there was any callbacks called during the detection,
> I would see them. As you can see, I'm not very familiar with how
> this library works. Do you know where the callbacks are in the
> debugger code?
Ah, simple: they're not there. Take a look at the ps_* routines in
proc-service.c. In particular, ps_pglobal_lookup. It's not at all
surprising that you couldn't find them; this is a very rare library
interface. The shared library actually has undefined symbols which
must be satisfied by GDB.
Do you want to stick a comment in linux-thread-db.c somewhere
suggesting a look over there too?
> I've been trying to find a document that explains
> how the pthread_db library works, is there one?
Well, the way we use glibc's isn't documented anywhere, but this
library is historically Sun's - their documentation may be enlightening.
> > > 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.
>
> Sounds fair enough to me.
The technical alternative, if you want to implement it, would be to
always load symbols for libpthread. What do you think? We don't even
really need debugging symbols - just the minimal (ELF) symbol table.
> Eli, everyone,
>
> Would it be something worth documenting somewhere in the manual?
> I could probably write a small paragraph somewhere after the description
> of the auto-solib-add setting.
If we leave it the way it is, I think this is a great idea. Please be
sure to mark it as a GNU/Linux specific issue.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-09-13 2:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 0:27 Joel Brobecker
2006-09-13 0:33 ` Daniel Jacobowitz
2006-09-13 0:47 ` Joel Brobecker
2006-09-13 2:21 ` Daniel Jacobowitz [this message]
2006-09-13 3:45 ` Joel Brobecker
2006-09-13 3:47 ` Daniel Jacobowitz
2006-09-13 3:23 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060913022113.GA26971@nevyn.them.org \
--to=drow@false.org \
--cc=brobecker@adacore.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox