This is the mail archive of the
mailing list for the GDB project.
Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
On Mon, Apr 20, 2009 at 11:03 AM, Daniel Jacobowitz <firstname.lastname@example.org> wrote:
> I don't see why you need the symbol list for this; shouldn't we do the
> search at the same time we'd previously have pushed libthread_db?
Previously, dlopen was performed at initialization time, and then
thread_db_ops was pushed when (and only when) td_ta_new returned TD_OK
(checked on attach, and on every new solib).
If td_ta_new returned TD_NOLIBTHREAD, we assumed that there are no threads
at all (at least not yet), and any other error produced a warning.
One example where this fails: static LinuxThreads exe on NPTL system:
td_ta_new returns TD_NOLIBTHREAD (which is semi-correct -- no NPTL
libpthread), so no warning is issued; but then GDB doesn't work :-(
The symbol lookup is there in the new code to firmly establish a point
where threads are known to be present, so we can issue correct warning if
at that point no working libthread_db can be found.
I don't see how to establish that "threads are present" point without
symbol lookup, nor how to keep the proper warning if we don't know for
sure whether they are.
> went through a lot of pain to get the timing right for both dynamic
> and static binaries.
Yes, it caused me a bit of trouble as well :-(
But (a variant of) the current patch has been tested in all combinations :-)