Displaying the call stack
To display the call stack, use the Display Debug (DSPDBG) command.
The call stack indicates:
- Which programs are currently being debugged
- The instruction number of the calling instruction or the instruction number of each breakpoint at which program processing is stopped
- The program recursion level
- The names of the programs that are in debug mode but have not been called
A call of a program is the allocation of automatic storage for the program and the transfer of machine processing to the program. A series of calls is placed in a call stack. When a program finishes processing or transfers control, it is removed from the call stack.
A program may be called a number of times while the first call is still in the call stack. Each call of a program is a recursion level of the program.
When a call is ended (the program returns or transfers control), automatic storage is returned to the system.
Notes:
- CL programs can be recursive; that is, a CL program can call itself either directly or indirectly through a program it has called.
- Some high-level languages do not allow recursive program calls. Other languages allow not only programs to be recursive, but also procedures within a program to be recursive. (In this guide, the term recursion level refers to the number of times the program has been called in the call stack. A procedure's recursion level is referred to explicitly as the procedure recursion level.)
- All CL commands and displays make use of only the program qualified name recursion level.