Steps for finding RENT static variables

Before you begin: you need to know the WSA. To find this information, see Locating the Writable Static Area (WSA). For this procedure's example, assume that the address of writable static is X'02D66E40'.

Perform the following steps to find RENT static variables:

  1. Find the offset of @STATIC (associated with the file where the static variable is located) in the Writable Static Map section of the prelinker map. Figure 1 shows an example; in this Writable Static Map section of a prelinker map, the offset is X'58'.
    Figure 1. Writable static map produced by prelinker
    ========================================================================
    |                         Writable Static Map                          |
    ========================================================================
    
      OFFSET    LENGTH  FILE ID  INPUT NAME
    
           0         1   00001   DFHC0011
           4         1   00001   DFHC0010
           8         2   00001   DFHDUMMY
           C         2   00001   DFHB0025
          10         2   00001   DFHB0024
          14         2   00001   DFHB0023
          18         2   00001   DFHB0022
          1C         2   00001   DFHB0021
          20         2   00001   DFHB0020
          24         2   00001   DFHEIB0
          28         4   00001   DFHEIPTR
          2C         4   00001   DFHCP011
          30         4   00001   DFHCP010
          34         4   00001   DFHBP025
          38         4   00001   DFHBP024
          3C         4   00001   DFHBP023
          40         4   00001   DFHBP022
          44         4   00001   DFHBP021
          48         4   00001   DFHBP020
          4C         4   00001   DFHEICB
          50         4   00001   DFHEID0
          54         4   00001   DFHLDVER
          58       278   00001   @STATIC
         720        30   00002   @STATIC
  2. Add the offset to the WSA to get the base address of static variables, as shown.
    X'02D66E40' + X'58' = X'2D66E98'
  3. Find the offset of the static variable in the partial storage offset compiler listing. In the following example, the offset is 96 (X'60').
    sa0  66-0:66 Class = static, Location = WSA + @STATIC + 96, Length = 4
  4. Add the offset of the static variable in the partial storage offset compiler listing (found in step 3) to the base address of static variables (calculated in step 2).
    X'2D66E98' + X'60' = X'2D66EF8'

When you are done, you have the address of the value of the static variable in the Language Environment dump.

Figure 2 shows the path to locate RENT C++ and C static variables by adding the address of writable static, the offset of @STATIC, and the variable offset.
Figure 2. Location of RENT static variable in storage
Location of RENT static variable