IBM Support

Enhancement: Adding a new suboption DSNAME to COBOL compiler option TEST(SEPARATE)

Question & Answer


Question

Background:  The compiler option TEST(SEPARATE) supports generation of DWARF debug information into a separate file, instead of putting the information into a no-load class in the executable program object. The purpose is to avoid keeping unnecessary information in the production load library. When DWARF information is needed, the user has to specify the name of the debug information file to the COBOL runtime, for example using the COBOL debug file user exit (IGZIUXB or IGZIUXC/D). 

An enhancement has been made to keep the name of the debug information file in the program object. This technical note provides information about this enhancement and the corresponding documentation changes.

Answer

A new suboption, DSNAME, of TEST(SEPARATE) has been added to the COBOL compiler.

If TEST(SEPARATE(DSNAME)) is in effect, the SYSDEBUG dataset name used during compilation is stored in the program object.  This name will be used as the default at run time when DWARF information is required.  The dataset name can be overridden by using the SYSDEBUG COBOL debug file user exit, IGZIUXB (or IGZIUXC/D). Note that when NODSNAME is in effect, the IGZIUXB (and IGZIUXC/D) user exit provides the only mechanism of locating the DWARF debugging information for the program.

Specifying TEST(SEPARATE) without explicitly specifying the DSNAME suboption is equivalent to TEST(SEPARATE(NODSNAME)). No change to existing compilation JCL is needed if this new feature is not required. Existing compiler option settings remain to behave the same.

Refer to the following COBOL user documentations for details about the TEST compiler option. The corresponding sections have been updated to describe this new feature.

1.    Enterprise COBOL Programming Guide. Chapter 1, Compiler Options.
       - TEST Option
2.    Enterprise COBOL Programming Guide. Chapter 14, Defining compiler input and output.
        - Defining the debug data set (SYSDEBUG)
3.    Enterprise COBOL Programming Guide. Chapter 19, Debugging.
        - Signature information bytes
4.    Enterprise COBOL Programming Guide. Appendix G.
        - COBOL SYSADATA file contents
5.    Enterprise COBOL Customization Guide. Chapter 2, Enterprise COBOL Compiler options
        - TEST Option

