Since you can call target process functions from GDB, it would be interesting to have some form of "emergency dump" function you could call, to get out the data even though the process as a whole has hung.<p>This would have the benefit by being implemented in the target process itself, so it could of course have full knowledge of the data structures and so on. It could potentially be way better than a raw (manual) memory-level inspection.<p>That would of course be quite hard to implement in a general (and large) server-type process, but it might be useful even if less than perfect.<p>I/O might become a problem, so perhaps just format the data in RAM, then let the debugger read it out. The RAM itself might be pre-allocated to ensure that it exists at the point of failure (when heap allocations likely won't work very well).<p>Has anyone done this?<p><i>EDIT</i>: On second thought, I guess it becomes unwieldy for real-world use cases due to the volume of data. I wouldn't want to pre-allocate multiple GBs of RAM to use an export buffer for some database server, of course. Paging ... Hm.