Previous Topic Next topic Print topic


FaultFinder Source Listing - Source

There are two kinds of source listings that appear in the output, the Data Division listing and Procedure Division listing.

Data Division Listing

The Data Division listing looks like this:

fun.cbl, line 1
Line    Loc   :Size  ----+-*A-1-B--+----2----+----3----+----4----+---...-8
000001                        program-id. 'funbar'.
000002                        working-storage section.  
000003  000050:0000FF         01 ws-var-1     pic x(255).
000004  000005                thread-local-storage section.
000006  000000:0003FD         01  tls-var-1   pic x(1021).
000007  000008                local-storage section.
000009  000000:0001FF         01  ls-var-1    pic x(511).
000010  000011                linkage section.
000012  000000:0007DB         01  lnks-var-1  pic x(2011).
000013  000000:000400         01  lnks-var-1r pic a(1024) redefines lnks-var-1.
000014  000000:000C18         01  lnks-var-2  pic x(3096).
000015  000016               procedure division using lnks-var-1 lnks-var-2.

The listing contains a page header, not shown in the example above, that gives product and compilation information. This is followed by the name of the source module that the first line of page originates from and its sequence number relative to that module. For example, the first line of page 1 in the example source listing originates from the module fun.cbl and is line 1 in that module.

After the line showing the module is a column scale; this indicates the COBOL areas of the source line (that is, Area A, Area B, and so on). In the example above, this scale is compressed to allow notations. In this scale line, there is also a header for the sequence line of the source lines being displayed.

Following the column scale is the Data Division code. The first 80 characters of each source line that was compiled are displayed in the body of the source listing. If a source line exceeds 80 characters, the excess characters are not shown.

The header indicates that the location (Loc) and size (Size) of each data item definition is displayed (in hexadecimal) immediately before the actual source line that defines the data item. For example, on line 3, the data item ws-var-1 is defined and it has an offset from the start of statically allocated data of h"50" and a size of h"ff" (decimal 255). Similarly, at line 6 the variable tls-var-1 has an offset of h"00" and a size of h"3FD" (decimal 1021).

Procedure Division Listing

The Procedure Division Listing looks like this:

fun.cbl, line 17                          
IntAddr:GntAddr----+-*A-1-B--+----2----+----3----+----4----+--- ... -8   Xref  
000017  00002e                 sec1 section.                          =000017
000018  000030                 par1.                                  =000018
000019  000031:00000CC             move tls-var-1 to ws-var-1          000006 >000003
000020  000039:00000F4             if ws-var-1 = lnks-var-1           ?000003 ?000012
000021  000042:0000160                display ls-var-1                 000009
000022  000049                     end-if
000023  00004B:000016C         stop run.
000024

The listing contains a page header, not shown in the example above, that gives product and compilation information. This is followed by the name of the source module that the first line of the page originates from and its sequence number relative to that module. For example, the first line of page 2 in the listing originates from the module fun.cbl and is line 17.

After the line showing the module is a column scale that indicates the COBOL areas of the source line (that is, Area A, Area B, and so on). In the example listing above, this scale is compressed to allow notations. In the scale line there is also a header for the sequence line of the source lines being displayed.

The column scale contains the headers IntAddr and GntAddr, under which are shown the intermediate code address and the generated/object code address relative to the start of the module, of the actual source line from which the generated code was created. For example, for the syntax at line 19, the intermediate code address is h"31" and the generated/object code address is h"CC". The column scale aslo contains the header Xref, under which is shown the definition line of the data items that are manipulated in the statement, and any operations performed on the data items in the statement. The type of operations is indicated by a character:

= Definition
> Modification
? Test

For example, on line 18 of the listing above, par1 is defined; on line 19, there is a reference to tls-var-1 which is defined on line 6 and there is a modification to ws-var-1 which is defined on line 3. On line 20, there is a test of ws-var-1, which is defined on line 3, and of lnks-var-1, which is defined on line 12.

Previous Topic Next topic Print topic