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.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to