Process memory map

Chris Packham judge.packham@gmail.com
Wed Nov 3 07:20:30 GMT 2021


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/


More information about the Gdb mailing list