This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Determining base address of shared library from core file
- From: Kevin Buettner <kevinb at redhat dot com>
- To: "Bloch, Jack" <Jack dot Bloch at icn dot siemens dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 21 Jul 2004 10:53:04 -0700
- Subject: Re: Determining base address of shared library from core file
- Organization: Red Hat
- References: <7A25937D23A1E64C8E93CB4A50509C2A0310F29D@stca204a.bus.sc.rolm.com>
On Mon, 19 Jul 2004 07:51:31 -0700
"Bloch, Jack" <Jack.Bloch@icn.siemens.com> wrote:
> Is there an easy way to determine the base address of a shared library from
> a core file?
It depends upon what you mean by "easy".
For an SVR4-like system (which includes Linux), you have to traverse
the dynamic section to find the address of the r_debug struct. Once
that is done, you still have to traverse the link_map structs to find
the desired address. See solib-svr4.c for the gory details.
(IMO, this isn't very easy.)
Kevin