Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB full memory dump of process

Tags:

gdb

coredump

I'm trying to dump the memory of a process on a remote machine. The target machine is some kind of an old Linux, and I'm running gdbserver 8.3 on it that I've compiled.
I'm able to create some handy dumps using gcore command, however, these dumps are missing all of the r-x and r-- sections, it contains only writable sections. Can anyone guide me on how to generate a full memory dump including everything, preferably in the same core dump format?
I've already tried both

set use-coredump-filter on
set use-coredump-filter off

and

set dump-excluded-mappings on
set dump-excluded-mappings off
like image 538
Pagefault Avatar asked Sep 13 '25 22:09

Pagefault


1 Answers

You should set the core file filter in /proc/PID/coredump_filter per http://man7.org/linux/man-pages/man5/core.5.html.

E.g.

echo 0xff > /proc/$(pidof foo)/coredump_filter
gcore $(pidof foo)
like image 170
devtty1er Avatar answered Sep 17 '25 04:09

devtty1er