This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Using reverse execution
- From: Jim Blandy <jimb at redhat dot com>
- To: "Min Xu (Hsu)" <xu at cs dot wisc dot edu>
- Cc: Stan Shebs <shebs at apple dot com>, gdb at sources dot redhat dot com
- Date: Tue, 13 Sep 2005 15:00:35 -0700
- Subject: Re: Using reverse execution
- References: <432628AA.2040808@apple.com> <20050913181057.GH5161@cs.wisc.edu>
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.