IBM AS/400 Frozen Dessert Maker User Manual


 
Preparing a Program for Debugging
members into the module object. There is no dependency on the source members
upon which it is based, once the listing view is created.
For example, to create a listing view for a program TEST1 that contains expanded
DDS type:
CRTBNDRPG PGM(MYLIB/TEST1) SRCFILE(MYLIB/QRPGLESRC)
SRCMBR(TEST1) OUTPUT(*PRINT)
TEXT('ILE RPG/400 program TEST1')
OPTION(*EXPDDS) DBGVIEW(*LIST)
Specifying DBGVIEW(*LIST) for the DBGVIEW parameter and *EXPDDS for the
OPTION parameter on either create command creates a listing view with expanded
DDS for debugging the source for TEST1. Note that OUTPUT(*PRINT) and
OPTION(*EXPDDS) are both default values.
Creating a Statement View
|A statement view allows the module object to be debugged using statement
| numbers and the debug commands. Since the source will not be displayed, you
| must make use of statement numbers which are shown in the source section of the
| compiler listing. In other words, to effectively use this view, you will need a compiler
| listing. In addition, the statement numbers generated for debugging are dependent
| on whether *SRCSTMT or *NOSRCSTMT is specified for the OPTION parameter.
| *NOSRCSTMT means that statement numbers are assigned sequentially and are
| displayed as Line Numbers on the left-most column of the source section of the
| compiler listing. *SRCSTMT allows you to request that the compiler use SEU
| sequence numbers and source IDs when generating statement numbers for debug-
| ging. The Statement Numbers are shown on the right-most column of the source
| section of the compiler listing.
You create a statement view to debug a module by using the *STMT option on the
DBGVIEW parameter for either the CRTRPGMOD or CRTBNDRPG commands
when you create a module.
Use this view when:
You have storage constraints, but do not want to recompile the module or
program if you need to debug it.
You are sending compiled objects to other users and want to be able to diag-
nose problems in your code using the debugger, but you do not want these
users to see your actual code.
For example, to create a statement view for the program DEBUGEX using
CRTBNDRPG, type:
CRTBNDRPG PGM(MYLIB/DEBUGEX) SRCFILE(MYLIB/QRPGLESRC)
TEXT('ILE RPG/400 program DEBUGEX')
To create a statement view for a module using CRTRPGMOD, type:
CRTRPGMOD MODULE(MYLIB/DBGEX) SRCFILE(MYLIB/QRPGLESRC)
TEXT('Entry module for program DEBUGEX')
By default a compiler listing and a statement view are produced. Using a compiler
listing to obtain the statement numbers, you debug the program using the debug
commands.
Chapter 11. Debugging Programs 169