This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Paul Pluzhnikov <ppluzhnikov at google dot com>, Joel Brobecker <brobecker at adacore dot com>, Hui Zhu <teawater at gmail dot com>, tromey at redhat dot com, Thiago Jung Bauermann <bauerman at br dot ibm dot com>, Eli Zaretskii <eliz at gnu dot org>, Daniel Jacobowitz <drow at false dot org>
- Date: Mon, 11 May 2009 22:09:37 +0100
- Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
- References: <8ac60eac0904201019g7ba8056bx5e84e6bfdf5935d8@mail.gmail.com> <200905111412.59493.pedro@codesourcery.com> <8ac60eac0905111108g26096302lb902cd414b5a6790@mail.gmail.com>
On Monday 11 May 2009 19:08:46, Paul Pluzhnikov wrote:
> On Mon, May 11, 2009 at 6:12 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>
> >> handle = dlopen (library, RTLD_NOW);
> >
> > I wonder if making this RTLD_LAZY until you found the correct one
> > wouldn't make sense?
>
> I don't believe so.
>
> AFAICT, the reason for RTLD_NOW is to make sure that this
> libthread_db is really compatible with this GDB (doesn't require
> any symbols GDB doesn't provide); and also to prevent GDB from
> dying half way through with "unable to resolve symbol ...".
Yeah.
> Both of these still apply to whatever the "final" libthread_db is
> going to be.
>
> Why would we want to dlopen(... RTLD_LAZY) and try to initialize
> libthread_db if we are going to reject it as unusable in the end?
To avoid immediate binding of random libc's, but yeah, brain f*rt.
--
Pedro Alves