Debugging with messages that have offset information
Some IWZ messages include offset information that you can use to identify the particular line of a program that failed.
About this task
To use this information:
Procedure
- Compile the program with the
LIST
option. This step produces an assembler listing file, which has a suffix of .wlist. -
When you get a message that includes a traceback, find the offset information for the COBOL
program. In the following example, the program is TEST, and the corresponding hexadecimal offset is
0x678 (highlighted in bold):
Traceback: /opt/ibm/cobol/rte/usr/lib/libcob2_32r.so(+0x66b60)[0xf76f3b60] /opt/ibm/cobol/rte/usr/lib/libcob2_32r.so(iwzWriteERRmsg+0x17)[0xf76f41f7] /opt/ibm/cobol/rte/usr/lib/libcob2_32r.so(_iwzcBCD_CONV_Pckd_To_Int4+0x176)[0xf76be7b6] test.out(TEST+0x678)[0x5655a844] /lib/libc.so.6(__libc_start_main+0xf3)[0xf74b12d3] --- End of call chain --- IWZ903S The system detected a data exception. IWZ901S Program exits due to severe or critical error.
-
Look in the
.wlist
file for the hexadecimal offset. To the right of the hexadecimal offset, after the instructions bytes, is the COBOL source line number. In the following example, the line number corresponding to 0x678 is 174 (highlighted in bold):000174: COMPUTE x = FUNCTION FACTORIAL(Packed-Dec-05). 000669 EC83 6A08 000174 sub esp, 0x00000008 00066C 046A 000174 push 0x00000004 00066E 0068 0000 E800 000174 push OFFSET FLAT:LEVEL-01-PACKED-DECIMAL 000673 00E8 0000 8300 000174 call OFFSET FLAT:_iwzcBCD_CONV_Pckd_To_Int4 000678 C483 8910 000174 add esp, 0x00000010
- Look in your program listing for the statement.