How to Collect Code Coverage Data From the Binary
Before You Begin
instrument your program with uncover to collect data for
use by Code Analyzer, you must have compiled the program with Oracle Solaris Studio
version 12.3 or 12.4 C or C++ compiler. Compiling with the –g
option generates debug information that allows Code Analyzer to use source
code level coverage information.
If you saved a copy of the binary when you compiled your program for instrumenting
, 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
Instrument the binary with Uncover:
% uncover binary-name
Run the instrumented binary one or more times.
The code coverage data is written to a
Generate the code coverage report from the accumulated data using Uncover with the
% uncover -a binary-name.uc
The coverage report is written to the coverage subdirectory in the
You must use the version of uncover in Oracle Solaris Studio
version 12.3 or 12.4. The –a option is not available in earlier
versions of uncover.