Original Publication Date: 1972-Sep-01
Included in the Prior Art Database: 2005-Feb-25
Hurwitz, G: AUTHOR [+3]
This is a method for monitoring the execution of COBOL programs in order to provide (a) debugging facilities; (b) the ability to alter executable code and resume execution; (c) the ability to alter debug requests during execution and to resume execution; and (d) execution speed.
This is a method for monitoring the execution of COBOL programs in order to provide (a) debugging facilities; (b) the ability to alter executable
code and resume execution; (c) the ability to alter debug
requests during execution and to resume execution; and (d)
Each COBOL statement is given one (or more) external statement numbers and code is compiled for each statement number, so that the code may execute independent of its preceding and following statements and independent of its actual core location.
A table (MAP) is created in core in which each statement is represented. There is one entry for each statement number. MAP is kept in statement number order and, since each entry is of fixed length, MAP is directly addressable via the statement number.
Each MAP entry contains the following fields:
DEL- deletion indicator
TRACE- debug indicator
PER- indicates that a period exists in the source text
for this statement
HEAD,TAIL- source structure indicators
COND- indicates (if on) that this statement sets a "psuedo
- condition - code"
STATE- indicates (if level is nonzero) whether this
statement is on a true or false path
LEVEL- indicates (if nonzero) the level, or nesting depth,
of this statement
OB- address of the compiled code for this statement
SEQ- used to show flow of control
INSERT- address of a list of elements that further define
MON- flag for debug code.
A monitoring routine executes the COBOL program by locating the compiled code for the statement (via OB), setting this address in a register so that the code need not be aware (at compile time) of its physical location, and then branching to the code. The code, after performing the function called for by the COBOL source, returns to the monitor. The address of the monitor is available in a register during execution. The monitor then uses the SEQ field to locate the next logical statement, and repeats the above process.
At any time during execution, the user may intervene, The monitor will comply with the request as soon as the currently executing statement has returned control to it. The user may then insert new COBOL executable statements (or replace or delete existing ones), indicating the statement number(s) they are to follow.
These entries are attached to the appropriate MAP entry or entries via the INSERT field, or via other such entries previously created.
Conditional branching during execution is handled as follows. A COBOL statement that specifies that a test is to be performed is compiled as a separate statement. The compiled code performs the necessary test, sets a global switch ("psuedo - condition - code") to ind...