Rational Developer for System z
Enterprise PL/I for z/OS, Version 4.2, Programming Guide

Statement offset addresses

If the LIST compile option is used, the compiler includes a pseudo-assembler listing in the compiler listing. This listing includes, for each instruction, an offset whose meaning depends on the setting of the BLKOFF compiler option:

The pseudo-assembler listing also includes, at the end of the code for each block, the offset of the block from the start of the current module (so that the offsets shown for each statement can be translated to either block or module offsets).

These offsets can be used with the offset given in a runtime error message to determine the statement to which the message applies.

The OFFSET option produces a table that gives for each statement, the offset of the first instruction belonging to that statement.

In the example shown in Figure 2, the message indicates that the condition was raised at offset +98 from the SUB1 entry. The compiler listing excerpt shows this offset associated with line number 8. The runtime output from this erroneous statement is shown if Figure 3.

Figure 2. Finding statement number (compiler listing example)
Compiler Source
    Line.File
       1.0
       2.0      TheMain: proc options( main );
       3.0        call sub1();
       4.0        Sub1: proc;
       5.0          dcl (i, j) fixed bin(31);
       6.0
       7.0          i = 0; j = 0;
       8.0          j = j / i;
       9.0          put skip data( j );
      10.0        end Sub1;
      11.0      end TheMain;

 . . .

OFFSET OBJECT CODE        LINE#  FILE#    P S E U D O   A S S E M B L Y   L I S T I N G
       
000000                    000002 |        THEMAIN  DS       0D
000000  47F0  F024        000002 |                 B        36(,r15)
000004  01C3C5C5                                            CEE eyecatcher
000008  000000B0                                            DSA size
00000C  000001F8                                            =A(PPA1-THEMAIN)
000010  47F0  F001        000002 |                 B        1(,r15)

 . . .

000000                    000004 |        SUB1     DS       0D
000000  47F0  F024        000004 |                 B        36(,r15)
000004  01C3C5C5                                            CEE eyecatcher
000008  00000140                                            DSA size
00000C  00000190                                            =A(PPA1-SUB1)
000010  47F0  F001        000004 |                 B        1(,r15)

...

000086  5020  D0B8        000007 |                 ST       r2,I(,r13,184)
00008A  1842              000007 |                 LR       r4,r2
00008C  5040  D0BC        000007 |                 ST       r4,J(,r13,188)
000090  5800  D0B8        000008 |                 L        r0,I(,r13,184)
000094  8E40  0020        000008 |                 SRDA     r4,32
000098  1D40              000008 |                 DR       r4,r0
00009A  1805              000008 |                 LR       r0,r5
00009C  5000  D0BC        000008 |                 ST       r0,J(,r13,188)
0000A0  4100  D0C0        000009 |                 LA       r0,_temp1(,r13,192)
0000A4  5000  D130        000009 |                 ST       r0,_temp2(,r13,304)
0000A8  A708  5A88        000009 |                 LHI      r0,H'23176'
0000AC  4000  D0EC        000009 |                 STH      r0,_temp1(,r13,236)
0000B0  5800  6004        000009 |                 L        r0,SYSPRINT(,r6,4)
0000B4  5000  D12C        000009 |                 ST       r0,_temp2(,r13,300)
0000B8  4100  0001        000009 |                 LA       r0,1
0000BC  5000  D0C0        000009 |                 ST       r0,_temp1(,r13,192)
0000C0  4100  D128        000009 |                 LA       r0,_temp2(,r13,296)

...

Figure 3. Finding statement number (runtime message example)
Message :

IBM0301S ONCODE=320  The ZERODIVIDE condition was raised.
         From entry point SUB1 at compile unit offset +00000098 
         at entry offset +00000098 at address 0EB00938.

Entry offsets given in dump and ON-unit SNAP error messages can be compared with this table and the erroneous statement discovered. The statement is identified by finding the section of the table that relates to the block named in the message and then finding the largest offset less than or equal to the offset in the message. The statement number associated with this offset is the one needed.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)