TEST
Use TEST to produce object
code that enables debugging with problem determination tools such
as IBM® z/OS® Debugger and Fault Analyzer.
With TEST, you can also enable the inclusion of symbolic
variables in the formatted dumps that are produced by Language Environment®.
Default is: NOTEST(NODWARF, NOSOURCE,
NOSEPARATE)
NODWARF, NOSOURCE, NOSEPARATEwhenNOTESTis specified with no suboptionsNOEJPD, DWARF, SOURCE, NOSEPARATEwhenTESTis specified with no suboptions
Abbreviations are: None
NOSO|SOforSOURCE|NOSOURCENOSEP|SEPforSEPARATE|NOSEPARATE
DWARF|NODWARF- If
TEST(DWARF)is in effect, completeDWARFdiagnostic information is included in the object program, or a separate debug file when theSEPARATEsuboption is in effect. This option enables the best usability for application failure analysis tools, such as CEEDUMP and IBM Fault Analyzer.
EJPD|NOEJPDEJPDandNOEJPDcontrol enablement of the IBM z/OS Debugger commandsJUMPTOandGOTOin production debugging sessions.EJPDandNOEJPDonly take effect if you specify theTESToption and a non-zeroOPTIMIZElevel (OPTIMIZE(1)orOPTIMIZE(2)).
SOURCE|NOSOURCE- If you specify
SOURCE, theDWARFdebugging information generated by the compiler includes the expanded source code.Note:SOURCEis not allowed ifNODWARFis specified.
SEPARATE[(DSNAME|NODSNAME)]|NOSEPARATE- The default is
SEPARATE(NODSNAME)whenSEPARATEis specified with no suboptions.
Controlling module size while retaining debugging capability:
DWARF suboption of TEST causes
the compiler to generate debug information tables that IBM z/OS Debugger uses to resolve data-names,
paragraph-names, and the like. This information can take a lot of
storage. You can choose either to compile this information into the
object program or to write it to the separate SYSDEBUG data
set: - For smaller executables, use the
SEPARATEsuboption and keep the separate debugging files for use during IBM z/OS Debugger sessions. - To avoid having to manage separate debugging files, compile with
the
NOSEPARATEsuboption; note that this suboption results in larger object programs on DASD. The size when loaded into virtual storage is not increased by use of theNOSEPARATEoption.
If you invoke the COBOL compiler
from JCL or TSO and you specify NOTEST|TEST(...,SEPARATE,...),
the DWARF debugging information is written to the data set that you
specify in the SYSDEBUG DD statement. For details
about coding that statement and about the SYSDEBUG data set, see the
related information below about defining the debug data set and about
logical record length and block size.
When you invoke the COBOL compiler from the z/OS UNIX shell and you specify NOTEST|TEST(...,SEPARATE,...),
the DWARF debugging information is written to file.dbg
in the current directory, where file is the name
of the COBOL source file.
Performance versus debugging capability:
You can control the amount of debugging capability that you get and the program performance, as follows:
- For the best performance, but with some restrictions on debugging,
compile using a non-zero
OPTIMIZElevel,STGOPTandTEST(NOEJPD).- The IBM z/OS Debugger commands
JUMPTOandGOTOare not supported. However, you can still useJUMPTOandGOTOif you use theSET WARNING OFFIBM z/OS Debugger command. In this scenario,JUMPTOandGOTOwill have unpredictable results. - Except for the
DESCRIBE ATTRIBUTEScommand, IBM z/OS Debugger commands cannot refer to any data item that was discarded from a program by theSTGOPToption. - The IBM z/OS Debugger command
AT CALLentry-name is not supported.
- The IBM z/OS Debugger commands
- For some reduction in program performance from the
production-debugging scenario above, but to enable predictable behavior
for the IBM z/OS Debugger commands
JUMPTOandGOTO, specify a non-zeroOPTIMIZElevel andTEST(EJPD).The restrictions above about referring to items discarded by the
STGOPToption, and about theAT CALLcommand also apply when you use a non-zeroOPTIMIZElevel andTEST(EJPD). - For slowest performance but maximum
debugging capability, specify
OPTIMIZE(0),NOSTGOPTandTEST.The
OPTIMIZE(0)option causes the compiler to generate slower code, but all IBM z/OS Debugger commands are supported.
Language Environment:
The TEST option specified
with any of its suboptions, and NOTEST with DWARF,
can improve your formatted dumps from Language Environment by adding these two features
to the dumps:
- A line number that indicates the failing statement, rather than just an offset
- The values of the program variables (if
DWARFis in effect)
With DWARF, the dump will have program variables and
the line number of the failing statement. With NODWARF,
the dump will not have program variables nor the line number of the
failing statement.
Enterprise COBOL uses the Language Environment-provided dump services to produce dumps that are consistent in content and format with those that are produced by other Language Environment-conforming member languages.
Whether Language Environment produces a dump for unhandled
conditions depends on the setting of the runtime option TERMTHDACT.
If you specify TERMTHDACT(DUMP), a dump is generated
when a condition of severity 2 or greater goes unhandled.
- IBM Developer for z/OS Enterprise Edition (included in IBM Application Delivery Foundation for z/OS)
- IBM Debug for z/OS (formerly IBM Debug for z Systems and IBM Debug Tool for z/OS)
- IBM Developer for z/OS
LLA/VLF managed programs where DWARF diagnostic information is included:
When
DWARF diagnostic information is included in the object program because
of the TEST(NOSEPARATE) or other equivalent options
and the program is staged to VLF, the information cannot be extracted
from the program. The execution JCL requires the use of the IGZLOAD
DD, the STEPLIB DD, or both to specify the
location of any LLA/VLF managed libraries from which the application
will load programs that have been staged to VLF. Otherwise, the COBOL
variable information and the statement numbers in the traceback will
be missing in the CEEDUMP and a diagnostic message
will appear in the CEEDUMP. For more information,
see Diagnostic messages in CEEDUMPs for IBM Enterprise COBOL for z/OS.
For
each program staged to VLF, the following steps are taken to extract
the DWARF diagnostic information:
- The COBOL Runtime checks for the allocation of the
IGZLOAD DD. It then checks if the library is associated with theIGZLOAD DDcontains a member, for example, a COBOL program, whose name matches the program staged to VLF. - If the previous step was unsuccessful because the
IGZLOAD DDwas not allocated or the member was not found, the same process is attempted using theSTEPLIB DD. -
If the member is found, and the checksum that is stored with the
DWARFdiagnostic information retrieved from the member matches the checksum of the compile unit in the executing program, the information is extracted from the member.Note that if duplicate members exist in the
IGZLOAD DDconcatenation or in theSTEPLIB DDconcatenation respectively, the first occurrence in theDDconcatenation is used to obtain the checksum.A mismatch can occur if a revised copy of the program is placed into a LLA/VLF managed library, but the environment-appropriate refresh for the staged LLA/VLF program has not been completed.
IGZLOAD DD with DSN=USER.COBOL.LOADLIB when
all of the following conditions are met:USER.COBOL.LOADLIBis in LNKLST.USER.COBOL.LOADLIB(PGM1)is staged to VLF.- PGM1 is executed from
USER.COBOL.LOADLIBin LNKLST.
//GO1 EXEC PGM=PGM1, * CALLED FROM LNKLST
//STEPLIB DD DSN=CEE1.SCEERUN,DISP=SHR
//IGZLOAD DD DSN=USER.COBOL.LOADLIB,DISP=SHR * CONTAINS PGM1
If a program is LLA/VLF managed
and staged to VLF, and is executed from one of the data sets in LNKLST,
there is a need to allocate the IGZLOAD DD. However,
if the program resides in one of the data sets in the STEPLIB
DD, there is no need to allocate the IGZLOAD DD.
DWARF/ELF Extensions Library Reference (About Common Debug Architecture)
Defining the debug data set (SYSDEBUG)
Using the debugger
Suppressing information in CEEDUMP processing
Generating a Language Environment dump with TERMTHDACT (Language Environment Debugging Guide)
Special considerations while using the TEST runtime option (z/OS Debugger User's Guide)
Logical record length and block size
cob2 input and output files
Conflicting compiler options
OPTIMIZE
TEST | NOTEST (Language Environment Programming Reference)
