views:

189

answers:

5

I just want to dump core without stopping the program. This would be essentialy serializing a whole state of the program. A very convenient thing for debugging later.

Is it possible under linux?

+2  A: 

I don't think this is exactly what you want (unless you want to pause the program while inspecting, or even modify the memory), but have a look at CryoPID.

Artelius
A: 

should be doable, at least /proc//smaps contains information of the process memory and the actual memory should be accessible via /dev/mem

I think you need to suspend the process to avoid corruption of the captured info, though.

Kimvais
+2  A: 

What you're looking for is a "time travel debugger" which can travel back in time to the previous state of the program you're debugging.

There is one commercial product for Linux called UndoDB.

ssg
Indeed, that's what I'm looking for.
Łukasz Lew
It is free (as in beer) for non-commercial use :D I will give it a try.
Łukasz Lew
+4  A: 

I found simple solution:

$gcore
usage:  gcore [-o filename] pid

It is distributed with gdb.

Łukasz Lew
That looks like the kind of program I've wanted for years! Much more reliable than kill -11 :-) Thanks Łukasz!
Arthur Reutenauer
Happy to help. :)
Łukasz Lew
A: 

Even better!!! Gdb 7.0 have support for reversible debugging. And it was released yesterday, what a coincidence :D

Łukasz Lew