Hacker News new | ask | show | jobs
by ok_dad 1406 days ago
I love using the debugger but now I want one where I can rewind the program a few steps if I want to. The use case I have is to go back and forth trying out different combinations of variables on a section of code. Even if I could manually set a flag to store the program state at certain portions so I can return there, that would work great.

Other than that, debuggers are very superior to print statements and such. You can’t pause a print statement and inspect the objects you didn’t print!

1 comments

There is actually a surprising amount of reverse debugging products out there, some are listed here: http://jakob.engbloms.se/archives/1564

Would you be willing to use one of those?

Hey, thanks for all the references!

I looked through there; I code in Python for work (Lua at home a lot), so I didn't see anything that seemed to be targeted towards that use case. I've also seen tools like rr that record a session, but I specifically want to be able to step back and forth while executing code. I would use anything that, at minimum, would allow me to set a "save point" like a breakpoint and then return to that save point from any breakpoint, or from paused execution if I am stepping through the code.

I think it would be easier for Python, Lua, or other dynamic, interpreted languages to do this because you could store the program state via storing the interpreter's internal state more easily.

Also, I understand side-effects would complicate this and I am willing to ignore those issues if I had a bare-bones reversible debugger for Python.

Nice link. Thanks for sharing. I took a quick glance and saw that most of them are for embedded systems. Apart from gdb, do you know anything more friendly for Unix and C/C++ programs?
There is undo, I would be very interested in your thoughts on it: https://undo.io/

This may also contain further pointers that I missed: https://softwareengineering.stackexchange.com/questions/1815...