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
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 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 are running on z/OS Version 1.6 or Version 1.7, verify that Language Environment® PTF for APAR PK12833 is installed.
- 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 OFFcommand.
- 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
#pragmastatements to specify yourTESTorNOTESTcompiler options, see Compiling your C program with the #pragma statement. - 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, regardless of theTESTsuboptions specified. Only hooks for function entry and exit points are generated for optimized programs. - You can specify any number of
TESTsuboptions, including conflicting suboptions (for example, bothPATHandNOPATH). The last suboptions that are specified take effect. For example, if you specifyTEST(BLOCK, NOBLOCK, BLOCK, NOLINE, LINE), what takes effect isTEST(BLOCK, LINE)becauseBLOCKandLINEare specified last. - No duplicate hooks are generated even if two similar
TESTsuboptions are specified. For example, if you specifyTEST(BLOCK, PATH), theBLOCKsuboption causes the generation of hooks at entry and exit points. ThePATHsuboption 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
TESTcompiler option in z/OS XL C/C++ User's Guide