Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
25 - 1
25
Debugging, Trap Handling, and
Signal Handling
This section deals with fixing problems that might occur with compiled code. Such
problems typically are coding errors that produce unexpected results or prevent the
program from continuing to execute. Coding errors are not the only possible cause of
problems: a lack of a system resource (such as memory) can also prevent normal
process execution. Such situations are reported as traps to TNS and accelerated
programs and as signals to native programs.
This section describes the following features of the operating system:
How to invoke a debugging program on your application
How to deal with trap conditions (TNS and accelerated programs only)
How to deal with signals (native programs only)
Invoking a Debugger
When your program enters the Debug state (seeSection 16, Creating and Managing
Processes, for a discussion of process states) in the TNS and TNS/R environments, it
runs under the control of one of two debugging programs: Debug or the Inspect
program. Debug is a low-level debugger that provides bit-level information and control
of registers and memory locations. The Inspect program is a symbolic debugger that
allows you to control program execution, set breakpoints, examine program variables,
and modify values in terms of source-language symbols.
In the TNS/R and TNS/E environments you can also use Visual Inspect to debug
processes. Visual Inspect is a GUI-based native symbolic debugger that runs on a
Windows workstation connected to a TNS/R or TNS/E native host. It is designed to
debug native processes on a native host.
H-series and J-series systems provide two debuggers for native mode debugging in
the TNS/E environment: Native Inspect and Visual Inspect. The Inspect debugger is
available on both H-series and J-series systems, but can be used only for debugging
TNS processes.
Visual Inspect is the primary application debugging tool in the TNS/E native
environment. The H-series and J-series version of Visual Inspect debugger includes
the same functionality as the G-series version. Visual Inspect supports high-level
symbolic debugging of native and TNS processes (interpreted and accelerated)
through a PC-based graphical user interface. Visual Inspect can also be used for
debugging TNS, TNS/R, and TNS/E snapshot files.
The H-series and J-series Visual Inspect facility has been enhanced for machine-level
debugging; you can now use it for low-level debugging tasks on the PC that needed to