Steps for finding C/C++ parameters

The C/C++ parameter list is always located in the caller's DSA at offset 2176 (X'880'). Parameters that are passed in registers are not always stored in the parameter list. The compiler option XPLINK(STOREARGS) can be used to ensure that all parameters are stored in the parameter list.

Perform the following steps to find parameters in the Language Environment® dump or system dump:

  1. Determine the name of the parameter and the function it is for. As an example, we will find the parameter pp for the function funcb from the program cdivzero shown in Figure 53. C routine with a divide-by-zero error.
  2. From the compiler listing, locate the parameter in the storage offset listing:
    pp                  5828-0:15       Class = parameter,           Location = 2432(r4),           Length = 8
  3. From the Traceback (in the Language Environment dump or in the formatted output from the IPCS VERBEXIT LEDATA 'CEEDUMP' subcommand for a system dump) locate the function:
        DSA       Entry       E  Offset  Load Mod  Program Unit  Service  Status
        00000003  funcb       +0000002E  CDIVZERO                         Exception
    
        DSA       DSA Addr          E  Addr             PU Addr           PU Offset  Comp Date Attributes
        00000003  00000001082FF080  0000000025100108    0000000000000000  ********   20040408  XPLINK  EBCDIC  IEEE

    If the base register is R4, the register 4 value is always the DSA address for the function.

    If the base register is not R4, the register value must be located from saved registers.

    If the Status field indicates Exception, use the saved registers from when the condition occurred. In the Language Environment dump, the saved registers can be found in the Condition information associated with the DSA address in the "Condition Information for Active Routines" section. In the formatted output from the IPCS VERBEXIT LEDATA 'CM' subcommand for a system dump, the saved registers can be found in the CIBH that has the DSA address as the value for the SV1 field.

    If the Status field indicates Call, use the saved registers from the DSA address that appears on the line above the function in the Traceback. In the Language Environment dump, the DSAs can be found in the "Control Blocks for Active Routines" section. In the formatted output from the IPCS VERBEXIT LEDATA 'STACK' subcommand for a system dump, the DSAs can be found in the "DSA backchain" section.

    Note: Some functions do not save all registers.
  4. Add the register value to the offset of the parameter to obtain the address of the parameter. In the Language Environment dump, the contents of the parameter can be read in the DSA Frame section corresponding to the function that passed the parameter. For a system dump, use the IPCS LIST subcommand to display the storage where the parameter is located.

    The address for parameter pp is X'1082FF080' + X'980' = X'1082FFA00'.