On Tue, Jul 28, 2009 at 3:25 PM, He fei<[email protected]> wrote:
> I've been able to tried out Covergrind, with Valgrind version 3.2.1. There's
> a guy asked about this
> before: http://www.nabble.com/code-coverage-with-Valgrind-%2B-Covergrind-td15308871.html.
> It turned out that though the output of Covergrind is similar to Callgrind,
> but rather at line level:
> fl=(10) /program-path
> ...
> fn=10
> fl=(10)
> 52 1
> 53 1
> ...
> As above, each line that has been "touched" will be maked at 1 (and the
> number can only be 1).
> I've written a little test program and result is quite inspiring. So I think
> the only thing I need to do now is to write a script
> to count the total line within a program (better to remove #include file
> lines and comment lines). And then compare the count with the sum that can
> be calculated based on the above output.
> Am I right about this?
No. The tricky part is knowing which source code lines are executable
and which are not. Just removing #include lines and comment lines
isn't enough. Eg, in this snippet:
if (c) {
foo;
} else {
bar;
}
lines 1, 2 and 4 are executable. Ultimately, only the compiler knows
which lines are executable. VCov uses the debug info to get that
knowledge from the compiler.
Furthermore, I updated VCov a little this morning and fixed a bug and
it seems to be basically working. I suggest you try it.
Nick
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users