This is the mail archive of the gdb@sources.redhat.com 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: Determining base address of shared library from core file


When doing this, I find a DT_DEBUG entry but is has a zero in the d_un.d_val
field (I am supposed to look at the executable and not the core dump right?)

-----Original Message-----
From: Kevin Buettner [mailto:kevinb@redhat.com]
Sent: Wednesday, July 21, 2004 1:53 PM
To: Bloch, Jack
Cc: gdb@sources.redhat.com
Subject: Re: Determining base address of shared library from core file


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


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