The cadvise command has the following modes of operation:
•Analysis mode
Used to analyze and create the Program Database (PDB). To invoke cadvise in this mode, enter the cadvise command in the following format:
cadvise
•Report mode
Used to create reports. To invoke cadvise in this mode, enter the cadvise command in the following format:
cadvise report
For information on PDB, see Using the Program Database (PDB) (page 19).
The cadvise command is used as a wrapper around the compiler or linker. The cadvise report option is used to generate reports.
2.4 Using Cadvise as a wrapper around Compiler or Linker
Cadvise is used with the HP C and HP aC++ compilers; GNU gcc and g++ compilers or
For example
The following command lines show how to invoke cadvise:
Regular command line: $ cc
Cadvise command line: $ cadvise
$ cadvise
$ cadvise
The cadvise command first executes the user's regular build line, and then analyzes the source code. Cadvise also analyzes the build line and automatically determines the include paths, defines, and language dialect needed for the source code analysis. The
The result of the cadvise analysis can be stored in a program database using the
2.5 Integrating Cadvise with the makefiles and build process
Cadvise can be easily integrated with the makefiles and the build scripts. If a makefile variable is used to define the C and C++ compilers, you can redefine it to include the cadvise invocation.
Example 1 Updating the makefile to integrate cadvise
See the following makefile content:
CADVISE_OPTS=
CADVISE= /opt/cadvise/bin/cadvise
CC= $(CADVISE) $(CADVISE_OPTS) /opt/ansic/bin/cc
CXX= $(CADVISE) $(CADVISE_OPTS) /opt/aCC/bin/aCC
You may also define a wrapper script instead of the standard compiler commands. For example, see the following sample wrapper script:
12 Using Cadvise