While debugging a routine in your program, you might want to set the
current scope to a calling routine (a routine down the stack from the
routine in which execution is currently paused). This enables you to:
- Determine where the current routine call originated
- Determine the value of a variable declared in a calling routine
- Determine the value of a variable during a particular invocation of
a routine that is called recursively
- Change the value of a variable in the context of a routine call
The Call Stack menu on the source view lists the names of the routines
of your program that are currently active on the stack, up to the
maximum number of lines that can be displayed on your screen.
The numbers on the left side of the menu indicate the level of each
routine on the stack relative to level 0, which denotes the routine in
which execution is paused.
To set the current scope to a particular routine on the stack, choose
its name from the Call Stack menu. This causes the following to occur:
- The Call Stack menu, when released, shows the name and relative
level of the routine that is now the current scope.
- The source view shows that routine's source code.
- The instruction view (if displayed) shows that routine's decoded
instructions.
- The register view (if displayed) shows the register values
associated with that routine call.
- If the scope is set to a calling routine (call-stack level other
than 0), the debugger clears the current-location pointer.
- The debugger sets the scope for symbol searches to the chosen
routine, so that you can examine variables, and so on, in the
context of that scope.
When you set the scope to a calling routine, the current-location
pointer (which is cleared) marks the source line to which execution
will return in that routine. Depending on the source language and
coding style used, this might be the line that contains the call
statement or some subsequent line.