Subject: | gcov2perl counts wrong for big numbers (PATCH) |
For big values in .gcov files the parsing in gcov2perl fails. In
consequence the resulting numbers are wrong. An example (the same line
from different incarnations of the same include, gcov has been used with
the option --long-file-names):
136656: 97: for(;
43417: 97: for(;
1562941571: 97: for(;
68130: 97: for(;
1238852: 97: for(;
Currently gcov2perl uses the last 9 characters before the first colon.
For lines with 10 or more digits this drops the leading digits. A
simple patch to solve this problem is attached.
Subject: | gcov2perl-0.64-3.patch |
--- gcov2perl.org 2008-04-10 13:57:39.000000000 +0200
+++ gcov2perl.new 2009-04-14 14:15:24.199799000 +0200
@@ -58,8 +58,7 @@
open F, $file or die "Can't open $file: $!\n";
while (<F>)
{
- next unless my ($count, $line) = /(.{9}):\s*(\d+):/;
- $count =~ s/\s+//g;
+ next unless my ($count, $line) = /^\s*([-0-9#]+):\s*(\d+):/;
next if $count eq "-";
$count = 0 if $count eq "#####";