8 handling errors – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual
Page 130
DEC Text Processing Utility Program Development
5.7 Debugging DECTPU Programs
To compile all code in the buffer, use the EXTEND ALL command or use the
COMPILE (CURRENT_BUFFER) statement. To execute a procedure after
compilation, use the TPU command. For example, if you want to execute the
compiled procedure user_fum, type the following at the EVE Command prompt:
Command: TPU user_fum
When DECTPU encounters a breakpoint (or when you use the STEP command
described later), DECTPU invokes the debugger program. As the debugger
assumes control, it receives from DECTPU the name of the procedure whose
execution has been suspended. The debugger searches its source buffer for that
procedure.
When DECTPU encounters the first breakpoint in the session, the code you are
debugging has not yet been placed in the debugger’s source buffer. The debugger
prompts for the name of the file that contains your code. Using your response,
the debugger places your code in its source buffer. The debugger uses your
previous response to supply missing fields, if any, in subsequent file names that
you specify. All files read into the source buffer remain there, so that the time
DECTPU takes to find a procedure may increase as more files are read into the
source buffer.
You cannot use the TPU command followed by the MESSAGE built-in procedure
to examine the contents of a local variable while debugging. To use the
MESSAGE built-in to examine a local variable, you must write the MESSAGE
built-in into the procedure you are debugging. After the statement that contains
MESSAGE is executed, you can examine the message buffer to see the results.
Alternatively, you can use the debugger EXAMINE command to examine local
variables and the formal parameters of the suspended procedure.
5.8 Handling Errors
Each DECTPU built-in procedure returns one or more status codes telling you
what happened when the built-in was executed. A DECTPU status code can have
one of the following severity levels:
•
SUCCESS
•
INFORMATIONAL
•
WARNING
•
ERROR
•
FATAL
You can enable or disable the display of informational or success messages with
the SET (INFORMATIONAL) and SET (SUCCESS) built-in procedures.
See Chapter 4 for a description of how to use the ON_ERROR language statement
to trap error and warning messages.
In addition to messages that are generated by DECTPU, a built-in procedure may
return system messages.
5–30 DEC Text Processing Utility Program Development