Using reverse execution
Jim Blandy
jimb@redhat.com
Tue Sep 13 22:01:00 GMT 2005
ptrace allows you to stop the program just before and after it makes a
system call; this allows programs like strace to recover the
parameters that were passed, and the values returned. It's also
enough control to allow you to "replay" the system calls with values
you've saved earlier. Michael Chastain has written a program to do
this. The system call record would have to be related in the
appropriate way to whatever bookmarks or checkpoints the system
retained.
Some obvious restrictions:
- if you rewind and then modify the inferior's state, it may not make
the same system calls it did before. The illusion can't be
sustained, and you just have to punt somehow.
- Getting signals like SIGIO or SIGWINCH to arrive at exactly the same
points is something I just don't know how to do. It's clear how to
take and restore snapshots, but it's not clear how to recognize when
a system has re-reached a given state and should have its signal
re-delivered.
But it still seems like enough to be helpful in a lot of cases.
More information about the Gdb
mailing list