You can use PureCoverage to monitor the code coverage of native-compiled (unmanaged) Visual C++ programs.
For these programs, PureCoverage makes a copy of the executable and associated program modules and uses Object Code Insertion (OCI) technology to instrument the files. During instrumentation, PureCoverage inserts additional code to identify the parts of your code that are executed when you test the program. When you instrument in inclusive mode (the default), PureCoverage stores all instrumented files in its cache directory. You can identify a cached file by its name: it contains the encoded path of the original file and other information used by PureCoverage.
You can instrument and run native (unmanaged) code programs:
§ from Visual Studio monitor native-compiled programs by using the Run Program dialog box instead of engaging the integration.
§ from the PureCoverage standalone interface.
§ from the command line.
With PureCoverage's PowerCov options (click Settings in the Run Program dialog box), you can choose whether to monitor the coverage of modules at line level or function level, or to exclude modules. You can also selectively instrument and monitor native-compiled (unmanaged) modules.
PureCoverage uses debug line information to collect line-by-line coverage data. If debug data is not available for a module, PureCoverage excludes the 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.
Debug symbol data must be available for PureCoverage to identify a function. If debug symbol data is not available for a function, PureCoverage labels the function UnnamedFunction@<offset>.
Use PureCoverage's windows and tools to analyze program coverage. For example, while a program is running, you can monitor the status of its coverage, or pause and resume data recording. After you exit the program, you can filter out non-critical functions.
Notes:
§ Operations that relate to cache directories and instrumented files apply only to runs of native-compiled (unmanaged) programs.
§ If you're using Visual Studio, you can build a release or debug version of your program that contains relocation data by specifying the /fixed:no and /incremental:no linker options. For more information on the recommended settings for Visual Studio .NET, Visual Studio 2005 and Visual Studio 2008, click . For those for Visual Studio 6, click
.
(C) Copyright IBM Corporation 1993, 2010.