title>GB/T 4092.11-1992 Programming language COBOL Debug module - GB/T 4092.11-1992 - Chinese standardNet - bzxz.net
Home > GB > GB/T 4092.11-1992 Programming language COBOL Debug module
GB/T 4092.11-1992 Programming language COBOL Debug module

Basic Information

Standard ID: GB/T 4092.11-1992

Standard Name: Programming language COBOL Debug module

Chinese Name: 程序设计语言COBOL 排错模块

Standard category:National Standard (GB)

state:in force

Date of Release1992-08-04

Date of Implementation:1993-05-01

standard classification number

Standard ICS number:Information technology, office machinery and equipment >> 35.060 Languages ​​for information technology

Standard Classification Number:Electronic Components and Information Technology>>Information Processing Technology>>L74 Programming Language

associated standards

alternative situation:GB 4092.11-1983

Procurement status:ISO 1989-15-1985,EQV

Publication information

other information

Release date:1983-12-26

Review date:2004-10-14

Drafting unit:Nanjing University

Focal point unit:National Information Technology Standardization Technical Committee

Publishing department:State Bureau of Technical Supervision

competent authority:National Standardization Administration

Introduction to standards:

GB/T 4092.11-1992 Programming Language COBOL Debugging Module GB/T4092.11-1992 Standard Download Decompression Password: www.bzxz.net

Some standard content:

