public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Howard Chu <hyc@symas.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Process memory map
Date: Wed, 3 Nov 2021 20:20:30 +1300	[thread overview]
Message-ID: <CAFOYHZCtVtj9oA9sL=-VfdEnp6r6SKtPi=qcswF=1EpiDpJV_Q@mail.gmail.com> (raw)
In-Reply-To: <11b6bfd2-dc8b-4f07-a6ee-74fceda32054@symas.com>

On Wed, Nov 3, 2021 at 1:33 PM Howard Chu <hyc@symas.com> wrote:
>
> Is the complete map of process address space saved in a core file? When debugging
> with a core file, is there a gdb command to mmap the files that were mapped at the
> time the core was taken, so that references to addresses in those regions will be
> valid?

I recently had a similar need. I found `info proc all` (technically
`info proc mappings`) contained the mapping info I needed. For a
regular core file the shared libraries were automatically loaded (in
my case I needed to `set auto-load safe-path` and `set sysroot` for my
cross-build environment). The one slight problem I had was with a very
specific core file where the crash was in ld.so in that specific case
it wasn't automatically loaded and I had to muck around with `add
symbol-file` and manually working out some offsets to get it loaded
into the right place.

I'd be interested in hearing tips from anyone else.

> --
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/

  reply	other threads:[~2021-11-03 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  0:32 Howard Chu
2021-11-03  7:20 ` Chris Packham [this message]
2021-11-03 15:59   ` John Baldwin
2021-11-03 16:07     ` Howard Chu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFOYHZCtVtj9oA9sL=-VfdEnp6r6SKtPi=qcswF=1EpiDpJV_Q@mail.gmail.com' \
    --to=judge.packham@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=hyc@symas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).