This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using reverse execution


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]