Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not quite sure what "drop frames" means in this context, but a use case would be stepping through the debugger, realising that the problem might be in a piece of code that has already executed, and wanting to inspect the value of a variable at that point in time.

Or even more mundane: accidentally hitting "Step over" twice in a row.



In most debuggers you can drop back up the stack to the code that called the function you are currently in, and thus debug through the function call again.

Example: https://stackoverflow.com/questions/2367816/when-using-the-j...

"Using the "Drop Frame" functionality you can "fall back" to a previous stack frame, in a sense going back in time."


That Stack Overflow answer is poorly worded though, looking at an outer stack frame is really nothing like going back in time. Going back in time in the Firefox Replay sense means reversing execution of the program, e.g. to find the values of variables that have been mutated or gone out of scope.


But that's what drop frame does - it goes back to the state before your current function call, including resetting variables. It does not revert global state (like static variables) but it is essentially like reverting execution 95% of the times I use it.


It doesn’t really ”go back”, it just shows a different stack frame, which is part of the current state of the program.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: