When using XL C, set the TEST(ALL) suboption; this is equivalent to specifying TEST(LINE,BLOCK,PATH,SYM,HOOK). For XL C++, the option TEST is equivalent to TEST(HOOK). Table 1 lists the TEST suboptions that you can use to simplify runtime debugging.
Description | |
---|---|
ALL | Sets all of the TEST suboptions. |
BLOCK | Generates symbol information for nested blocks. |
HOOK | Generates all possible hooks. For details on this suboption, see z/OS XL C/C++ User's Guide. |
LINE | Generates line number hooks and allows a debugging tool to generate a symbolic dump. |
PATH | Generates hooks at all path points; for example, hooks are inserted at if-then-else points before a function call and after a function call. |
SYM | Generates symbol table information
and enables Language Environment to
generate a dump at run time. When you specify SYM, you also get the
value and type of variables displayed in the Local Variables section
of the dump. For example, if in block 4 the variable x is
a signed integer of 12, and in block 2 the variable x is
a signed integer of 1, the following output appears in the Local Variables
section of the dump:
If a nonzero optimization level is used, variables do not appear in the dump. |
You can use the C/C++ compiler options shown in Table 2 to make runtime debugging easier. For a detailed explanation of these options, see z/OS XL C/C++ User's Guide.
Description | |
---|---|
AGGREGATE (C) | Specifies that a layout for struct and union type variables appear in the listing. |
ATTRIBUTE (C++) | For XL C++ compile, cross reference listing with attribute information. If XREF is specified, the listing also contains reference, definition and modification information. |
CHECKOUT (C) | Provides informational messages indicating possible programming errors. |
EVENTS | Produces an events file that contains error information and source file statistics. |
EXPMAC | Macro expansions with the original source. |
FLAG | Specifies the minimum severity level that is tolerated. |
GONUMBER | Generates line number tables corresponding to the input source file. This option is turned on when the TEST option is used. This option is needed to show statement numbers in dump output. |
INFO (C++) | Indication of possible programming errors. |
INLINE | Inline Summary and Detailed Call Structure Reports. (Specify with the REPORT sub-option). |
INLRPT | Generates a report on status of functions that were inlined. The OPTIMIZE option must also be specified. |
LIST | Listing of the pseudo-assembly listing produced by the compiler. |
OFFSET | Displays the offset addresses relative to the entry point of each function. |
PHASEID | Causes each compiler module (phase) to issue an informational message which identifies the compiler phase module name, product identifier, and build level. |
PPONLY | Completely expanded z/OS XL C, or z/OS XL C++ source code, by activating the preprocessor (PP) only. The output shows, for example, all the "#include" and "#define" directives. |
SERVICE | Places a string in the object module, which is displayed in the traceback if the application fails abnormally. |
SHOWINC | All included text in the listing. |
SOURCE | Includes source input statements and diagnostic messages in the listing. |
TERMINAL | Directs all error messages from the compiler to the terminal. If not specified, this is the default. |
TEST | Generates information for debugging interface. This also generates symbol tables needed for symbolic variables in the dump. |
XPLINK (BACKCHAIN) | Generates a prolog that saves redundant information in the calling function's stack frame. |
XPLINK (STOREARGS) | Generates code to store arguments that are normally passed in registers, into the argument area. |
XREF | For XL C compile, cross reference listing with reference, definition, and modification information. For XL C++ compile, cross reference listing with reference, definition, and modification information. If you specify ATTRIBUTE, the listing also contains attribute information. |
See the Inter-procedural Analysis topic in the z/OS XL C/C++ Programming Guide for an overview and more details about Inter-procedural Analysis.