Example of Stepping Into an OPM Program Using F22
In this example, you use the F22 (Step Into) to step into the OPM program
RPGPGM from the program DEBUGEX.
- Ensure that the Display Module Source display shows the source for DBGEX.
- To set an unconditional breakpoint at line 102, which is the last runnable statement before the CALL operation, type Break 102 and press Enter.
- Press F3 (End program) to leave the Display Module Source display.
- Call the program. The program stops at breakpoint 102, as shown in Figure 1.
Figure 1. Display Module Source display of DBGEX Before Stepping Into RPGPGM
Display Module Source Program: DEBUGEX Library: MYLIB Module: DBGEX 98 * Fld1a is an overlay field of Fld1. Since Fld1 is initialized 99 * to 'ABCDE', the value of Fld1a(1) is 'A'. After the 100 * following MOVE operation, the value of Fld1a(1) is '1'. 101 *--------------------------------------------------------------- 102 C MOVE '1' Fld1a(1) 103 104 *--------------------------------------------------------------- 105 * Call the program RPGPGM, which is a separate program object. 106 *--------------------------------------------------------------- 107 C Plist1 PLIST 108 C PARM PARM1 109 C CALL 'RPGPGM' Plist1 110 111 *--------------------------------------------------------------- 112 * Call c_proc, which imports ExportFld from the main procedure. More... Debug . . . _________________________________________________________________ _______________________________________________________________________________ F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable F12=Resume F17=Watch variable F18=Work with watch F24=More keys Breakpoint at line 102. - Press F22 (Step into). One statement of the program runs, and then the
Display Module Source display of RPGPGM is shown, as in Figure 2.
In this case, the first runnable statement of RPGPGM is processed (line 13) and then the program stops.Note: You cannot specify the number of statements to step through when you use F22. Pressing F22 performs a single step.
Figure 2. Stepping into RPGPGM
Display Module Source
Program: RPGPGM Library: MYLIB
1 *===============================================================
2 * RPGPGM - Program called by DEBUGEX to illustrate the STEP
3 * functions of the ILE source .
4 *
5 * This program receives a parameter InputParm from DEBUGEX,
6 * displays it, then returns.
7 *===============================================================
8
9 D InputParm S 4P 3
10
11 C *ENTRY PLIST
12 C PARM InputParm
13 C InputParm DSPLY
14 C SETON
Bottom
Debug . . . _________________________________________________________________
_______________________________________________________________________________
F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable
F12=Resume F17=Watch variable F18=Work with watch F24=More keys
Step completed at line 13.
If the ILE source is not set to accept OPM programs, or if there is no debug data available, then you will see a blank Display Module Source display with a message indicating that the source is not available. (An OPM program has debug data if it was compiled with OPTION(*SRCDBG) or OPTION(*LSTDBG).)