TAL Programmer's Guide
Debugging Programs
Running and Debugging Programs
096254 Tandem Computers Incorporated 16–5
Setting Breakpoints A breakpoint is a location within your program at which to suspend execution so you
can use Inspect commands to check results at that point. Usually, you request at least
one breakpoint at the Inspect prompt before the first instruction in your program
executes. For example, you can set an unconditional breakpoint at a statement or at an
edit line number.
If you set an unconditional breakpoint at a statement, the program suspends execution
before the first machine instruction generated for that statement executes. The
following example sets a breakpoint at the eighth statement from the beginning of
MYPROC:
BREAK #myproc + 8 STATEMENTS
If you set an unconditional breakpoint at an edit line number, the program suspends
execution immediately before that line executes. The following example sets a
breakpoint at edit line 21:
BREAK #21
You can also set conditional and other breakpoints as described in the Inspect Manual.
Stepping Through
a Program
At the Inspect prompt, before the first statement executes or when the program pauses
at a breakpoint, you can step through the program and execute a single statement at a
time.
1. To execute the first statement, enter:
STEP
2. To repeat the STEP command, press the Return key.
3. To set a temporary breakpoint two statements hence and resume execution, enter:
STEP 2 STATEMENTS
Displaying Values When the program suspends execution at a breakpoint, you can use the DISPLAY
command to display the values of variables. You can shorten the command to its first
letter. For example, to display the values of variables LENGTH, WIDTH, and DEPTH,
use either of the following commands:
DISPLAY length, width, depth
D length, width, depth
Stopping the
Inspect Session
To stop the Inspect session and your program, use the STOP command at the Inspect
prompt. In high-level mode, enter STOP exactly as shown here:
STOP