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

Debugging Guidelines
Debugging an NCL Process
9–8 106160 Tandem Computers Incorporated
If you obtain incorrect output, proofread the source code, looking for
typographical and logical errors.
If you cannot find the bug(s) causing the run-time error or the incorrect
output, consider debugging the NCL process.
4. Consider defining local equate commands and function keys that abbreviate
DEBUG commands, as described later in this section.
When Debugging an NCL
Process
When debugging an NCL process:
1. Start the debug session from OCS by using the DEBUG START command. One
DEBUG START command starts one debug session. In a single debug session, you
can target a specific NCL process or an entire environment for debugging.
Multiple DEBUG START commands start multiple concurrent debug sessions.
Note You must execute the DEBUG START command before you can use any other DEBUG command.
2. If a default NCL ID has already been assigned and does not belong to the process
you want to debug, you must use the DEBUG SET command. See the discussion
on how the default NCL ID is set, later in this section.
3. Begin logging your debug session to the NonStop NET/MASTER MS activity log
by using the DEBUG LOG command, if you want to review DEBUG commands
and results during or after your debug session. The DEBUG NOLOG command
disables logging to the activity log. (By default, all DEBUG commands are written
to the activity log, but not the results of the commands.)
4. Load files containing external procedures that will be called by the NCL process
by using the DEBUG LOAD command, if you want to set breakpoints in the
external procedures before they are called.
5. Display all or some of the decompiled source code by using the DEBUG SOURCE
command. Displaying and examining all the decompiled source code as soon as
you begin a debug session can reveal bugs immediately and obviate the need to
continue debugging. Otherwise, displaying and examining the decompiled source
code indicates the statements at which you can set breakpoints.
6. Set a breakpoint at each position (statement, procedure, function, variable, error
handler, and so on) in the source code where you think a bug may be located by
using the DEBUG BREAKPOINT command. Use the DEBUG LIST
BREAKPOINTS command to list these breakpoints to confirm you have set all
breakpoints correctly. The DEBUG CLEAR BREAKPOINT command clears
breakpoints.
7. Resume execution of the suspended NCL process after setting initial breakpoints.
Do this either by single or multiple steps (statements) by using the DEBUG STEP
command, or by continuing execution to the first breakpoint by using the DEBUG
RESUME command. It is often useful to step through one or two initial statements
and then check the values of initial parameters and other variables before
continuing execution to the first breakpoint.