C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Running and Debugging C and C++ Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
19-12
Debugging C and C++ Programs
TCP/IP sockets library functions, and Guardian system procedures might require
type int.
Debugging C and C++ Programs
To debug C and C++ programs, you can use several debuggers:
Debug on NonStop S-series systems
Inspect on NonStop S-series or HP Integrity NonStop NS-series systems
Native Inspect on NonStop NS-series systems
The Visual Inspect debugger
These subsections introduce some of the features of each debugger.
Debug
Debug provides machine-level process debugging; that is, it provides access to a
process in terms of code and data addresses, hardware registers, and other machine-
level quantities. To use Debug, you should have a thorough understanding of the HP
NonStop architecture as described in the system description manual that corresponds
to your NonStop system, such as the NonStop S-Series Server Description Manual.
For more details about Debug, see the Debug Manual.
Inspect
The Inspect symbolic debugger provides both machine-level and source-level process
debugging.
If you compile your TNS or TNS/R native program using the SYMBOLS pragma, you
can use the source-level mode of the Inspect debugger to access your process in
terms of variables, functions, statements, and other source-level entities. In addition, if
you have a thorough understanding of the HP NonStop architecture, you can use the
machine-level mode of the Inspect debugger to access hardware registers and other
machine-level quantities.
If you compile your program using the SAVEABEND pragma, the system automatically
creates a save file, or snapshot, of your running program if it terminates abnormally.
You can use Inspect to examine the save file and diagnose the cause of the abnormal
termination.
To debug PIC (Position-Independent Code) on a NonStop S-series system, you must
use Visual Inspect. To debug any native code file on a NonStop NS-series system, you
must use Visual Inspect or Native Inspect.
You can use Inspect on both TNS and TNS/R programs. On NonStop NS-series
systems, you cannot use Inspect on TNS/E programs.
For more details about the Inspect debugger, see the Inspect Manual.