Debugging: What is step out?
13 November 2022 (Updated 1 December 2022)
On this page
In a nutshell
Step out will make the debugger proceed until the next “return” so that control is returned to the preceding stack frame.
When to step out?
When you’ve seen all you need to at this point of the method and want to bubble up the stack frame.
Example use
Given the following code:
function main() {
var s = foo();
bar(s);
}
function foo() {
return "hi";
}
function bar(s) {
var t = s + foo(); // Debugger is currently here
return t;
}
If your debugger enters through main()
and is now on the first line of bar
, then telling the debugger to “step out” will make it finish executing the rest of the bar
method so that control is returned to the last line of the main
method.
Tagged:
Debugging
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment