This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1


On Mon, Apr 20, 2009 at 09:47:30AM -0700, Paul Pluzhnikov wrote:
> On Mon, Apr 20, 2009 at 6:17 AM, Daniel Jacobowitz <drow@false.org> wrote:
> 
> > I have just a few minor comments on this. ?Overall, I am heartily
> > in favor of the idea - I have carried a less elegant version of this
> > feature in the Debian GDB packages for two years or so.
> 
> Could you tell a bit more about this? I thought out set up with
> multiple incompatible (WRT libthread_db) libc versions was more an
> exception than the rule.

LinuxThreads and NPTL on the same system.  It's a lot less common now
- which is why I was going to let the patch fade away instead of
merging it - but I used to need this regularly.

> It might be reasonable to override these via CFLAGS. In particular,
> we intend to override the LIBTHREAD_DB_SEARCH_PATH with an appropriate
> local default. Of course we could just as easily patch the source.

OK, makes sense.  We use configure options for that mostly, but it may
not be worth the effort here.

> >> + ?if (!msym)
> >> + ? ?msym = lookup_minimal_symbol ("__pthread_threads_events", NULL, NULL);
> >
> > Why is this symbol lookup necessary? ?Is it accomplishing the same
> > thing that searching for a shared library matching "libpthread[-.]"
> > would?
> 
> The symbol lookup works for statically linked executables (which we
> also have and would like to support). Searching for libpthread solib
> doesn't.

I see.  Do you ship a libthread_db.so alongside a static executable?

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]