FaqDebuggingStackOperations

Stack Operations

Stack operations allow to:

  • move between frames in a call stack to change context for viewing local variables and evaluating expressions,
  • or pop in the call stack to return back in execution.

Make Current

Make Current action invoked on a call stack frame jumps to the line of source code described by the frame.
Local variables and watches are evaluated according to the new position.
It is usable when you want to evaluate values of variables before the current code was called.

Example:
I need to know what was value of the variable number before the make method was called:

Screenshot

Steps:

  1. Go to the main Debugging View (or open Call Stack view in NetBeans 6.1 or older).
  2. Doubleclick the desired line in the stack (i.e. run:24) or invoke Make Current action from context menu.
  3. The row in the stack view becomes bold and you can see the value of number variable in Local Variables view

Pop To Here

Pop To Here returns suspended thread back to a selected position in methods call stack.
It is usable when you want to return back in called methods sequence and debug something again.
In the used example you can call Pop To Here action instead of Make Current. The debugger will return back to the line 24. You can watch than value of variable number but make method argument value will be different.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo