Reversible Debugging
Patrick Sabin
patrick.just4fun at gmail.com
Sat Jul 4 04:33:03 EDT 2009
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. 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.
> This is also somewhat useful if you're trying to debug an error that
> happens deep inside of a program, so you can continually jump to the
> point right before the error happens, instead of needing to run
> through the entire program each time it crashes. Just beware of tunnel
> vision.
I think of implementing some snapshot/restore mechanism first. That may
help in many other situations.
More information about the Python-list
mailing list