Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

Backing Up from a Method to Its Call

Under some circumstances, it might be useful for you to step back in your code. For example, if you hit a breakpoint and would like to see how the code leading up to that breakpoint works, you can remove (pop) the current call from the call stack to re-execute the method.

You can open the Call Stack window to view all of the method calls within the current chain of method calls in the current thread. The current call is marked with the dborderkey.gificon. Other calls in the stack are marked with the lborderkey.gificon.

To back up to a previous method call:

  1. Open the Call Stack window (Alt-Shift-3).
  2. Right-click the line in the Call Stack window that represents the place in the code that you want to return to and choose Pop to Here.

    The program counter returns to the line where the call was made. You can then re-execute the method.

  • + Share This
  • 🔖 Save To Your Account