4 Using cross-file analysis

Cadvise provides different operating modes for performing cross-file analysis of the application. The cross-file analysis can be performed along with the regular build of the application, or separated from the regular build. You can also initiate it either on all the files or only on a selected group of files or modules. It can also be disabled completely. The default and recommended mode is to enable cross-file analysis at link time. Cadvise fetches all the recorded information from the PDB for all the object files specified at the link command line and performs cross-file analysis.

Usage:

-crossfile = option

Table 3 Cross-file analysis options

Option

Description

 

 

none

Disables cross-file analysis. If a PDB location is specified using the –pdb

 

option, the logs of errors and the diagnostic messages found during the

 

compile time of the application are stored in the PDB.

 

 

auto

Directs the cross-file analysis to be automatically done at the link time of

 

the application. This is the default mode.

 

 

defer

Does not initiate the cross-file analysis at the link time of the application.

 

When you use this option, a PDB location must be specified using the –pdb

 

option. During the compile time of the application, logs and intermediate

 

representation files are stored in the PDB so that the cross-file analysis can

 

be initiated later with either of the

 

–crossfile=[pdbmodulelistlistfile] options.

 

 

pdb

Initiates cross-file analysis on all the intermediate representation files stored

 

in the PDB. When you use this option, a PDB location must be specified

 

using the –pdb option.

 

 

module:<module_name>

Enables cross-file analysis of object files in a PDB corresponding to a

 

particular module(shared library or executable). During the build, cadvise

 

records the list of files that make up the module. So, for cross-file analysis,you

 

can use the name of the module instead of specifying the list of object files.

 

 

list:<file1:file2:.. ..:fileN>

Enables cross-file analysis of object files in a PDB corresponding to the listed

 

object files. File1, File2,..., FileN are object files. For more information, see

 

.

 

 

listfile:<file_name>

Enables cross-file analysis of object files in a PDB corresponding to the

 

object files listed in the specified file. The list of object files in <file_name>

must be separated by space or newline characters. For more information, see Example 15 (page 24).

The following examples illustrate the equivalent usage of different cross-file options to perform cross-file analysis:

22 Using cross-file analysis