1 Introduction to the Debug Module
National Standard of the People's Republic of China
Programming language COBOL
Debug module
Programming language COBOL
Debug module
GB/T4092.11-92
Replaces (R4092.1183
1.1 Function
The debug module provides a way for the user to describe his debug algorithms. These algorithms contain: some data items or conditions that are monitored during the execution of the standard program.
Deciding what to monitor and what information to display on the output device is explicitly defined by the user. The COBOL function only provides a way to store relevant information.
The debugging module is considered obsolete in this version of the COBOI standard because it will be deleted in future revisions of the COBOL standard.
1.2 Level Features
Level 1 debugging provides basic debugging functionality, including the ability to specify selected monitoring processes. Level 2 debugging provides the full functionality of COBOI debugging. 1.3 Language Concepts
1.3.1 Debugging Features
The COBOL language features that support the debugging module are: Compile-time switch - WITHDEBUGGINGMODE clause. a.
Target-time switch.
USEFORDERUGGING statement.
d. Special register - DEBUG.ITEM.
1.3.2 Special register - DEBUG-1TEM The reserved word DEBUG.ITEM is the name of a special register automatically generated by the implementer's code to support debugging facilities. Each program is assigned only one DEBUG-ITEM. The names of the subordinate data items in DEBUG-ITEM are also reserved words. 1.3.3 Compile-time switch
The WITHDEBUGGINGMODE clause is issued as part of the SOURCE-COMPUTER section. It is used for debugging statements written in the program. It is a compile-time switch. When the WITHDEBUGGINGMODE clause is specified in the program library, all debugging sections are compiled as specified in this section of this standard. When the WITHDEBUGGINGMODE clause is not specified, all debugging sections are compiled as comments. 13.4 Switches during compilation
The switch during compilation dynamically activates the debugging code inserted by the compiler. This switch is not addressable in the program and is controlled outside the COBOI environment. If the switch is on, all debugging language written in the source program is effective. If the switch is off, all the effects described and the USEFORDEBUGGING statement are suppressed. Providing and canceling this function does not require recompilation of the source program. Approved by the State Forestry Technical Supervision Bureau on August 4, 1992 and implemented on May 1, 1993
GB/T 4092. 11--92
If the WITHDEBUGGINGMODE clause is not specified in the source program during compilation, the switch during compilation has no effect on the execution of the target program.
2 Debugging Module Environment
2.1 WITHDEBUGGINGMODE Clause
2.1.1 Function
The WITHDEBUGGINGMODE clause specifies that all debugging sections are to be compiled. If this clause is not specified, all debugging sections are compiled as if they were comment lines.
2.1.2 General Format
SOURCE-COMPUTER.
2.1:3 General Rules
[Computer Name][WITHDEBUGGINGMODE:] (I) If WITHDEBUGGINGMODE is specified in the SOURCE(COMPUTER) section of the program configuration section, all USF FOR DEBUGGING statement, (2) If the USEFORDEBLIGGINGMODE clause is not specified in the SOURCE-COMPUTER section of a program's configuration section, any USEFORDEBLIGGING statement and all related debugging sections are compiled as comment lines. 3 Procedure section of debugging module
3.1 General description
When the USEFORDEBLIGGING statement of a debugging module appears in a COBOL source program, the procedure section contains the procedure described in it. Shown below is the general format of the procedure section when the USEFORDEBLIGGING statement appears. PROCEDURE DIVISION
DECIARATIVES
{Section nameSECTION
USE FOR DEBLGGING statement.
[Section name.
Example--.
END DECLARATIVES.
{Section nameSECTION
Section name,
[Sentences…
3.2USEFORDEBUGGING Sentences
3.2.1 Function
USE FOR DEBUGGING Statements identify user items that will be monitored by the corresponding debugging section. 3.2.2 General format
L:SE FOR DFRUGGING ON
cd namei
[ALL REFERENCES OF]Identifier 1
Document name 1
Procedure name 1
ALL IROCEDURES
3.2.3 Syntax rules
(I) The debugging section, if specified, must appear immediately after the DECLARATIVES header.
GB/T 4092. 11—92
(2) Except in the USEFORDEBUGGING statement itself, there may be no references to procedures other than those described in the debugging section.(3) Statements appearing outside the debugging section group may not reference procedure names defined in the debugging section group.(4) Except for the USEFORDEBUGGING statement itself, statements appearing in a given debugging section may only reference procedure names defined in different USE procedures that use only IERIORM statements.(5) Procedure names defined in the debugging section may not appear in the USEFORDEBUGGING statement.(6) Any given identifier, cd name, file name, or procedure name may appear in only one USEFORDEBUGGING statement and may only appear once in that statement.(7) The ALLPROCEDURES phrase may appear only once in a procedure.(8) When the AI.I.PROCEDURES phrase is specified, procedure name 1 may not be specified in any USEFORDEBUGGING statement.
(9) Identifier 1 may not refer to any data item defined in the report section other than the sum counter. (10) If the data description clause of the data item referenced by identifier 1 contains an OCCURS clause or a subordinate data description clause containing an OCCLIRS clause, identifier 1 must be specified without the normally required subscript or position index. (11) References to the special register IDEBUG-ITEM are limited to references within the debug section. (12) Identifier 1 may not be a modification reference. 3.2.4 General Rules
(1) Automatic execution of the debug section is not caused by statements that appear in the debug section. (2) When file name 1 is specified in the UJSEFORDEBUGGING statement, the debug section is executed at the following times: a) After the execution of an OPEN or CLOSE statement using file name 1. b) After the execution of a READ statement (and after any other specified USE procedures), but the READ statement does not cause the execution of an associated ATEND or INVALIDKEY command statement. After the DELETE or START statement that references file name 1 is executed. c.
(3) When procedure name 1 is specified in the USEFORDEBUGGING statement, the debug section is executed at the following times: immediately before each execution of the named procedure. a
b. immediately after the AI.,TER statement that references procedure name 1 is executed. (4) The ALLPROCEDURE phrase makes the description of general rule 3 valid for every procedure name in the program, unless these appear in the debug section.
(5) When the ALLREFFRENCESOF identifier 1 phrase is specified, the debug section is executed at each of the following times for each statement that explicitly references identifier 1:
a In the case of a WRITE or REWRITE statement.immediately before the execution of that WRITE or REWRITE statement and after any implicit transfer due to the presence of the FROM phrase. b. In the case of a GOTO statement with a DEPENDINGON phrase, immediately before control is transferred and before the execution of the debug section associated with the procedure name to which control is transferred.
c. In the case of a PERF)RM statement that references identifier 1 with a VARYING, AFTER, or UNTIL phrase, immediately after each initialization, modification, or calculation of the contents of the data item referenced by identifier 1. d. In the case of other CCBOL statements, immediately after the execution of that statement. If identifier 1 is specified in a phrase that is not executed or not calculated, the corresponding debug section is not executed. (6) When identifier 1 is specified without the ALLREFERENCESOF phrase, that debug section is executed at each of the following times: a. In the case of a WRITE or REWRITE statement that explicitly references identifier 1, immediately before the execution of the WRITE or REWRITE statement and after any implicit transfer due to the presence of the FROM phrase. GB/T4092.11—92
b. In the case of a PERFORM statement in which identifier 1 is referenced by a VARYING, AFTER, or UNTIL phrase, immediately after each initialization, modification, or calculation of the contents of the data item referenced by identifier 1. c. Immediately after the execution of any other COBOL statement that explicitly causes the contents of the data item referenced by identifier 1 to change.
If identifier 1 is specified in an unexecuted or unevaluated statement, the corresponding debugging section is not executed. (7) As a result of the execution of a single statement. For a particular operand, the corresponding debugging section will not be executed more than once, regardless of how many times the operand is used in the statement. In the case of a PERFORM statement that causes the referenced procedure to be executed in a loop, the corresponding debugging section is executed once for each loop.
In a command statement, each single occurrence of a command verb is identified as a separate statement for debugging purposes. (8) When cd name 1 is specified in a USEFORDEBUGGING statement , that debug section is executed at the following times: b. After the execution of the ENABLE, DISABLE, and SEND statements that reference ed name 1.
C. After the execution of the ACCEPTMESSAGECOUNT statement that references cd name 1. (9) A reference to identifier 1.cd name 1, file name 1, or procedure name 1 as a qualifier does not constitute a reference to the debug item described by the general rule above.
(10) The special register DEBUG-ITEM associated with each execution of the debug section provides information about the conditions that led to the execution of the debug section. DEBUG-ITEM Has the following implicit description: 01 DEBUG-ITEM.
02 DEBUG-LINE
02FILLER
02 DERUG-NAME
.02FILLER
DEBUG-SUB-1
FILLER
DEBUG-SUB-2wwW.bzxz.Net
FILLER
DEBUG-SUB-3
FILLER
PICTURE IS X(6).
PICTURE IS X VALUE IS SPACE.PICTURE IS X(30).
PICTURE IS SEFARATE CHARACTER-PICTURE IS X VALUE IS SPACE.PICTURE IS S9999 SIGN IS LEADING SEIARATE CHARACTER.PICTURE IS X VALUE IS SPACE.PICTUREISS9999SIGNISLEADINGSEPARATECHARACTER.PICTUREISXVALUEISSPACE.
02 DEBUG-CUNTENTS PICTURE IS X(n). (11) Before each execution of a debug section, the data items referred to by DEBUG-ITEM are filled with spaces. The contents of the data items belonging to DEBUGITEM are then updated according to the following general rules immediately before control is transferred to the debug section. The contents of data items not indicated in the following general rules are filled with spaces. The updating is done according to the rules for MOVE statements, with the only exception that the transfer to DEBUG-CONTENTS is done as if it were a character elementary item to character elementary item transfer, and no conversion of the data from one internal form to another is performed. (12) The contents of DEBUG-LINE are implementer-defined methods that identify a particular source statement. (13) DEBUG-NAME contains the first 30 characters of the name of the debug section that caused the execution. All qualifiers of the name are separated in DEBUG-NAME by the words "IN\ or "(>F\. If there are subscripts or positional indexes, they are not included in DEBUG NAME.
(14) If the reference to a data item that causes the execution of the debug section has subscripts or positional indexes, the occurrence numbers of each level must be stored in DUBUG-SUB-1, DEBUG-SUB-2, and TEBUG-SUB-3 respectively. (15) DEBUG-CONTENTS is a data item large enough to hold the data required by the following general rules. GB/T4092.11—92
(16) If the first execution of the first non-declared procedure in a program causes the execution of the debug section, then the following conditions are met: a+DEBUG-LINE identifies the first statement of that procedure. b. LDEBUG-NAME contains the name of the procedure. DEBUG CONTENTS contains "START PROGRAM. C
(17) If a reference to procedure name 1 in an ALTER statement results in the execution of a debug section, then the following conditions hold: DEBUGI.INE identifies the AIIFR statement that references procedure name 1. b
TEBUG-NAME contains procedure name 1.
IEBUG-CONTENTS contains the applicable procedure name associated with the TO phrase of the ALTER statement. C.
(18) If a transfer of control associated with the execution of a GOTO statement results in the execution of a debug section, then the following conditions hold: DEBUG-LINE identifies the AIIFR statement that executed the transfer of control to procedure name 1. GOTO statement for procedure name 1. DEBLIG-NAME contains procedure name 1.
(19) If a reference to procedure name 1 in the INPUT or OUTPUT phrase of a SCORT or MERGE statement causes the execution of a debug section, the following conditions are true:
DEBUG-LINE identifies a SORT or MERGE statement that references procedure name 1. DEBUG-NAME contains procedure name 1,
DEBUG-CONTENTS contains:
1) If the reference to procedure name 1 is in the INPUT phrase of a SORT statement, it contains 'SORTINPUT'. 2) If the reference to procedure name 1 is in the OUTPUT phrase of a SORT statement, it contains *SORTOUTPUT. 3) If the reference to procedure name 1 is in the OUTPUT phrase of a MERGE statement, it contains "MERGEOUTPUI (20) If the transfer of control from the control mechanism associated with a PERFORM statement results in the execution of the debug section associated with procedure name 1, then the following conditions are true:
DEBUG-LINE identifies the PERFORM statement that references procedure name 1. b.
DEBUG-NAME contains procedure name 1.
DERLGCONTENTS contains PERFORMLOOP. (21) If procedure name 1 is a USE procedure to be executed,Then the following conditions hold: DEBUG-LINE identifies the statement that causes the execution of the USE procedure. DFRUG-NAME contains procedure name 1.
DEBUG-CONTENTS contains 'USEPROCEDURE'" (22) If control implicitly transfers from a previous sequential segment to procedure name 1, causing the execution of the debug section, then the following conditions hold: DEBUGLINE identifies the previous statement.
DEBUG-NAME contains procedure name 1.
DEBUG-CONTENTS contains 'FALL THROUGH'. (23) If a reference to file name 1 or cd name 1 causes the execution of the debug section, then: a,
T)FBUG-LINE identifies the source statement that uses file name 1 or cd name 1. DEBUG-NAME contains file name or cu name I. READ.DERUG-CONTENTS contains the entire record read d, all remaining references to file name 1, and DEBUG CONTFNTS contains spaces. For any reference to ed name 1, DEBUG-CONTENTS contains the contents of the area associated with cd name. e.
(24) If the reference to identifier 1 causes the execution of a debug section, then: DEBG-LINE identifies the source statement with identifier 1. a
IDFHUG-NAME contains the name of identifier 1. GB/T4092.11—92
DEBUG-CONTENTS contains the contents of the data item referenced by identifier 1 when control is transferred to the debug section (see General Rules 5 and 6 above).
Additional Notes:
This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University.
The main drafters of this standard are Qian Shuren, Wang Ying, Feng Hui, and Duan Yang. This standard was first issued in December 1983 and revised for the first time in August 1992.
Tip: This standard content only shows part of the intercepted content of the complete standard. If you need the complete standard, please go to the top to download the complete standard document for free.