Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Start Debug (STRDBG) command puts a job into debug mode and, optionally, adds as many as 20 programs and 20 service programs and 20 class files to debug mode. It also specifies certain attributes of the debugging session. For example, it can specify whether database files in production libraries can be updated while in debug mode.
The graphical system debugger will be launched instead of the traditional system debugger if the STRDBG command is issued by a user registered for graphical debugging.
Debug can operate in three environments at the same time. They are OPM (Original Program Model), ILE (Integrated Language Environment), and JAVA. Some parameters for this command are applicable for all three environments. Some parameters for this command are applicable only for OPM, ILE, or JAVA. There will be a statement in each parameter description stating the environment in which the parameter is applicable.
The Change Debug (CHGDBG) command can be used later in the job to change the attributes of the debug mode. Also, OPM programs can be added to or removed from the debugging session if they are specified in the Add Program (ADDPGM) or Remove Program (RMVPGM) commands. OPM programs added with the ADDPGM command will be in the OPM debug environment.
When one job is servicing another job, and STRDBG is entered, all debug commands are valid for the job being serviced. If that job is held on a job queue, no further debug commands may be entered until that job is allowed to run. When the job starts, an initial breakpoint screen is displayed. From this screen, additional debug commands may be entered. To service another job, see the STRSRVJOB (Start Service Job) command. More information about debugging one job from another job is in the CL information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
PGM | Program | Single values: *NONE Other values (up to 20 repetitions): Qualified object name |
Optional, Positional 1 |
Qualifier 1: Program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
DFTPGM | Default program | Name, *PGM, *NONE | Optional |
MAXTRC | Maximum trace statements | Integer, 200 | Optional |
TRCFULL | Trace full | *STOPTRC, *WRAP | Optional |
UPDPROD | Update production files | *NO, *YES | Optional |
OPMSRC | OPM source level debug | *NO, *YES | Optional |
SRVPGM | Service program | Single values: *NONE Other values (up to 20 repetitions): Qualified object name |
Optional |
Qualifier 1: Service program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
CLASS | Class file | Values (up to 20 repetitions): Path name, *NONE | Optional |
DSPMODSRC | Display module source | *PGMDEP, *NO, *YES | Optional |
SRCDBGPGM | Source debug program | Single values: *SYSDFT Other values: Qualified object name |
Optional |
Qualifier 1: Source debug program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
UNMONPGM | Unmonitored message program | Single values: *NONE Other values: Qualified object name |
Optional |
Qualifier 1: Unmonitored message program | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB |
Top |
Specifies up to 20 programs to debug in the job. Before a program can be debugged, its name must be specified on this parameter, in the Add Program (ADDPGM) command, or the Display Module Source (DSPMODSRC) command.
This parameter is applicable in both OPM and ILE environments.
Single values
Other values (up to 20 repetitions)
Qualifier 1: Program
Qualifier 2: Library
Top |
Specifies the original program model (OPM) program to use as the default program during debug mode. The program specified here is used as the default program for any of the other debug commands for which the user specified a value of *DFTPGM for the Program (PGM) parameter. That is, if a default program was previously specified, this parameter can change it.
This parameter is applicable only in the OPM environment.
Note: If OPMSRC(*YES) is specified, the OPM program may be added to either the OPM debug environment or the ILE debug environment. If added to the ILE debug environment, then it cannot be a default program for the OPM debug environment.
Top |
Specifies the maximum number of trace statements that the system puts into the job's trace file before either stopping tracing or wrapping around (overlaying) on the trace file. When the trace file contains the maximum specified, the system performs the actions specified by the value supplied for the Trace full (TRCFULL) parameter.
Note: Instruction stepping can be performed on a program being debugged in an interactive environment by setting the maximum number of trace statements to 1 and the value for the TRCFULL parameter to *STOPTRC.
This parameter is applicable only in the OPM environment.
Top |
Specifies what happens when the job's trace file is full (that is, it contains the maximum number of trace statements specified by the value supplied for the Maximum trace statements (MAXTRC) parameter.
This parameter is applicable only in the OPM environment.
Top |
Specifies whether or not database files in a production library can be opened for updating records, or for adding new records, while the job is in debug mode. If not, the files must be copied into a test library before trying to run a program that uses the files.
This parameter is applicable in both OPM and ILE environments.
Top |
Specifies that original program model (OPM) programs are debugged using the system source debug support (same as ILE source debug).
This parameter is valid for OPM CL, OPM RPG and OPM COBOL programs that were created with OPTION(*SRCDBG) with CRTCLPGM, CRTRPGPGM and CRTCBLPGM commands. Additionally, this parameter is valid for OPM CL, OPM RPG and OPM COBOL programs that were created with OPTION(*LSTDBG) with the CRTCLPGM, CRTRPGPGM, CRTCBLPGM, CRTSQLRPG, CRTSQLCBL, and CRTRPTRPG commands. If the OPM program is not CL, RPG or COBOL and was not compiled with a valid debug option, then this parameter is ignored.
This parameter is applicable in both OPM and ILE environment.
ILE functions will now operate on OPM programs. For example, source level debug.
Top |
Specifies up to 20 service programs to debug in the job. Before a service program can be debugged, its name must be specified on this parameter or the Display Module Source (DSPMODSRC) command.
This parameter is applicable only in the ILE environment.
Single values
Other values (up to 20 repetitions)
Qualifier 1: Service program
Qualifier 2: Library
Top |
Specifies up to 20 class files to debug in the job. Before a class file can be debugged, its name must be specified on this parameter or the Display Module Source (DSPMODSRC) command.
This parameter is applicable only in the ILE environment.
Top |
Specifies whether the first display of the source debug program is shown when this command is processed and no errors occur.
This parameter is applicable only in the ILE environment.
Top |
Specifies the source debug program to be used. See the System API Reference information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter for an explanation of this parameter.
This parameter is applicable only in the ILE environment.
Single values
Qualifier 1: Source debug program
Qualifier 2: Library
Top |
Specifies the qualified name of the user-supplied program called when a message that is not monitored occurs in the job being debugged. When the program specified is called, it is passed parameters that identify the program name, the recursion level, the high-level language statement identifier, the machine instruction number at which the breakpoint occurred, the message that was not monitored, the message data, the length of the message data, and the message reference key.
This parameter is applicable only in the OPM environment.
The passed parameters have the following formats:
All the parameter values are left-adjusted and padded on the right with blanks. When control returns to the program with the message that was not monitored, processing continues.
Single values
Qualifier 1: Unmonitored message program
Qualifier 2: Library
Top |
Example 1: Start Debug for Program
STRDBG PGM(TESTLIB/PAYROLL) UPDPROD(*NO)
This command starts debug mode to debug the program PAYROLL, which is in the test library TESTLIB. If tracing is used, up to 200 trace statements can be stored in the trace before tracing stops. If program PAYROLL is a bound program, the Display Module Source display will be shown, giving the source for the module that contains the program entry point. Any database files updated by the PAYROLL program must be in a test library.
Example 2: Start Debug for Class File
STRDBG CLASS('financial.payapplet')
This command starts debug mode to debug the class payapplet in the financial package.
Top |
Top |