Reversible Debugging
Dave Angel
davea at ieee.org
Sat Jul 4 09:58:39 EDT 2009
Scott David Daniels wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">Patrick
> Sabin wrote:
>> Horace Blegg schrieb:
>>> You might consider using a VM with 'save-points'. You run the
>>> program (in a debugger/ida/what have you) to a certain point
>>> (logical point would be if/ifelse/else statements, etc) and save the
>>> VM state. Once you've saved, you continue. If you find the path
>>> you've taken isn't what you are after, you can reload a previous
>>> save point and start over, trying a different path the next time.
>> That was my idea to implement it. I thought of taking snapshots of
>> the current state every time a "unredoable instruction", e.g random
>> number generation, is done.
> Remember, storing into a location is destruction.
> Go over a list of VM instructions and see how many of them are undoable.
>
> </div>
>
>
Read his suggested approach more carefully. He's not "undoing"
anything. He's rolling back to the save-point, and then stepping
forward to the desired spot. Except for influences outside his control
(eg. file system operations), this approach has to work. Even random
will work the same, if the generator uses only data that was restored
from the save-point. A typical pseudo-random generator works from a
seed, and if the seed is restored as part of rolling back, he's fine.
If the snapshot is done via VMWare (for example), he's even okay for
file operations, except for network and VM-shared files.
"I thought of taking snapshots of the current state every time a
"unredoable instruction", e.g random number generation, is done. For
every other instruction I count the number of instructions done since
the last snapshot. So I can go back one instruction by restoring to the
previous state and go the number of instructions minus one forward."
DaveA
More information about the Python-list
mailing list