Getting a core dump of a process without killing it?

Dieter BSD dieterbsd at gmail.com
Sat Jan 2 22:41:48 UTC 2016


I have a (stopped) process which hopefully has some data in its
memory.

Is there a way to get a core dump of a process without killing it?

Looked in kern_sig.c but it appears that any signal that gives a
core dump also kills the process.

Created a similar process, sent it a SIGTRAP, looked at the core dump
with hexdump and found the data.  But of course SIGTRAP also kills the
process.

Gdb can attach to a process and dump areas of memory,
(dump memory filename addr1 addr2) if you can figure
out what address range(s) you want.  I tried "maint info sections"
but no joy.  Use too large a range with "dump memory" and
gdb fails.  There doesn't seem to be a dump everything option.

FreeBSD 8.2 [ because 10.1 doesn't work :-( ] on amd64
ps reports that VSZ is 108104.


More information about the freebsd-hackers mailing list