Naming CSECTs for Fault Analyzer

To facilitate source code information, Fault Analyzer must be able to match CSECT names with the compiler listings or side files provided.

For this to be possible, all CSECTs must be named. Whereas the names of CSECTs in programs written in most high-level languages are automatically assigned, special requirements apply to programs written in C. Failure to follow these requirements prevents source code information from being determined for these types of programs.

CSECT naming requirements for C programs

To enable automatic source support for C programs from the IDILC or IDILANGX concatenation, it is a requirement that CSECTs are named using the following #pragma statement:
#pragma csect(code,"csect_name")

Where, if a PDS or PDSE is used, csect_name matches the member name of the compiler listing or LANGX file. This enables the side file search to automatically locate compiler listings.

For more information about preparing z/OS® XL C and C++ programs for use with Fault Analyzer, see IBM Application Delivery Foundation for z/OS Common Components: Customization Guide and User Guide, in the chapter Quick start guide for compiling and assembling programs for use with the ADFz family of products.

To handle cases where C programs were not compiled with the #pragma csect option, two sample EXECs are provided in data set IDI.SIDISAM1 to facilitate source provision:
IDISCLST

This EXEC can be used to process C compiler listings to extract the C function names from the PPA1 and build an index of function names and their matching listing data set.

IDISCPRO

This EXEC is a Fault Analyzer listing exit. It scans the index file created by IDISCLST and returns the name of the matching listing data set for a given function.

Figure 1. Extracting function names from C programs that were not compiled with #pragma csect

Diagram showing how to enable source support for C programs that were not compiled with the #pragma csect option. The IDISCLST EXEC processes C compiler listings to extract the C function names from the PPA1 and build an index of function names and their matching listing data set. If a side file is not found during analysis Fault Analyzer can run the IDISCPRO listing exit. It scans the index file created by IDISCLST and returns the name of the matching listing data set for a given function.