|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3 Code Analyzer User's Guide Oracle Solaris Studio 12.3 Information Library|
Collecting code coverage data on your C or C++ program is a three-step process: instrumenting the binary with Uncover, running the instrumented binary, and then running Uncover again to generate a coverage report for use by the Code Analyzer.
You can run the instrumented binary multiple times after instrumenting it, and accumulate data over all of the runs before generating the coverage report
To instrument your program with Uncover to collect data for use by the Code Analyzer, you must have compiled the program with the Oracle Solaris Studio 12.3 C or C++ compiler. Compiling with the -g option generates debug information that allows the Code Analyzer to use source code level coverage information.
Note - If you saved a copy of the binary when you compiled your program for instrumenting with Discover, you can rename the copy to the original binary name and use it for instrumenting with Uncover. For example:
cp a.out.save a.out
To collect code coverage data from the binary:
Run the instrumented binary one or more times. The code coverage data is written to a binary_name.uc directory.
Generate the code coverage report from the accumulated data using Uncover with the -a option:
uncover -a binary_name.uc
Note - You must use the version of Uncover in Oracle Solaris Studio 12.3. The -a option is not available in earlier versions of Uncover.