Top
NetCOBOL V11.0 Debugging Guide
FUJITSU Software

5.1 Outline of the Debugging Functions

Six types of debugging functions are available for COBOL:

To use the debugging function, specify the compiler option for each desired debugging function at the compilation of the COBOL program, and specify the environment to operate the debugging function at the execution of the program.

Table 5.1 Outline of the debugging functions and compiler options

Function Name

Outline

Compiler Option

CHECK function

The following items are checked.

  • Whether the subscript or the index addresses an area outside of the range of a table when that table is referenced

  • Whether the reference modified exceeds the data length at reference modification

  • Whether the contents of the object word are correct when the data containing the OCCURS DEPENDING ON clause is referenced

  • Whether the numeric item contains a value of the type that is specified by the attribute.

  • Whether the divisor in division is not zero.

  • Whether, in an invoked method, the number of parameters and attributes for a calling method match those for a called method.

  • Whether, in an invoked program, the calling conventions of a calling program match those of a called program.

  • Whether, the number of parameters and length of the CALL statements match those of a called program.

Purpose

  • To prevent an operation error of the program due to a memory reference error

  • To prevent erroneous numbers from causing a program to behave unexpectedly

  • To prevent invalid parameters from causing a program to behave unexpectedly

  • To prevent different calling conventions from causing a program to behave unexpectedly.

CHECK

TRACE function

The following types of information are output:

  • Tracing result of executed statements

  • Line number and verb number of the statement that was executed at abnormal termination

  • Program name that contains the statements that were executed and program attribute information

  • Message output during execution

Purpose

  • To ascertain at which statement abnormal termination occurred

  • To ascertain the path of the statements that were executed up to abnormal termination

  • To check the message output during execution

TRACE

COUNT function

This function reports:

  • The execution count for each statement in your program, sequentially, along with the percentage of this execution count vs. the total execution count for all the statements.

  • The execution count by verb that appears in your program, along with the percentage of this count vs. the total execution count for all the statements.

Purpose

  • To identify all the routes the program have followed during execution

  • To improve the efficiency of your program

COUNT

Memory check function

The following items are checked.

  • The runtime system area is checked when the program and method procedure divisions start and end. If the area has been destroyed, the following information is output.

    • Name of the program or method for which area destruction was detected

    • Location where destruction was detected (procedure division start or end)

    • Addresses of the destroyed area

Purpose

  • To identify the program that destroyed the runtime system area. If the COBOL Error Report is also used, the destroyed locations can also be identified.

-

COBOL Error Report

This function reports the following information:

  • Error type (Exception code or runtime message)

  • Problem location (Module name, program name, source file name, line number)

  • Calling path

  • System information

  • Environment variable

  • Runtime environment information

  • Process list

  • Module list

  • Thread information

Moreover, the dump is output.

Purpose

  • To identify which error has occurred and in which statement

  • To identify the calling path for the programs run until errors occurred

  • To identify the status of applications or the computer in effect when errors occurred

TEST

Debugging using Compiler Listings

The following information is output for each object program.

  • Object relative offset

  • Object code in machine language

  • Procedure name and procedure number

  • Assembler instruction

  • Verb name and line number

  • Area name

  • Defined word written in the COBOL program

Purpose

  • To identify the statement that caused the program to terminate abnormally

LIST

PRINT

SOURCE

COPY

MAP

Note

You cannot use the TRACE and COUNT functions at the same time.