HP aC++/HP C A.06.25 Programmer's Guide

Debugging Programs
You can use programming and debugging aides.
HP Code Advisor
HP Code Advisor is a code checking tool that can be used to detect programming errors
in C/C++ source code. Use "/opt/cadvise/bin/cadvise" to invoke the tool. A brief
description is available with the -help option.
$ /opt/cadvise/bin/cadvise -help
Additional information is available at: http://www.hp.com/go/cadvise/.
HP WDB Debugger
You can also use the HP WDB debugger to debug your C++ programs after compiling
your program with either the -g, the -g0, or the -g1 option.
Example:
The -g0 option enables generation of debug information:
$ aCC -g0 program.C
The gdb command runs the HP WDB debugger:
$ gdb a.out
For more information on the HP WDB debugger, refer to “Debugging Options”
(page 44).
Accessing Online Example Source Files
Online example source files are located in the directory /opt/aCC/contrib/
Examples/RogueWave. These include examples for the Standard C++ Library and
for the Tools.h++ Library.
Compiler Command Syntax and Environmental Variables
The aCC command (the driver) invokes the HP aC++ compiling system. The aCC
command is followed by options and files that need to be compiled.
aCC [options] [files]
You must use the aCC command to link your C++ programs and libraries. This ensures
that all libraries and other files needed by the linker are available.
Example:
aCC prog.C
This command compiles the source file prog.C and puts the executable code in the
file a.out.
For a complete list of command line options, see Chapter 2: “Command-Line Options”
(page 39).
Compiler Command Syntax and Environmental Variables 31