This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How can I get a memory map out of a core file?
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Daniel Jacobowitz <drow at false dot org>, Bruce Korb <bruce dot korb at gmail dot com>, Andreas Schwab <schwab at suse dot de>, gdb at sourceware dot org, Eli Zaretskii <eliz at gnu dot org>, Michael Snyder <msnyder at specifix dot com>
- Date: Mon, 09 Jun 2008 15:03:07 -0300
- Subject: Re: How can I get a memory map out of a core file?
- References: <200806091751.m59HpSSv020533@d12av02.megacenter.de.ibm.com>
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
On Mon, 2008-06-09 at 19:51 +0200, Ulrich Weigand wrote:
> Luis Machado wrote:
>
> > Yes. Mainly giving the user the option to show exactly what we had
> > in /proc/<pid>/maps right before the crash, so we know where things were
> > in memory, like the heap, stack and some specific shared libraries'
> > mappings.
> >
> > We currently can't do that. There's some information in the program
> > headers from a core file, like the one below, that show us a bit of
> > mapping-related information, but not enough so we can actually track
> > them down to a shared library.
>
> But shared library information should be available via
> "info sharedlibrary" (which uses the in-memory data structures
> allocated by ld.so, which are present in the core file) ...
>
> What is the extra information /proc/<pid>/maps provides that
> you're concerned about?
>
> Bye,
> Ulrich
/proc/<pid>/maps provides different types of mappings for the same
library. Like the .text section mapping or .data section mapping. "info
shared" only shows the .text section IIRC.
For example:
Start Addr End Addr Size Offset objfile
0x4000008d000 0x400001fc000 0x16f000 0 /lib64/libc-2.4.so
0x400001fc000 0x4000020b000 0xf000 0x16f000 /lib64/libc-2.4.so
0x4000020b000 0x4000020e000 0x3000 0x16e000 /lib64/libc-2.4.so
0x4000020e000 0x40000225000 0x17000 0x171000 /lib64/libc-2.4.so
Luis