z/OS® XL C and C++ programs

The following table shows various compiler options that can be used to prepare z/OS® XL C and C++ programs for use with the ADFz family of products (z/OS® Debugger, Fault Analyzer for z/OS® and Application Performance Analyzer for z/OS®). The methods suggested in the following table indicate whether the load module produced has no significant runtime overhead and therefore is suitable for a production environment.

Table 1. Examples of compiler options and source information files that are supported by ADFz products for C and C++

This table has 5 columns. The first cell of the second row spans 2 rows. The first cell of the fourth row spans 2 rows.

Compiler options Output produced Options supported and suggested for z/OS® Debugger Options supported and suggested for Fault Analyzer for z/OS® Options supported and suggested for APA
Preprocess (1st stage) to expand source: PP(COMMENTS, NOLINES)

Compile (2nd stage): DEBUG (FORMAT (DWARF), NOHOOK, SYMBOL, FILE (location)), LIST, LONGNAME, NOOFFSET, GONUMBER1

  • Expanded source file
  • DWARF file (used by z/OS® Debugger, Fault Analyzer for z/OS®, and Application Performance Analyzer)
  • Compiler listing (can be used by Application Performance Analyzer and Fault Analyzer for z/OS® when DWARF is not available)
Supported. You can use it for production if the OPT compile option is not used. Full functionality available. Supported. Use of the OPT compile option might result in incorrect source line being reported. Full functionality available. Supported.
  • .mdbg file2
Recommended. You can use it for production if the OPT compile option is not used. Full functionality available. Supported. Use of the OPT compile option might result in incorrect source line being reported. Full functionality available. Not supported.
Preprocess (1st stage) to expand source: PP(COMMENTS, NOLINES)

Compile (2nd stage): DEBUG (FORMAT (DWARF), HOOK (LINE, NOBLOCK, PATH), SYMBOL, FILE (location)), LIST, LONGNAME, NOOPT, NOOFFSET, GONUMBER 1

  • Expanded source file
  • DWARF file (used by z/OS® Debugger and Fault Analyzer for z/OS®)
  • Compiler listing (used by Application Performance Analyzer)
Supported. Full functionality available. Use in production not recommended. Supported. Full functionality available. Supported.
  • .mdbg file2
Supported. Full functionality available. Use in production not recommended. Supported. Full functionality available. Not supported.
Preprocess (1st stage) to expand source: PP(COMMENTS, NOLINES)

Compile (2nd stage): TEST, AGGREGATE3, NOIPA, LIST, NESTINC (255), NOOFFSET, NOOPT, SOURCE, XREF, LONGNAME, GONUMBER

  • Expanded source file (used by z/OS® Debugger)
  • Compiler listing (used by Fault Analyzer for z/OS® and Application Performance Analyzer)
Supported. Use in production not recommended. Supported. Use in production not recommended. Variables not reported. Supported. Use in production not recommended.
  • Expanded source file (used by z/OS® Debugger)
  • LANGX file (used by Fault Analyzer for z/OS® and Application Performance Analyzer)
Supported. Use in production not recommended. Supported. Use in production not recommended. Variables not reported. Supported. Use in production not recommended.
NOTEST, AGGREGATE3, NOIPA, LIST, NESTINC (255), NOOFFSET, NOOPT, SOURCE, XREF, LONGNAME
  • Compiler listing (used by Fault Analyzer for z/OS® and Application Performance Analyzer)
Not supported. Supported. Suggested for production and test. Variables not reported. Supported. Suggested for production and test.
  • LANGX file (used by Fault Analyzer for z/OS® and Application Performance Analyzer)
Not supported. Supported. Suggested for production and test. Variables not reported. Supported. Suggested for production and test.
UNIX System Services compile -g
  • DWARF file (used by z/OS® Debugger, Fault Analyzer for z/OS®, and Application Performance Analyzer)
Supported. Supported. Supported.
  • .mdbg file2
Supported. Supported. Not supported.
1 The FORMAT(DWARF) option is supported for z/OS® Version 1.6 and higher.
2 For C and C++ programs that are compiled with z/OS® XL C/C++, Version 1.10 or later, if you specify the FORMAT(DWARF) suboption of the DEBUG compiler option, the load modules are smaller and you can create .mdbg files with captured source using the CDADBGLD utility.

z/OS® Debugger needs only the .mdbg file to debug your program.

3 For C++, do not use the AGGREGATE keyword. Use ATTRIBUTES instead.