3 ms·
You can use /proc to get what you need. It has a memory map and the memory itself. Read the map, pull the heap segments out, and read them into files named af
by lallysingh 7y ago
You can use /proc to get what you need. It has a memory map and the memory itself. Read the map, pull the heap segments out, and read them into files named after the addresses. On an identical machine, load the process up, attach via gdb, and (this is the tricky part) then mmap in the files saved from the other side at the right addresses. If you can get the roots into your heap (tough), you can use gdb'd python API to write a traverser to get the data you need back out.
- dbancajas 7y agoSeems like a checkpoint restore process. Do you have experience of this or actual guide? I'm really curious as to the underlying mechanism.
- lallysingh 7y agoNothing so formal. The tricky parts are the non-memory program state: registers and instruction pointers for all threads.