Debugging provides a means by which the user can describe the conditions under which procedures are to be monitored during the execution of the object program.
The ANSI Debug
Module is classed as an obsolete element in the ANSI'85 standard and is
scheduled to be deleted from the next full revision of the ANSI Standard.
All dialects in this
COBOL implementation fully support this syntax. The FLAGSTD directive can be
used to detect all occurrences of this syntax.
Although it is a
part of the standard COBOL definition, this module is explicitly excluded from
the X/Open COBOL language definitions and should not be used in a conforming
X/Open COBOL source program.
The decisions of what to monitor and what information to display are explicitly in the domain of the user. The COBOL debug facility simply provides a convenient access to pertinent information.
The features of the language that support the COBOL debug module are:
The reserved word DEBUG-ITEM is the name for a special register generated automatically by your COBOL system that supports the debugging facility. Only one DEBUG-ITEM is allocated per program. The names of the subordinate data items in DEBUG-ITEM are also reserved words.
The DEBUGGING MODE clause is written as part of the SOURCE-COMPUTER paragraph in the Environment Division. It serves as an object-time switch over debugging statements written in the program.
When the WITH DEBUGGING MODE clause is specified in a program, all debugging sections and all debugging lines are handled as specified in this section of the document.
When the DEBUGGING MODE clause is not specified in a program, all the debugging sections and debugging lines are treated as if they were comment lines and their syntax is not checked.
An RTS switch dynamically activates the debugging code inserted by your COBOL system. This switch cannot be addressed in the program; it is controlled outside the COBOL environment. If the switch is on, the effects of any USE FOR DEBUGGING statements written in the source program are permitted. If the switch is off, all the effects described in the USE FOR DEBUGGING statement are inhibited. Re-creation of the object code is not required to provide or take away this facility.
The object time switch has no effect on the execution of the object program if the WITH DEBUGGING MODE clause was not specified in the source program.
A debugging line is any line with a "D" or "d" in the indicator area of the line. Any debugging line that consists solely of spaces from margin A to margin R is considered the same as a blank line.
The contents of a debugging line must be such that a syntactically correct program is formed with or without the debugging lines being considered as comment lines.
A debugging line will be considered to have all the characteristics of a comment line, if the WITH DEBUGGING MODE clause is not specified in the SOURCE-COMPUTER paragraph.
Successive debugging lines are allowed. Continuation of debugging lines is permitted, except that each continuation line must contain a "D" or "d" in the indicator area, and character-strings can not be broken across two lines.
A debugging line is permitted in the program only after theOBJECT-COMPUTER paragraph .
Note: Debugging lines are part of the ANSI Nucleus and not the ANSI Debug module. Therefore, they are not obsolete and are not scheduled to be deleted from the next full revision of the ANSI Standard.