NET/MASTER Network Control Language (NCL) Programmer's Guide

Why Use the DEBUG Commands?
Debugging an NCL Process
9–6 106160 Tandem Computers Incorporated
You can also dynamically modify the value of a variable, by using the DEBUG
MODIFY command. You could use this command, for example, to modify the value
of the control variable in a DO loop, to alter the logic of an NCL process; the values of
variables passed to a procedure or function, to see the result of sharing certain
variables; the value of an arithmetic term in an expression, to obtain a different result;
and so on.
Continuing Execution of an
NCL Process
Using statements such as PAUSE to suspend execution, you can pause at fixed
positions only. From a fixed position you can then continue execution only to the next
fixed position.
Using the DEBUG commands, you have considerable flexibility where you set
breakpoints to suspend execution. When execution is temporarily suspended at a
breakpoint, you can choose how to continue execution of an NCL process based on the
information you obtain at that breakpoint.
You can either resume execution to the next breakpoint, by using the DEBUG
RESUME command, or continue execution by steps, by using the DEBUG STEP
command, where each step is the execution of a certain number of statements at a
specified nesting level. Resuming execution allows you to quickly execute a group of
statements that you do not think are associated with a bug and move to the next
breakpoint that you think is associated with a bug. Stepping through statements
allows you to examine a sequence of individual statements in detail.
Logging Debug Messages
Selectively
When using statements such as SAY and WRITE, all debug messages are logged in the
NonStop NET/MASTER MS activity log. However, using the DEBUG LOG and
DEBUG NOLOG commands, you can choose which messages are to be logged.
By default, when you begin a debug session, all the DEBUG commands you use and
the results of those commands are displayed on your OCS window, but only the
commands are logged. If you want to log both commands and results, you can use the
DEBUG LOG command to additionally log results.
You can log your whole debug session by entering the DEBUG LOG command at the
beginning of the session and the DEBUG NOLOG command at the end. Or you can
log parts of your debug session by using the DEBUG LOG and DEBUG NOLOG
commands at selected points throughout your debug session.
You can use the Log Browse facility to browse through the debug messages in the
activity log, either during or after your debug session. During your debug session,
you may find it useful to use an OCS window for debugging and a second window for
using Log Browse. You can then swap between the two windows as required. Using
Log Browse lets you review your debug session and plan the rest of your session.
After your debug session, it may be useful to use Log Browse to review your session;
to analyze the sequence of DEBUG commands used and to improve your debugging
technique.
Refer to the NonStop NET/MASTER MS Operator’s Guide for more information on using
Log Browse to browse through the NonStop NET/MASTER MS activity log.