Setting and Removing Job Breakpoints Using Statement Numbers

You set and remove conditional or unconditional job breakpoints using the statement numbers found in the compiler listing for the module in question. This is necessary if you want to debug a module which was created with DBGVIEW(*STMT).

To set an unconditional job breakpoint using the BREAK debug command, type:

BREAK procedure-name/statement-number

on the debug command line. The variable procedure-name is the name of the procedure in which you are setting the breakpoint. Since ILE RPG allows more than one procedure per module, the procedure-name can be either the name of the main procedure or one of the subprocedures in a module. The variable statement-number is the statement number from the compiler listing on which you want to set a breakpoint.

Note:
The statement number in the source listing is labeled as the Line Number when OPTION(*NOSRCSTMT) is specified, and as the Statement Number when OPTION(*SRCSTMT) is specified. For example, Figure 110 shows a sample section of a listing with OPTION(*NOSRCSTMT). Figure 111 shows the same section with OPTION(*SRCSTMT).

Figure 110. Sample Section of the Listing with OPTION(*NOSRCSTMT)
Line   <--------------------- Source Specifications ----------------------------------------------><---- Comments ----> Src Seq
Number ....1....+....2....+<-------- 26 - 35 -------->....4....+....5....+....6....+....7....+....8....+....9....+...10 Id  Number
                          S o u r c e   L i s t i n g
     1 C                   MOVE                       '123'         BI_FLD1                                                 000100
     2 C                   SETON                                                         LR----                             000200
       * * * * *   E N D   O F   S O U R C E   * * * * *

Figure 111. Sample Section of the Compiler Listing with OPTION(*SRCSTMT)
Seq    <--------------------- Source Specifications ----------------------------------------------><---- Comments ----> Statement
Number ....1....+....2....+<-------- 26 - 35 -------->....4....+....5....+....6....+....7....+....8....+....9....+...10 Number
                          S o u r c e   L i s t i n g
000100 C                   MOVE                       '123'         BI_FLD1                                                 000100
000200 C                   SETON                                                         LR----                             000200
       * * * * *   E N D   O F   S O U R C E   * * * * *

In this example, a Statement View is used to set a breakpoint for the procedure TEST. To set a breakpoint for the module with the *NOSRCSTMT listing, type:

BREAK TEST/2

To set a breakpoint for the module with the *SRCSTMT listing, type:

BREAK TEST/200

In both cases, the breakpoint is set on the 'SETON        LR----' line.

Figure 112. Setting a Breakpoint Using Statement View
                             Display Module Source
 Program:   TEST           Library:   MYLIB          Module:   TEST
   (Source not available.)
                                                                         Bottom
 Debug . . .   break TEST/2_____________________________________________________
_______________________________________________________________________________
 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 added to statement 2 of procedure TEST.   

For all other debug views, the statement numbers can be used in addition to the program line-numbers in the . For example, to set a breakpoint at the beginning of subprocedure FmtCust in the Listing View below, type:

BREAK 34

Or

BREAK FmtCust/2600

In both cases, the breakpoint is set on the 'P FmtCust         B' line.

Figure 113. Setting a Breakpoint using Statement Numbers and a Listing View with OPTION(*SRCSTMT)
                             Display Module Source
 Program:   MYPGM          Library:   MYLIB          Module:   MYPGM
     33     002500  * Begin-procedure
     34     002600 P FmtCust         B
     35     002700 D FmtCust         PI            25A
     36     002800  * Procedure-interface (same as the prototype)
     37     002900 D    FirstName                  10A
     38     003000 D    LastName                   15A
     39     003100 D    ValidRec                     N
     40     003200  * Calculations
     41     003300 C                   IF        ValidRec = '0'
     42     003400 C                   RETURN    %TRIMR(FirstName) + ' ' + Last
     43     003500 C                   ENDIF
     44     003600 C                   RETURN    'Last Customer'
     45     003700  * End-procedure
     46     003800 P                 E
     47           *MAIN PROCEDURE EXIT
                                                                        More...
 Debug . . .   BREAK fmtcust/2600_______________________________________________
_______________________________________________________________________________
 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 added to line 34.   

To set a conditional job breakpoint using the BREAK debug command, type:

BREAK procedure-name/statement-number WHEN expression

on the debug command line. The variables procedure-name and statement-number are the same as for unconditional breakpoints. The variable expression is the conditional expression that is evaluated when the breakpoint is encountered.

To remove an unconditional or conditional breakpoint using the CLEAR debug command, type:

CLEAR procedure-name/statement-number

on the debug command line.



[ Top of Page | Previous Page | Next Page | Contents | Index ]