Specify the compiler option MAP to output information relating to data areas to the compiler list file.
There are three listings relating to data areas:
Data map listing
Program control information listing
Section size listing
Format of Data Map Listing
[1] [2] [3] [4] [5] [6] [7] [8] [9] [12] LINE ADDR OFFSET REC-OFFSET LVL NAME LENGTH ATTRIBUTE BASE DIM ENCODING [10]**MAIN** 15 GWA+00000124 FD OUTFILE LSAM BGW.000000 16 [GWA+00000020]+00000000 0 01 prt-rec 60 ALPHANUM BVA.000003 SJIS 18 GWA+000001F8 0 77 answer 8 EXT-DEC BGW.000000 19 GWA+00000200 0 77 divisor 4 EXT-DEC BGW.000000 21 COA+00000060 0 01 CSTART 8 ALPHANUM BCO.000000 SJIS 22 COA+00000068 0 01 CEND 8 ALPHANUM BCO.000000 SJIS 23 COA+00000070 0 01 CRES 8 ALPHANUM BCO.000000 SJIS 25 [GWA+00000018]+00000000 0 01 dividend 2 EXT-DEC BVA.000001 [11]**SUB1** 48 [GWA+0000001C]+00000000 0 01 disp 8 EXT-DEC BVA.000002
The data map listing provides data area allocation information and data attribute information for data defined in the source program’s DATA DIVISION (the WORKING-STORAGE SECTION, FILE SECTION, CONSTANT SECTION, LINKAGE SECTION, and REPORT SECTION).
The elements of the data map listing shown above are:
[1] LINE
Displays the line number in the following format:
When the compiler option NUMBER is specified:
[COPY qualification value-] user-line-number
When the compiler option NONUMBER is specified:
For details on the COPY qualification value, user-line-number, and relative-line-number see "5.7.2 Source Program Listing".
[COPY qualification value-] relative-line-number in source file
[2] ADDR, OFFSET
The address displays the data item area allocated in the object program in the following format:
Section name + Relative address
Displays one of the following:
COA (.rodata)
GWA (.data)
GW2 (.bss)
EBP (stack)
HGW (heap)
HPA (heap)
Where the abbreviations stand for:
The methods for finding the base addresses of the various sections are as follows:
Find the base addresses of COA (.rodata), GWA (.data), and GW2 (.bss) by referencing the link map listing. For details how you do this, refer to “2) Retrieving base addresses of sections” in “5.7.5.3 Researching Data Values”.
EBP is the processor’s EBP register. Find the address in this register using the debugger.
HGW and HPA are stored in the stack. To find the base addresses, it is necessary to reference the program control information listing.
The base address of HGW is stored in BHG (Base for HGW).
The base address of HPA is stored in BOD (Base for Object Data).
Finding the base addresses for HGW and HPA is described in the following example:
Program control information listing
** STK ** : * SGM * ........ SGM POINTERS AREA 0 : EBP+FFFFFFB8 BOD 4 EBP+FFFFFFBC BHG 4
The base address of HGW is stored in the location indicated by EBP+FFFFFFBC, and the base address of HPA is stored in the location indicated by EBP+FFFFFFB8. You figure the base addresses of HPA and HGW by finding the value in the EBP register and adding the respective numbers. (Note that the stack grows downwards in memory, and the EBP stores the starting address of the stack, so offsets from EBP are generally negative numbers - hence all the leading “F”s. To add these negative offsets, simply add the two hex numbers, including the “F”s, and ignore the final carry digit on the addition of the leftmost digits. However, as you’ll see in “5.7.5.3 Researching Data Values”, you can have the software do the addition for you.)
Provides the relative address from the base address of the section.
If the section contains a pointer to the actual location of the data, then the location of the pointer is contained in square brackets ( [ ] ) followed by the offset of the actual data from the address contained in the pointer.
The method for referencing the data area depends on whether or not a pointer is involved:
If there is no pointer e.g. DATA1 has “GWA+00000060” in the ADDR column:
Indicates that the data area DATA1 exists at the location 0x60 from the GWA base address.
If a pointer is indicated e.g. DATA2 shows “[GWA+0000007C]+0000000C” in the ADDR column:
An address is stored at the location 0x7C from the GWA base address (in the example, this address is 000210e8). The data area DATA2 exists at the location 0x0C from this address (in the example, this is the location 0x000210e8+0x0c).
[3] REC-OFFSET
Displays the offset in the record as a decimal number.
[4] LVL
Displays the level number defined in the source program.
[5] NAME
Displays the data name defined in the source program. This name is truncated at 30 bytes. The data name is displayed in uppercase letters when the compiler option ALPHAL is specified.
[6] LENGTH
Displays the length of data items as a decimal number.
Not displayed for file names.
[7] ATTRIBUTE
Displays data attributes. These attributes and their meaning are listed in "Table 5.10 Meanings of displayed data attribute abbreviations ".
Displayed Data Attribute | Meaning |
GROUP-F | Fixed-length group item |
GROUP-V | Variable-length group item |
ALPHA | Alphabetic |
ALPHANUM | Alphanumeric |
AN-EDIT | Alphanumeric edited |
NUM-EDIT | Numeric edited |
INDEX-DATA | Index data |
EXT-DEC | Display decimal |
INT-DEC | Packed decimal |
FLOAT-L | Double-precision internal floating-point |
FLOAT-S | Single-precision internal floating-point |
EXT-FLOAT | External floating point |
BINARY | Binary |
COMP-5 | Binary |
INDEX-NAME | Index name |
INT-BOOLE | Internal Boolean |
EXT-BOOLE | External Boolean |
NATIONAL | National |
NAT-EDIT | National edited |
OBJ-REF | Object reference |
POINTER | Pointer data |
For file description entries, file types and access modes are abbreviated as in "Table 5.11 Meanings of displayed file types/access mode abbreviations ":
Displayed Abbreviation | Meaning |
---|---|
SSAM | Sequential file, sequential access |
LSAM | Line sequential file, sequential access |
RSAM | Relative file, sequential access |
RRAM | Relative file, random access |
RDAM | Relative file, dynamic access |
ISAM | Indexed file, sequential access |
IRAM | Indexed file, random access |
IDAM | Indexed file, dynamic access |
PSAM | Presentation file, sequential access |
[8] BASE
Displays the base register and base position allocated to the data item.
[9] DIM
Displays the number of dimensions of subscripting or indexing.
[10] and [11] Program name
Displays the program name used as a delimiter in a internal program.
Note that, in a class definition, the delimiters for definitions are displayed as follows:
**Class name** ** FACTORY ** ** OBJECT ** ** MET (Method name)**
[12] Encoding form
Displays the encoding forms of the following data items:
ALPHANUM (Alphanumeric)
AN-EDIT (Alphanumeric edited)
NATIONAL (National)
NAT-EDIT (National edited)
Displays the encoding forms using the following symbols:
SJIS : Shift JIS
UTF8 : UTF-8
UTF16LE : UTF-16 little endian
UTF16BE : UTF-16 big endian
UTF32LE : UTF-32 little endian
UTF32BE : UTF-32 big endian
Format of Program Control Information Listing
ADDR FIELD-NAME LENGTH [1] ** GWA ** GWA+00000000 GCB FIXED AREA 8 GWA+00000008 TL 1ST AREA 16 ........ MUTEX HANDLE AREA 0 . . . * STL * EBP+FFFFFFD8 TL 2ND AREA 8 EBP+FFFFFFEC LIA ADDRESS 20 ** LITERAL-AREA ** [2] ADDR 0 . . . 4 . . . 8 . . . C . . . 0123456789ABCDEF COA+00000040 10000000 01000000 08000000 04000000 ................ COA+00000050 40000000 5359534F 55542020 @...SYSOUT
[1] Displays the allocated locations and lengths of all work areas and data areas in the object program (only a small portion of the data is shown in the above excerpt).
[2] Displays the literal area in the object program.
Format of Section Size Listing
** PROGRAM SIZE ** [1] .text SIZE = 2409 BYTES .data SIZE = 516 BYTES ** EXECUTION DATA SIZE ** [2] .bss SIZE = 0 BYTES heap SIZE = 0 BYTES stack SIZE = 184 BYTES
[1] Displays the size of the .text section and .data section in the object program.
[2] Displays the size of the area required at runtime.
Note that in a class definition this is displayed as follows:
** EXECUTION DATA SIZE ** CLASS NAME .bss SIZE = 272 BYTES heap SIZE = 0 BYTES METHOD NAME stack SIZE = 384 BYTES [3] :
[3] The stack size is displayed for each method definition.