Update of /cvsroot/ltp/utils/analysis/lcov/bin
In directory vz-cvs-4.sog:/tmp/cvs-serv28557
Modified Files:
geninfo
Log Message:
geninfo: fix processing of pre-3.3 gcov files
When trying to collect coverage data for programs compiled with
GCC versions prior to 3.3, geninfo skips each data file with the
following warning:
geninfo: WARNING: cannot find an entry for test.c.gcov in .bb file,
skipping file!
Fix this by deriving the source code filename from the gcov filename
in case the gcov files do not follow the GCC 3.3 format.
Reported-by: geo...@gm...
Index: geninfo
===================================================================
RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** geninfo 24 Aug 2012 11:43:18 -0000 1.106
--- geninfo 2 Oct 2012 09:12:38 -0000 1.107
***************
*** 1058,1070 ****
($source, $object) = read_gcov_header($gcov_file);
! if (defined($source))
! {
! $source = solve_relative_path($base_dir, $source);
}
# gcov will happily create output even if there's no source code
# available - this interferes with checksum creation so we need
# to pull the emergency brake here.
! if (defined($source) && ! -r $source && $checksum)
{
if ($ignore[$ERROR_SOURCE])
--- 1058,1074 ----
($source, $object) = read_gcov_header($gcov_file);
! if (!defined($source)) {
! # Derive source file name from gcov file name if
! # header format could not be parsed
! $source = $gcov_file;
! $source =~ s/\.gcov$//;
}
+ $source = solve_relative_path($base_dir, $source);
+
# gcov will happily create output even if there's no source code
# available - this interferes with checksum creation so we need
# to pull the emergency brake here.
! if (! -r $source && $checksum)
{
if ($ignore[$ERROR_SOURCE])
***************
*** 1077,1082 ****
}
! @matches = match_filename(defined($source) ? $source :
! $gcov_file, keys(%{$instr}));
# Skip files that are not mentioned in the graph file
--- 1081,1085 ----
}
! @matches = match_filename($source, keys(%{$instr}));
# Skip files that are not mentioned in the graph file
|