Choosing TEST or NOTEST compiler suboptions for C programs
This topic describes the debugging scenarios available, and how
to create a particular debugging scenario by choosing the correct TEST
compiler
suboptions.
The
C compiler provides the TEST
compiler option and
its suboptions to control the generation and placement of hooks and
symbol tables.
z/OS® Debugger does not support debugging optimized C programs. Do not use compiler options other than NOOPTIMIZE,
The following instructions help you choose the combination of TEST
compiler
suboptions that provide the functionality you need to debug your program:
- Choose a debugging scenario, keeping in mind your site's resources,
from the following list:
- Scenario A: To get all z/OS Debugger
functionality but have a larger program size (compared to using
DEBUG(FORMAT(DWARF))
), useTEST(ALL,HOOK,SYMBOL)
. - Scenario B: You can get some z/OS Debugger
functionality by compiling with the
NOTEST
compiler option. This requires that you debug your program in disassembly mode. - Scenario C: If you are debugging programs running in ALCS, you must compile with the
HOOK
suboption of theTEST
compiler option.
For all scenarios, if you are using other Application Delivery Foundation for z/OS tools, see topic z/OS XL C and C++ programs in IBM® Application Delivery Foundation for z/OS Common Components Customization Guide and User Guide to make sure you specify all the compiler options you need to create the files needed by all the Application Delivery Foundation for z/OS tools.
- Scenario A: To get all z/OS Debugger
functionality but have a larger program size (compared to using
- For scenario B, do the following steps:
- If you use the Dynamic Debug facility to place hooks into programs that reside in read-only storage, verify with your system administrator that the Authorized Debug facility has been installed and that you are authorized to use it.
- After you start z/OS Debugger, verify
that you have not deactivated the Dynamic Debug facility
by entering the
SET DYNDEBUG OFF
command.
- Verify whether you need to do any of the following tasks:
When you compile a program, do not associate SYSIN with an in-stream data set (for example //SYSIN DD *) because z/OS Debugger requires access to a permanent data set for the source of the program you are debugging.
- If you are using
#pragma
statements to specify yourTEST
orNOTEST
compiler options, see Compiling your C program with the #pragma statement. - The
C
TEST
compiler option implicitly specifies theGONUMBER
compiler option, which causes the compiler to generate line number tables that correspond to the input source file. You can explicitly remove this option by specifyingNOGONUMBER
. When theTEST
andNOGONUMBER
options are specified together, z/OS Debugger does not display the current execution line as you step through your code. - Programs that are compiled
with both the
TEST
compiler option and either theOPT(1)
orOPT(2)
compiler option do not have hooks at line, block, and path points, or generate a symbol table, regardless of theTEST
suboptions specified. Only hooks for function entry and exit points are generated for optimized programs. - You can specify any number of
TEST
suboptions, including conflicting suboptions (for example, bothPATH
andNOPATH
). The last suboptions that are specified take effect. For example, if you specifyTEST(BLOCK, NOBLOCK, BLOCK, NOLINE, LINE)
, what takes effect isTEST(BLOCK, LINE)
becauseBLOCK
andLINE
are specified last. - No duplicate hooks are generated even if two similar
TEST
suboptions are specified. For example, if you specifyTEST(BLOCK, PATH)
, theBLOCK
suboption causes the generation of hooks at entry and exit points. ThePATH
suboption also causes the generation of hooks at entry and exit points. However, only one hook is generated at each entry and exit point.
Name of compiler option or suboption | Description of the effect |
---|---|
NOTEST | The following list explains the effect the NOTEST compiler option will have on how z/OS Debugger behaves or the availability of features, which are not described in z/OS XL C/C++ User's Guide:
|
TEST | The following list explains the effect some of the suboptions of the TEST compiler option will have on how z/OS Debugger behaves or the availability of features, which are not described in z/OS XL C/C++ User's Guide:
|
NOSYM | The following list explains the
effect the
|
Refer to the following topics for more information related to the material discussed in this topic.
- Related references
- Description of the
TEST
compiler option in z/OS XL C/C++ User's Guide