Debugging an application at the program level
By default, the Visual Debug view displays the entry diagram, which is a paragraph diagram for a COBOL source or a procedure diagram for a PL/I source. You can switch to display the program diagram. The program diagram is dynamically updated when you run through a debug session and more information is known about the programs and their call relation.
About this task
Procedure
- To display the program diagram in the Visual Debug view,
click the arrow besides the visual debugging icon, and click Show
Program Diagram.
The Visual Debug view is switched to display the known programs and their calling relation. In this example, the SAM1 and SAM2 programs are displayed: SAM1 calls SAM2.
In the program diagram, you can navigate the debug flow from a higher level. For example, you can run to a called program like SAM2 without stopping at the callers.
- In the program diagram, right-click the program node that you want to run to, and click Toggle Breakpoint to set a breakpoint on the program.
- Resume the debug session. For a static program call, the debugger stops at the entry point of the selected program. For a dynamic program call, the debugger stops at the line that makes the program call. From this line, you can step into the called program.
- Switch to the show the entry diagram of the current program
by clicking the arrow besides the visual debugging icon and clicking Show
Entry Diagram. In this example, the paragraph diagram of the SAM2 program is displayed. You can use the paragraph diagram of SAM2 to navigate your debug flow in SAM2.

- Show the call stack for the other programs. The Visual Debug view shows only the call stack for the current program. If you select a stack frame that belongs to a different program, the Visual Debug view is updated to show the paragraph diagram of the program for the selected stack frame. In this example, if you select the stack frame 200-PROCESS-UPDATE-TRAN : SAM1 : 03, the Visual Debug view is updated to show the call stack in SAM1. And the editor is positioned to the line in SAM1 that makes the program call to SAM2.

- To return to the calling program after you finish debugging
the called program, click the step return icon. The control returns to the calling program and the Visual Debug view is updated to show the paragraph nodes of the calling program:

Results
