Reverse Execution in GDB 7 is imminent
gnu.org
gnu.org
I guess the advantage of doing it that way is that the majority of the memory pages can be shared if the OS uses a copy-on-write virtual memory system.
This:
Breakpoints and watchpoints will work in reverse -- allowing you for instance to proceed directly to the previous point at which a variable was modified.
is going to absolutely killer functionality for reverse engineers.
http://www.lambdacs.com/debugger/
watch the author give a talk at Google: http://video.google.com/videoplay?docid=3897010229726822034
I wonder how much memory will it take to run a "usefully large" program with state recording on? In theory you could compress some memory mutations pretty easily (like bzero()ing something) while other mutations would need more memory (writing single ints to various locations). I bet you could generate some nifty 10GB logs with this thing!
It's rather like adding a "time" dimension to your core file. ;-)
The huge issue here is, the most probable reason for segfaulting was an unexpected value coming from the environment and it's impossible to know the environment the process was running in post-mortem.
Unfortunately I was too lazy to finish it, but I think it would have worked. It was just a proof of concept.
Hmm, maybe I should put that in all my programs - then I won't ever have bugs from segfaults.
:)
char foo[640*1024];
int main(int argc, char ** argv) { return 0; }
When ran, it made the OS say "Out of memory" and then it was lab assistant's headache to unload all that resident stuff that was sitting there and eating good 20-30% of available RAM. They typically opposed to doing that, so the TAs assumed the program actually worked. The end :)Hmm ... :)
Second, the debugger generally catches the signal before it gets handled.