NET/MASTER Network Control Language (NCL) Programmer's Guide
Why Use the DEBUG Commands?
Debugging an NCL Process
106160 Tandem Computers Incorporated 9–5
Multiple statements in a certain direction
Multiple statements at a certain nesting level
Using Breakpoints to
Suspend Execution
A breakpoint is a position in an NCL process at which NCL suspends execution. You
typically set a breakpoint in the source code where you think a bug is located, by using
the DEBUG BREAKPOINT command. You can place a breakpoint at the following
positions in an NCL process:
At the first statement of an error handler.
At the entrance or exit statement to an internal or external procedure or function.
At a specified statement: either in the current procedure or function, or in a nested
procedure or function in the current procedure or function, or in an external
procedure.
At the termination point of an NCL process.
At the specified variable for the specified type of access: for read access, for write
access, or for either. (Write access includes deletion: that is, assigning a null value
to a variable.)
Setting breakpoints allows you to display and examine the source code and the values
of variables at those breakpoints. By examining the source code, you can determine if
execution flow and an individual statement is correct. By examining the values of
variables, you can determine if the logic of the NCL process is correct. Based on what
you determine, you can then dynamically set other breakpoints, clear breakpoints by
using the DEBUG CLEAR BREAKPOINT command, modify the values of variables,
terminate execution of the NCL process, and so on. The DEBUG LIST BREAKPOINTS
command lists current breakpoints.
When you start a debug session and execute a new NCL procedure, execution is
suspended at the first statement, and then at the breakpoints you subsequently
specify. When you start a debug session to debug a currently executing NCL process,
execution is suspended at the current statement and then at the breakpoints you
subsequently specify.
Without using breakpoints, and using only SAY statements, for example, as your
debugging aid, you could find it difficult to suspend execution at the code position
you wish and you would be unable to dynamically change the position at which
execution is suspended. In addition, you would not be able to suspend execution at a
variable for the specified type of access.
Displaying and Modifying
Variables
Using only SAY statements as your debugging aid, you can display only the current
value of selected variables; once displayed, you are not able to dynamically modify
the value of those variables.
Using the DEBUG DISPLAY command, when execution is suspended you can display
the current values of specified variables—in either normal or hexadecimal format—
and the attributes of those variables. Attributes include flags (ERRFLD or MODFLD),
type (stem or mapped data object (MDO)), and whether a variable currently exists.