Finding C/C++ information in a Language Environment dump

When a Language Environment traceback or dump is generated for a C/C++ routine, information is provided that is unique to C/C++ routines. C/C++-specific information includes: Each of the unique C/C++ sections of the Language Environment dump are described in Table 1.
Table 1. Contents of the C/C++ sections of the Language Environment
Section Number and Heading Contents
[1] Storage for Active Routines Shows the DSAs for the active C and C++ routines. To relate a DSA frame to a particular function name, use the address associated with the frame to find the corresponding DSA. In this example, the function func1 DSA address is X'20FCB468'.
[2] Control Blocks Associated with the Active Thread Contains the following information:
  • Fields from the CAA
  • Fields specific from the CTHD and CEDB
  • Signal information
[2A] C/C++ CAA Fields Contains several fields that the C/C++ programmer can use to find information about the runtime environment. For each C/C++ program, there is a C-C++ Specific Thread area and a C-C++ Specific Enclave area.
[2B] C-C++ Specific CAA The C-C++ specific CAA fields that are of interest to users are described below.
errno value
A variable used to display error information. Its value can be set to a positive number that corresponds to an error message. The functions perror() and strerror() print the error message that corresponds to the value of errno.
Memory file control block
You can use the memory file control block (MFCB) to locate additional information about memory files. This control block resides at the C/C++ thread level. For more information about the MFCB, see Memory file control block.
Open FCB chain
A pointer to the start of a linked list of open file control blocks (FCBs). For more information about FCBs, see File Control Block Information.
[3] Signal Information When the POSIX(OFF) runtime option is specified, signal information is provided in the dump to aid you in debugging. For each signal that is disabled with SIG_IGN, an entry value of 00000001 is made in the first field of the Signal Information field for the specified signal name.

For each signal that has a handler registered, the signal name and the handler name are listed. If the handler is a fetched C function, the value @@FECB is entered as the function name and the address of the fetched pointer is in the first field.

If you compile a C routine as NORENT, the WSA address is not available (N/A). For more information about the signal function, see z/OS XL C/C++ Programming Guide.

[4] WSA Address The WSA Address is the base address of the writable static area which is available for all C and C++ programs except C programs compiled with the NORENT compile option.
[5] atexit() Information Lists the functions registered with the atexit() function that would be run at normal termination. The functions are listed in chronological order of registration.

If you compile a C routine as NORENT, the WSA address is not available (N/A). For more information about the atexit() function, see z/OS XL C/C++ Runtime Library Reference .

[6] fetch() Information Shows information about modules that you have dynamically loaded using fetch(). For each module that was fetched, the fetch() pointer and the function pointer are included.
ptr1 = fetch("MOD");

If you compile a C routine as NORENT, the WSA address is not available (N/A). For more information about the fetch() function, see z/OS XL C/C++ Programming Guide.

[7] File Control Block Information Includes the file control block (FCB) information for each C/C++ file. The FCB contains file status and attributes for files open during C/C++ active routines. You can use this information to find the data set or file name. The FCB is a handle that points to the following file information, which is displayed when applicable, for the file:
  • Access method control block (ACB) address
  • Data control block (DCB) address
  • Data control block extension (DCBE) address
  • Job file control block (JFCB) address
  • RPL address
  • Current® buffer address
  • Saved buffer address
  • ddname

Not all FCB fields are always filled in. For example, RPLs are used only for VSAM data sets. The ddname field contains blanks if it is not used.

The save block buffer represents auxiliary buffers that are used to save the contents of the main buffers. Such saving occurs only when a reposition is performed and there is new data; for example, an incomplete text record or an incomplete fixed-block standard (FBS) block in the buffers that cannot be flushed out of the system.

Because the main buffers represent the current position in the file, while the save buffers merely indicate a save has occurred, check the save buffers only if data appears to be missing from the external device and is not found in the main buffers. Also, do not infer that the presence of save buffers means that data present there belongs at the end of the file. (The buffers remain, even when the data is eventually written.)

For information about the job file control block, see z/OS MVS™ Data Areas in z/OS® Internet Library at http://www.ibm.com/systems/z/os/zos/bkserv/.

[8] Information for __amrc __amrc is a structure defined in the stdio.h header file to assist in determining errors resulting from I/O operations. The contents of __amrc can be checked for system information, such as the return code for VSAM. Certain fields of the __amrc structure can provide useful information about what occurred previously in your routine. For more information about __amrc, see Debugging C/C++ programs and to z/OS XL C/C++ Programming Guide.
[9] Errno Information Shows the thread ID of the thread that generated the dump and the settings of the errno and errnojr variables for that thread. Both the errno and the errnojr variables contain the return code of the last failing z/OS UNIX system service call. These variables provide z/OS UNIX application programs access to diagnostic information returned from an underlying z/OS UNIX callable service. For more information on these return and reason codes, see z/OS UNIX System Services Messages and Codes.