When the compiler option TEST(SEPARATE(DSNAME)) is in effect, the compiler stores the debug file name (specifed in the SYSDEBUG DD during compilation) in the PPA4 information block of the program. The Language Environment Vendor Interfaces has been updated to include the following information.

        Chapter 1. Common interfaces and conventions, the section on Prolog information blocks.

        COBOL V5 32-bit PPA4 layout
        
        PPA4 conforms to this layout under these conditions:
          - Member identifier (PPA2 offset X'00') is 4
          - PPA4 version in PPA4 program flags is 1
          - PPA4 program flags indicates 31-bit compile

        Table 6. COBOL V5 32-bit PPA4 layout.

          +-------------+--------+------------------------------------------------+
          | Offset      | Length | Description                                    |
          |             |        |                                                |
          +-------------+--------+------------------------------------------------+
          | X'00'       | 4      | PPA4 debug flags for PPA4 version 1            |
          +-------------+--------+------------------------------------------------+
          | X'04'       | 4      | PPA4 program flags                             |
          +-------------+--------+------------------------------------------------+
          | X'08'       | 4      | Address of NORENT static                       |
          +-------------+--------+------------------------------------------------+
          | X'0C'       | 4      | Signed offset from WSA to 32-bit RENT static   |
          +-------------+--------+------------------------------------------------+
          | X'10'       | 4      | Signed offset from 32-bit RENT static to       |
          |             |        | program address cell.                          |
          |             |        | Note: You need to dereference the address      |
          |             |        | cell to get the address of the program static. |
          |             |        | Note: WSA belongs to the program object (PO).  |
          |             |        | There is one WSA per PO. More than one COBOL   |
          |             |        | programs can be statically linked within a PO; |
          |             |        | each has its own program static area.          |
          |             |        | See below table for additional notes.          |
          +-------------+--------+------------------------------------------------+
          | X'14'       | 4      | Signed offset from PPA4 to code csect          |
          +-------------+--------+------------------------------------------------+
          | X'18'       | 4      | Length of code sect (in bytes)                 |
          +-------------+--------+------------------------------------------------+
          | X'1C'       | 4      | Length of NORENT static (in bytes)             |
          +-------------+--------+------------------------------------------------+
          | X'20'       | 4      | Length of 32-bit RENT static (in bytes)        |
          +-------------+--------+------------------------------------------------+
          | X'24'       | 4      | Length of 24-bit RENT static (in bytes)        |
          +-------------+--------+------------------------------------------------+
          | X'28'       | 2      | Signed offset from PPA4 to code sect name      |
          |             |        | (prefixed with 2 bytes string length).  Zero   |
          |             |        | if code sect name is not available.            |
  |       |             |        | Note: The actual location of the csect name    |
  |       |             |        | string is determined by the offset field in    | 
  |       |             |        | X'28', and can reside after PPA4. Below are    |
  |       |             |        | additional fields when the “minor version      | 
  |       |             |        | number exist” bit in PPA4 debug flag is set.   |
  |       |             |        | If that bit is not set, offset +X’28’ is the   |
  |       |             |        | last field.                                    |
  |       +-------------+--------+------------------------------------------------+
  |       | X'2A'       | 2      | minor-version (unsigned integer), 0. i.e.      |
  |       |             |        | version of current layout is 1.0               |
  |       |             |        | Note: This number could be updated in the      |
  |       |             |        | future to indicate layout changes              |
  |       +-------------+--------+------------------------------------------------+
  |       | X'2C'       | 8      | reserved (set to zero)                         |
  |       +-------------+--------+------------------------------------------------+
  |       | X'34'       | 4      | Offset UsrWrkStrg                              |
  |       +-------------+--------+------------------------------------------------+
  |       | X'38'       | 4      | Length UsrWrkStrg (in bytes)                   |
  |       +-------------+--------+------------------------------------------------+
  |       | X'3C'       | 1      | Has Externals                                  |
  |       +-------------+--------+------------------------------------------------+
  |       | X'3D'       | 2      | Signed offset from PPA4 to SYSDEBUG dataset    |
  |       |             |        | name (prefixed with 2 bytes string length).    |
  |       |             |        | Zero if SYSDEBUG dataset name is not available |
          +-------------+--------+------------------------------------------------+

 

          Additional notes for X'10': For COBOL V6, the WORKING-STORAGE section is
          allocated in the program static area, and this area can be above or below
          the line depending on the requirements of the program.  For example, if the
          DATA(24) compiler option is in effect, the WORKING-STORAGE section is 
          allocated in the program static area, and the area is below the line.  If 
          the DATA(31) option is in effect the WORKING-STORAGE section is allocated
          in the program static area, and the area is above the line.  The program
          static area can be used for purpose other than the WORKING-STORAGE section.

          For COBOL V5, if the DATA(31) option is in effect, the WORKING-STORAGE 
          section is allocated in the 31-bit RENT static area (inside the WSA).  The
          program static area is not used in this case. If the DATA(24) option is in 
          effect, the WORKING-STORAE allocation is the same asa COBOL V6.


          PPA4 debug flags
         
          PPA4 debug flags for PPA4 version 1 - PPA4 offset X'00' are shown in the
          following code sample:


         ’00...... ........ ........ ........’B Reserved
         ’..0..... ........ ........ ........’B DWARF is not embedded in NOLOAD D_* class
         ’..1..... ........ ........ ........’B DWARF is embedded in NOLOAD D_* class
         ’...0.... ........ ........ ........’B DWARF is not embedded in LOAD D_* class
         ’...1.... ........ ........ ........’B DWARF is embedded in LOAD D_* class
         ’....0... ........ ........ ........’B Compilation unit is compiled with TEST
         ’....1... ........ ........ ........’B Compilation unit is not compiled with TEST
         ’.....0.. ........ ........ ........’B DWARF is not in side file
         ’.....1.. ........ ........ ........’B DWARF is in side file  |
         ’......1. 00000000 00000000 00000000’B minor version number exists
         ’.......0 00000000 00000000 00000000’B Reserved

 

  |       Note: When the minor version number field is present, fields at offset X’2A’ 
  |       to X’3D’ are also present.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Component":"","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"All Versions","Edition":"Enterprise","Line of Business":{"code":"LOB17","label":"Mainframe TPS"}}]

Document Information

Modified date:
13 December 2018

UID

ibm10742617