Introduction
bcov
produces coverage information without recompiling a program
by instrumenting it with breakpoints. Effectively it debugs the
program automatically, removing each breakpoint after it has been
hit. This produces detailed coverage information with minimal
runtime overhead.
Example:
Usage:
Executes the binary with the given arguments and stores the coverage summary in
bcov
executable [arguments]
.bcovdump
. The result file is more or less
human readable (and easily machine readable), a nicer presentation
can be generated with bcov-report
:Converts the coverage dump into an lcov-style html report. If not output directory is given
bcov-report
[dumpfile] [output directory]
bcov-report
uses a temporary directory
and tries to open the result in the standard browser.bcov
Requirements:
bcov
requires libdwarf to read
debug info. Note you need a fairly recent one, older libdwarf releases are buggy concerning new gcc output.
Using an old libdwarf will crash the profiled program!.
If the version in your distro is too old (quite likely), do the following:
libdwarf.h
and libdwarf.a
to a directory somewherebcov
with ./configure --with-libdwarf=
path/libdwarf
Download: