More often than I care to admit, I'll mistakenly click "step over" when I mean to click "step in". I would give anything (well, anything measured in CPU cycles and / or memory usage) to have even just one level of "undo" when stepping through code.
I don't think this is feasible. The best we could do is, when stepping over, do an initial "step in" and record the state there, and provide in option to "go back" and view the ghost in the machine that once was. You couldn't interact with any of the state though. Considering how limiting that experience would be, and the technical complexity of doing it (as well as major performance concerns), it's probably not worth it.
It is a great feature idea... but it does seem to imply having a complete reverse / time-travel debugging system. One day, I hope we do have such a thing!
I wonder if exposing the debugger's previous position after each step would alleviate most of the pain? E.g., I'm 10 minutes and 5 stack frames deep when I accidentally hit "step over" rather than "step in" (or "continue" instead of "step over") and now I'm looking at a completely different region of code. If I could easily look back into the callee and set a breakpoint, I could get back to where I left off much more quickly than I can now. ...but I could also see the UI complexity of something like that creating more cost than benefit. Oh well, happy to close this as wontfix and continue dreaming. :)
How come "step over" takes you to a completely different region of the code? You should just be on the next line, and you could set a breakpoint on the previous line to get back there.
Huh, you're right. I could've sworn I hit a point where hitting "step over" on the last line of something returned me to the outer scope, but I can't repro. Must be imagining things.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
Microsoft just announced a time travel debugger as part of the F12 DevTools in Edge. "Step back after hitting a break point, change code, go forward." I want this, and I want Firefox to have this. :( Being a jerk and reopening. :)
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
It's worth opening this for now, I'd like to test what they have, see what it can do, and file more specific bugs relating to what to implement. This is a pretty big feature by itself. It's really cool to see them attempt this, and I'm very curious how much works. I envision tracing data mutations and "undoing" them wouldn't be too hard, but walking back up the stack and changing code seems harder. I wander if in their implementation you actually can walk backwards past a stack frame.
Whither webrr? I thought we had a bug for that but I'm not seeing it now.
Priority: -- → P3
Bug 1207696 is the initial landing tracker for web replay.
You need to log in before you can comment on or make changes to this bug.