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: [rfc] Shared libraries in static programs


On Thu, 12 Apr 2007 18:10:25 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> Glibc has a complicated mechanism where a static executable may
> include a chunk of libdl, for dlopen.  If this gets used, then it
> initializes _r_debug just like normal.
> 
> There are three differences:
>   - There's no .dynamic, so we can't use DT_DEBUG.
>   - We shouldn't skip the first thing on the list, because the
>     executable is not dynamic and therefore is not on the list.
>   - _dl_debug_state might be in exec_bfd, so we should set a
>     breakpoint there if we can.
> 
> This patch, lightly tested, lets me get at the shared library I was
> trying to debug.  Does it look OK?

It looks reasonable to me.  Feel free to commit it.

Thanks,

Kevin


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