Drop frame rewinds a debugger to the point before a method was called, allowing that method to run again without restarting the application. It moves one layer back in the call stack and replays the call by stepping into or over it. section 3.4
Use it when a method needs another inspection after stepping into it. Unlike stepping out, which lets the method finish and pauses afterward, dropping a frame returns before the call so execution can be replayed. section 3.4
Investigate with these practical checks:
- Inspect the execution stack and select the method layer to revisit. section 3.4
- In IntelliJ IDEA, right-click the method’s stack layer and choose Drop Frame. section 3.4
- Confirm whether the method already changed a database, filesystem, or external application; rewinding execution does not undo those effects. section 3.5
A replay with a side effect
Suppose the debugger pauses in extractDigits(), called by decode(). Stepping out finishes extractDigits() and pauses in decode(); dropping the frame returns to the line before extractDigits(), where the call can be replayed. A method such as Files.createFile(Paths.get("File " + i)) warns that replaying execution may attempt an external filesystem change again. section 3.4
