This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Shared libraries in static programs
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 12 Apr 2007 16:03:33 -0700
- Subject: Re: [rfc] Shared libraries in static programs
- References: <20070412221025.GA2848@caradoc.them.org>
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