From: Peter O. <obe...@us...> - 2010-02-28 20:57:46
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4520 Modified Files: geninfo Log Message: lcov: fix problem with relative paths in build paths When binaries are built using relative paths, lcov cannot find any coverage data. Instead, warnings similar to the following are printed: geninfo: WARNING: cannot find an entry for ^#src#test.c.gcov in .gcno file, skipping file! The reason for this is that File::Spec::rel2abs does not remove ../ from paths which results in lcov not being able to match the relative and absolute versions of the corresponding filenames. Fix this by using the internal function solve_relative_path instead. Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** geninfo 21 Feb 2010 14:57:52 -0000 1.73 --- geninfo 28 Feb 2010 20:57:37 -0000 1.74 *************** *** 53,57 **** use File::Basename; use File::Spec::Functions qw /abs2rel catdir file_name_is_absolute splitdir ! splitpath rel2abs/; use Getopt::Long; use Digest::MD5 qw(md5_base64); --- 53,57 ---- use File::Basename; use File::Spec::Functions qw /abs2rel catdir file_name_is_absolute splitdir ! splitpath/; use Getopt::Long; use Digest::MD5 qw(md5_base64); *************** *** 2443,2447 **** goto incomplete if (!defined($filename)); if ($filename ne "") { ! $filename = rel2abs($filename, $base); } } elsif ($value == $minus_two) { --- 2443,2448 ---- goto incomplete if (!defined($filename)); if ($filename ne "") { ! $filename = solve_relative_path($base, ! $filename); } } elsif ($value == $minus_two) { *************** *** 2564,2568 **** return $filename; } ! $filename = rel2abs($string, $base); next; } --- 2565,2569 ---- return $filename; } ! $filename = solve_relative_path($base, $string); next; } *************** *** 2758,2762 **** return $filename; } ! $filename = rel2abs($string, $base); next; } --- 2759,2763 ---- return $filename; } ! $filename = solve_relative_path($base, $string); next; } *************** *** 2799,2803 **** $filename = read_gcno_string($handle, $big_endian); return undef if (!defined($filename)); ! $filename = rel2abs($filename, $base); # Read first line number $lineno = read_gcno_value($handle, $big_endian, "initial line number"); --- 2800,2804 ---- $filename = read_gcno_string($handle, $big_endian); return undef if (!defined($filename)); ! $filename = solve_relative_path($base, $filename); # Read first line number $lineno = read_gcno_value($handle, $big_endian, "initial line number"); |