HP 3000 Manuals

USE FOR DEBUGGING statement [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

USE FOR DEBUGGING statement 

The USE FOR DEBUGGING statement identifies the user procedures that are
to be monitored by the associated debugging section.  The USE FOR
DEBUGGING statement has the following format:

Syntax 

[]
The following syntax rules apply to the USE FOR DEBUGGING statement: * Debugging section(s), if specified, must appear together immediately after the DECLARATIVES header. * Except in the USE FOR DEBUGGING statement itself, there must be no reference to any nondeclarative procedure within the debugging section. * Statements appearing outside of the set of debugging sections must not reference procedure names defined within the set of debugging sections. * Except for the USE FOR DEBUGGING statement itself, statements appearing within a given debugging section may reference procedure names defined within a different USE procedure only with a PERFORM statement. * Procedure names defined within debugging sections must not appear within USE FOR DEBUGGING statements. * Any given procedure name may appear in only one USE FOR DEBUGGING statement and may appear only once in that statement. * The ALL PROCEDURES phrase can appear only once in a program. * When the ALL PROCEDURES phrase is specified, procedure-name-1 must not be specified in any USE FOR DEBUGGING statement. * References to the special register DEBUG-ITEM are restricted to references from within a debugging section. The following general rules apply to the USE FOR DEBUGGING statement: 1. When procedure-name-1 is specified in a USE FOR DEBUGGING statement that debugging section is executed: a. Immediately before each execution of the named procedure. b. Immediately after the execution of an ALTER statement which references procedure-name-1. 2. The ALL PROCEDURES phrase causes the effects described in general rule #1 to occur for every procedure name in the program, except those appearing within a debugging section. 3. In the case of a PERFORM statement which causes iterative execution of a referenced procedure, the associated debugging section is executed once for each iteration. Within an imperative statement, each individual occurrence of an imperative verb identifies a separate statement for the purpose of debugging. 4. A reference to procedure-name-1 as a qualifier does not constitute reference to that item for the debugging described in the general rules above. 5. Associated with each execution of a debugging section is the special register DEBUG-ITEM, which provides information about the conditions that caused the execution of a debugging section. DEBUG-ITEM has the following implicit description: 01 DEBUG-ITEM. 02 DEBUG-LINE PICTURE IS X(6). 02 FILLER PICTURE IS X VALUE SPACE. 02 DEBUG-NAME PICTURE IS X(30). 02 FILLER PICTURE IS X VALUE SPACE.[REV BEG] 02 DEBUG-SUB-1 PICTURE IS S9999 SIGN IS LEADING SEPARATE.[REV END] 02 FILLER PICTURE IS X VALUE SPACE.[REV BEG] 02 DEBUG-SUB-2 PICTURE IS S9999 SIGN IS LEADING SEPARATE.[REV END] 02 FILLER PICTURE IS X VALUE SPACE.[REV BEG] 02 DEBUG-SUB-3 PICTURE IS S9999 SIGN IS LEADING SEPARATE.[REV END] 02 FILLER PICTURE IS X VALUE SPACE. 02 DEBUG-CONTENTS PICTURE IS X(30). 6. Prior to each execution of a debugging section, the contents of the data item referenced by DEBUG-ITEM are space filled. The contents of data items subordinate to DEBUG-ITEM are then updated, according to the following general rules, immediately before control is passed to that debugging section. The contents of any data item not specified in the following general rules remains spaces. Updating is accomplished in accordance with the rules for the MOVE statement, the sole exception being the move to DEBUG-CONTENTS. In this case, the move is treated exactly as if it was an alphanumeric to alphanumeric elementary move with no conversion of data from one form of internal representation to another. 7. The contents of DEBUG-LINE is the number of a particular source statement. 8. DEBUG-NAME contains the first 30 characters of the name that caused the debugging section to be executed. All qualifiers of the name are separated in DEBUG-NAME by the word "IN" or "OF'". 9. DEBUG-SUB-1, DEBUG-SUB-2,...are treated only as filler items in HP COBOL II. 10. DEBUG-CONTENTS is a data item that is large enough to contain the data required by the following general rules. 11. If the first execution of the first nondeclarative procedure in the program causes the debugging section to be executed, the following conditions exist: a. DEBUG-LINE identifies the first statement of that procedure. b. DEBUG-NAME contains the name of that procedure. c. DEBUG-CONTENTS contains "START PROGRAM". 12. If a reference to procedure-name-1 in an ALTER statement causes the debugging section to be executed, the following conditions exist: a. DEBUG-LINE identifies the ALTER statement that references procedure-name-1. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains the applicable procedure name associated with the TO phrase of the ALTER statement. 13. If the transfer of control associated with the execution of a GO TO statement causes the debugging section to be executed, the following conditions exist: a. DEBUG-LINE identifies the GO TO statement whose execution transfers control to procedure-name-1. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains spaces. 14. If reference to procedure-name-1 in the INPUT or OUTPUT phrase of a SORT or MERGE statement causes the debugging section to be executed, the following conditions exist: a. DEBUG-LINE identifies the SORT or MERGE statement that references procedure-name-1. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains: 1. "SORT INPUT", if the reference to procedure-name-1 is the INPUT phrase of a SORT statement. 2. "SORT OUTPUT", if the references to procedure-name-1 is in the OUTPUT phrase of a SORT statement. 3. "MERGE OUTPUT", if the reference to procedure-name-1 is in the OUTPUT phrase of a MERGE statement. 15. If the transfer of control from the control mechanism associated with a PERFORM statement caused the debugging section associated with procedure-name-1 to be executed, the following conditions exist: a. DEBUG-LINE identifies the PERFORM statement that references procedure-name-1. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains "PERFORM LOOP". 16. If procedure-name-1 is a USE procedure that is to be executed, the following conditions exist: a. DEBUG-LINE identifies the statement that causes execution of the USE procedure. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains "USE PROCEDURE". 17. If an implicit transfer of control from the previous sequential paragraph to procedure-name-1 causes the debugging section to be executed, the following conditions exist: a. DEBUG-LINE identifies the previous executed statement at run time. b. DEBUG-NAME contains procedure-name-1. c. DEBUG-CONTENTS contains "FALL THROUGH".


MPE/iX 5.0 Documentation