NET/MASTER Network Control Language (NCL) Programmer's Guide
Why Use the DEBUG Commands?
Debugging an NCL Process
9–4 106160 Tandem Computers Incorporated
Displaying Decompiled
Source Code
When debugging, it is good practice to proofread the source code for bugs. Without
the DEBUG commands, you can examine only the original source code, either by using
the LIST command (which displays the source code in your OCS window) or by using
Edit Services. However, examining the original source code is not always effective in
detecting bugs.
Using the DEBUG SOURCE command, you can display decompiled source code, that
is, source code created from object code. Decompiled source code is likely to appear
different from original source code. Examining the decompiled source code shows
you the statements that NCL has executed or will execute. These are not necessarily
the statements you would think NCL has executed or will execute, which you would
determine by examining the original source code.
Decompiled source code is likely to appear different from original source code for at
least two reasons. First, decompiled source code does not contain comments.
Comments are not compiled and, therefore, not decompiled. Second, decompiled
source code is optimized. Optimization includes concatenating constant strings and
converting alphabetic characters in labels, procedures, functions, and variable names
from lowercase to uppercase.
Comparing the decompiled source code against the original source code can help you
to find bugs resulting from errors such as the incorrect use of variables or comments.
Examples of incorrect use of variables are omitting the initial ampersand (&) from a
variable name, assigning a variable an invalid value or the wrong value, using a
variable in an incorrect context, and so on. Examples of incorrect use of comments are
nesting comments, inverting the characters used for a comment delimiter, splitting a
comment delimiter over two lines, and so on. The incorrect use of comments can
result in blocks of original executable source code being regarded as part of a
comment, which is then not displayed when the decompiled source code is displayed.
Note Refer to the discussion on compiler operation and expressions and operators in the NonStop
NET/MASTER NCL Reference Manual for more on optimization during compilation.
The information for each statement in the decompiled source code includes:
The NCL ID of the NCL process in which the statement occurs
The line number in which the statement starts
The statement number of the statement
The text of the decompiled source statement
When viewing decompiled source code, you can display:
The statement at which execution is currently suspended
A single statement at the current nesting level
A single statement at the specified nesting level
All statements, including statements at all lower nesting levels