Choosing TEST or NOTEST compiler options 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. - Scenario B: You can get some z/OS Debugger
functionality by compiling with the
NOTESTcompiler 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
HOOKsuboption of theTESTcompiler option.
For all scenarios, if you are using other Application Delivery Foundation for z/OS tools, see 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
- 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.
- The
C++
TESTcompiler option implicitly specifies theGONUMBERcompiler 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 theTESTandNOGONUMBERoptions 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
TESTcompiler option and either theOPT(1)orOPT(2)compiler option do not have hooks at line, block, and path points, or generate a symbol table. Only hooks for function entry and exit points are generated for optimized programs.
-
After you have chosen the compiler options and suboptions, see Planning your debug session to determine the next task you must complete.
| Name of compiler option or suboption | Description of the effect |
|---|---|
| NOTEST | The following list explains the effect of the
|
| TEST | 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
TESTcompiler option in z/OS XL C/C++ User's Guide