Monitoring the Release Version of a Visual C++ Program

Related Topics

PureCoverage can monitor the optimized release version of a Visual C++ program, with or without symbol data and debug data.

PureCoverage uses debug line information to collect line-by-line coverage data. If this debug data is not available for a module, PureCoverage excludes that module. PureCoverage also requires relocation data to collect data at line or function level. If relocation data is not available for a module, PureCoverage excludes the module. Without debug symbol data for functions, PureCoverage labels functions UnnamedFunction@<offset>.

By default, the compiler does not create a relocation section when you compile a release version of your executable. To add relocation data, specify the /fixed:no and /incremental:no linker options in the Project Settings dialog box in Microsoft Visual Studio. Or specify at the command line, for example:

cl /O2 /Zi stock.cpp /link /fixed:no /incremental:no

You can create an optimized release version with debug data. For example, specifying the following options compiles Stock.cpp for maximum speed and with debug data:

cl /O2 /Zi stock.cpp

Visual Studio generates a .pdb file that PureCoverage can use to detect coverage at line level.

If you do not want to build a .pdb file, you can compile optimized and build a .map file. For example:

cl /O2 stock.cpp /link /map

PureCoverage uses the symbol data in the .map file to provide function names.

(C) Copyright IBM Corporation 1993, 2010.