TEST
Use TEST
to produce object
code that enables debugging and problem determination tools such
as Debug Tool and Fault Analyzer.
With TEST
, you can also enable the inclusion of symbolic
variables in the formatted dumps that are produced by Language Environment®.
Option default is: NOTEST(NODWARF)
NODWARF
if onlyNOTEST
is specifiedNOEJPD
,SOURCE
if onlyTEST
is specified
Abbreviations are: None
Suboption abbreviation is: NOS
| S
DWARF
- If
NOTEST(DWARF)
is in effect, basicDWARF
diagnostic information is included in the application module. This option enables the best usability for application failure analysis tools, such as CEEDUMP and IBM® Fault Analyzer. WithNOTEST(DWARF)
, the debugging information is a subset of theDWARF
information that is available withTEST
. TheDWARF
diagnostic information that is produced whenNOTEST(DWARF)
is in effect cannot be used with IBM Debug Tool.
NODWARF
- If
NOTEST(NODWARF)
is in effect,DWARF
diagnostic information is not included in the application module.
TEST suboptions
When the TEST
option
is specified, DWARF
debugging information is included
in the application module.
The EJPD
and NOEJPD
suboptions
control enablement of the Debug Tool commands JUMPTO
and GOTO
in
production debugging sessions. These suboptions take effect only if
you specify the TEST
option
and a non-zero OPTIMIZE
level (OPTIMIZE(1)
or OPTIMIZE(2)
).
EJPD
- If you specify
TEST(EJPD)
and a non-zeroOPTIMIZE
level:- The
JUMPTO
andGOTO
commands are enabled. - The amount of program optimization is reduced. Optimization is done within statements, but most optimizations do not cross statement boundaries.
- The
NOEJPD
- If you specify
TEST(NOEJPD)
and a non-zeroOPTIMIZE
level:- The
JUMPTO
andGOTO
commands are not enabled. However, you can still useJUMPTO
andGOTO
if you use theSET WARNING OFF
Debug Tool command. In this scenario,JUMPTO
andGOTO
will have unpredictable results. - The normal amount of program optimization is done.
- The
SOURCE
- If you specify
TEST(SOURCE)
, the generatedDWARF
debug information generated by the compiler includes the expanded source code, and the compiler listing is not needed by IBM Debug Tool. NOSOURCE
- If you specify
TEST(NOSOURCE)
, the generatedDWARF
debugging information does not include the expanded source code, and you will not be able to use IBM Debug Tool.
TEST
option, you must set the CODEPAGE
option
to the CCSID that is used for the COBOL source program. In particular,
programs that use Japanese characters in DBCS literals or DBCS user-defined
words must be compiled with the CODEPAGE
option set
to a Japanese codepage CCSID. For more information, see CODEPAGE.Performance versus debugging capability:
You can control the amount of debugging capability that you get and so also the program performance, as follows:
- For the best performance, but with some restrictions on debugging,
compile using a non-zero
OPTIMIZE
level,STGOPT
andTEST(NOEJPD)
.- The Debug Tool commands
JUMPTO
andGOTO
are not supported. However, you can still useJUMPTO
andGOTO
if you use theSET WARNING OFF
Debug Tool command. In this scenario,JUMPTO
andGOTO
will have unpredictable results. - Except for the
DESCRIBE ATTRIBUTES
command, Debug Tool commands cannot refer to any data item that was discarded from a program by theSTGOPT
option. - The Debug Tool command
AT CALL
entry-name is not supported.
- The Debug Tool commands
- For some reduction in program performance from the
production-debugging scenario above, but to enable predictable behavior
for the Debug Tool commands
JUMPTO
andGOTO
, specify a non-zeroOPTIMIZE
level andTEST(EJPD)
.The restrictions above about referring to items discarded by the
STGOPT
option, and about theAT CALL
command also apply when you use a non-zeroOPTIMIZE
level andTEST(EJPD)
. - For slowest performance but maximum
debugging capability, specify
OPTIMIZE(0)
,NOSTGOPT
andTEST
.The
OPTIMIZE(0)
option causes the compiler to generate slower code, but all Debug Tool commands are supported.
Language Environment:
The TEST
option specified
with any of its suboptions 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
With NOTEST(DWARF)
,
the dump will have program variables and the line number of the failing
statement. With NOTEST(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.
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 DD
contains a member, for example, a COBOL program, whose name matches the program staged to VLF. - If the previous step was unsuccessful because the
IGZLOAD DD
was 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
DWARF
diagnostic 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 DD
concatenation or in theSTEPLIB DD
concatenation respectively, the first occurrence in theDD
concatenation 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.LOADLIB
is in LNKLST.USER.COBOL.LOADLIB(PGM1)
is staged to VLF.- PGM1 is executed from
USER.COBOL.LOADLIB
in 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)
Using the debugger
Language Environment Debugging Guide (Generating a
Language Environment dump with TERMTHDACT)
z/OS Debugger User's Guide (Special considerations while using the TEST
runtime option)
Logical record length and block size
cob2 input and output files
Conflicting compiler options
OPTIMIZE
Language Environment Programming Reference (TEST | NOTEST)