z/TPF - Group home

Inserting comments in z/TPF objects and displaying them with ZDMAP

  

Did you know that every z/TPF object file contains a comment section that you can display online by using the ZDMAP command? The following example shows the ZDMAP output for a shared object named CFTP. The shared object was constructed from two C source files, cftp1.c and cftp2.c and the display shows the comments for both of the corresponding objects, as well as the bld- object that is automatically added at link time by the maketpf tools.

 

For this example, the comments were defined using the TPF_APARNUM variable, which was set in the maketpf configuration file at build time. In this case, the cftp1 object was generated for APAR PJ32232 and the cftp3 object was generated for PUT 3. The bld- object shows a comment of PJ32232, which indicates that this was the last time the shared object was linked; therefore, PJ32232 came after PUT 3.

 

zdmap cftp i-lpath

 

CSMP0097I 07.31.16 CPU-B SS-BSS SSU-HPN IS-01

DMAP0003I 07.31.16 LINK MAP DATA DISPLAY

CFTP ACTIVE IN LOADSET BASE IN SUBSYSTEM BSS

PROGRAM ADDRESS 0000000390E02D60

PROGRAM SIZE 0000A45C

 

/ztpf/aparbld/PJ32232/base/obj/cftp1.o - OBJ FILE AT ADDR 0000000390E02D60

OBJECT FILE SIZE 000058A4

COMPILER INFO - GCC: (GNU) 4.1.2 20060724 (prerelease) (GNUPro 06r1) _

COMPILED ON 2007/09/19 AT 10.42.31

COMMENT - PJ32232

 

/ztpf/bld/base/obj/cftp3.o - OBJ FILE AT ADDR 0000000390E08604

OBJECT FILE SIZE 00000610

COMPILER INFO - GCC: (GNU) 4.1.2 20060724 (prerelease) (GNUPro 06r1)

COMPILED ON 2007/02/05 AT 13.26.15 _

COMMENT – PUT3

 

NAME - /ztpf/aparbld/PJ32232/base/obj/bld-PJ32232.o _

OBJECT FILE SIZE 00000000

COMPILED ON 2007/09/19 AT 10.42.42

COMMENT - PJ32232

 

 

The comment string that is added to the object can be defined through the maketpf tools by using the following methods:

 

  • TPFOBJPP_COMMENT

    This is an environment variable that can be set in the maketpf configuration file. The value that is specified is inserted into every object.
     

  • TPF_APARNUM

    This is an environment variable that also can be set in the maketpf configuration file. If this environment variable is defined, it automatically is inserted before any value that is defined for the TPFOBJPP_COMMENT environment variable. This variable was originally added for use by the z/TPF build team as a way to define the APAR version of each of the objects that are delievered in the APAR packages.

    The value of this variable also is used in the name of the
    bld- object that is inserted as part of the link process. If a value is not defined, the shared object name is used in the bld- object name. For this example, if the TPF_APARNUM environment variable was not defined, the bld- object name would have been bld-CFTP.o.
     

  • tpftools/include_ztpf/maketpf_tpfobjpp

    This is a user exit that was added with APAR PJ37889 to allow the TPFOBJPP_COMMENT string to be tailored for each object that is processed. Before this user exit was available, it was necessary to change the TPFOBJPP_COMMENT environment variable and run maketpf for each unique object and comment combination. With this user exit in place, the value of the TPFOBJPP_COMMENT environment variable can be tailored for each compile in a single maketpf process. Additional details about the user exit are provided in the Migration Considerations section of the APEDIT for APAR PJ37889 and in the commentary of the user exit itself.

    The following list provides some examples of how the user exit might be coded to modify the TPFOBJPP_COMMENT environment variable on a per object basis:

     

    • Add code to extract information from a predefined location in the prolog of the source file that is being used to generate the object.

    • Add code to extract information from the metadata of the file from the source code repository.

    • Include the absolute source file name.