Skip to content

Commit

Permalink
Explicitly bump lcov to 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
jonreid committed Sep 25, 2017
1 parent 7eb5fe7 commit 68f6d6e
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 20 deletions.
2 changes: 1 addition & 1 deletion envcov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
scripts="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${scripts}/env.sh"

LCOV_PATH="${scripts}/lcov-1.12/bin"
LCOV_PATH="${scripts}/lcov-1.13/bin"
OBJ_DIR="${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}"

# Fix for the new LLVM-COV that requires gcov to have a -v parameter
Expand Down
3 changes: 3 additions & 0 deletions lcov-1.13/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VERSION=1.13
RELEASE=1
FULL=1.13
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lcov-1.12/bin/gendesc → lcov-1.13/bin/gendesc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use Cwd qw/abs_path/;

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_version = "LCOV version 1.13";
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
2 changes: 1 addition & 1 deletion lcov-1.12/bin/genhtml → lcov-1.13/bin/genhtml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use Cwd qw/abs_path/;
# Global constants
our $title = "LCOV - code coverage report";
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_version = "LCOV version 1.13";
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
63 changes: 49 additions & 14 deletions lcov-1.12/bin/geninfo → lcov-1.13/bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if( $^O eq "msys" )

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_version = "LCOV version 1.13";
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $gcov_tool = "gcov";
our $tool_name = basename($0);
Expand Down Expand Up @@ -196,8 +196,8 @@ sub read_gcno_word(*;$$);
sub read_gcno_value(*$;$$);
sub read_gcno_string(*$);
sub read_gcno_lines_record(*$$$$$$);
sub determine_gcno_split_crc($$$);
sub read_gcno_function_record(*$$$$);
sub determine_gcno_split_crc($$$$);
sub read_gcno_function_record(*$$$$$);
sub read_gcno($);
sub get_gcov_capabilities();
sub get_overall_line($$$$);
Expand Down Expand Up @@ -419,6 +419,8 @@ else

@data_directory = @ARGV;

debug("$lcov_version\n");

# Check for help option
if ($help)
{
Expand Down Expand Up @@ -3363,20 +3365,20 @@ sub read_gcno_lines_record(*$$$$$$)
}

#
# determine_gcno_split_crc(handle, big_endian, rec_length)
# determine_gcno_split_crc(handle, big_endian, rec_length, version)
#
# Determine if HANDLE refers to a .gcno file with a split checksum function
# record format. Return non-zero in case of split checksum format, zero
# otherwise, undef in case of read error.
#

sub determine_gcno_split_crc($$$)
sub determine_gcno_split_crc($$$$)
{
my ($handle, $big_endian, $rec_length) = @_;
my ($handle, $big_endian, $rec_length, $version) = @_;
my $strlen;
my $overlong_string;

return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0);
return 1 if ($version >= $GCOV_VERSION_4_7_0);
return 1 if (is_compat($COMPAT_MODE_SPLIT_CRC));

# Heuristic:
Expand Down Expand Up @@ -3408,15 +3410,15 @@ sub determine_gcno_split_crc($$$)
}

#
# read_gcno_function_record(handle, graph, big_endian, rec_length)
# read_gcno_function_record(handle, graph, big_endian, rec_length, version)
#
# Read a gcno format function record from handle and add the relevant data
# to graph. Return (filename, function) on success, undef on error.
#

sub read_gcno_function_record(*$$$$)
sub read_gcno_function_record(*$$$$$)
{
my ($handle, $bb, $fileorder, $big_endian, $rec_length) = @_;
my ($handle, $bb, $fileorder, $big_endian, $rec_length, $version) = @_;
my $filename;
my $function;
my $lineno;
Expand All @@ -3428,7 +3430,8 @@ sub read_gcno_function_record(*$$$$)
# Determine if this is a function record with split checksums
if (!defined($gcno_split_crc)) {
$gcno_split_crc = determine_gcno_split_crc($handle, $big_endian,
$rec_length);
$rec_length,
$version);
return undef if (!defined($gcno_split_crc));
}
# Skip cfg checksum word in case of split checksums
Expand All @@ -3451,6 +3454,33 @@ sub read_gcno_function_record(*$$$$)
return ($filename, $function);
}

#
# map_gcno_version
#
# Map version number as found in .gcno files to the format used in geninfo.
#

sub map_gcno_version($)
{
my ($version) = @_;
my ($a, $b, $c);
my ($major, $minor);

$a = $version >> 24;
$b = $version >> 16 & 0xff;
$c = $version >> 8 & 0xff;

if ($a < ord('A')) {
$major = $a - ord('0');
$minor = ($b - ord('0')) * 10 + $c - ord('0');
} else {
$major = ($a - ord('A')) * 10 + $b - ord('0');
$minor = $c - ord('0');
}

return $major << 16 | $minor << 8;
}

#
# read_gcno(filename)
#
Expand Down Expand Up @@ -3481,6 +3511,7 @@ sub read_gcno($)
my $instr;
my $graph;
my $filelength;
my $version;
local *HANDLE;

open(HANDLE, "<", $gcno_filename) or goto open_error;
Expand All @@ -3497,8 +3528,12 @@ sub read_gcno($)
} else {
goto magic_error;
}
# Skip version and stamp
graph_skip(*HANDLE, 8, "version and stamp") or goto incomplete;
# Read version
$version = read_gcno_value(*HANDLE, $big_endian, "compiler version");
$version = map_gcno_version($version);
debug(sprintf("found version 0x%08x\n", $version));
# Skip stamp
graph_skip(*HANDLE, 4, "file timestamp") or goto incomplete;
while (!eof(HANDLE)) {
my $next_pos;
my $curr_pos;
Expand Down Expand Up @@ -3528,7 +3563,7 @@ sub read_gcno($)
if ($tag == $tag_function) {
($filename, $function) = read_gcno_function_record(
*HANDLE, $bb, $fileorder, $big_endian,
$length);
$length, $version);
goto incomplete if (!defined($function));
} elsif ($tag == $tag_lines) {
# Read lines record
Expand Down
2 changes: 1 addition & 1 deletion lcov-1.12/bin/genpng → lcov-1.13/bin/genpng
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use Cwd qw/abs_path/;

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_version = "LCOV version 1.13";
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion lcov-1.12/bin/install.sh → lcov-1.13/bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ do_install()
local TARGET=$2
local PARAMS=$3

install -p -D $PARAMS $SOURCE $TARGET
install -d $(dirname $TARGET)
install -p $PARAMS $SOURCE $TARGET
}


Expand Down
2 changes: 1 addition & 1 deletion lcov-1.12/bin/lcov → lcov-1.13/bin/lcov
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use Cwd qw /abs_path getcwd/;

# Global constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_version = "LCOV version 1.13";
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
File renamed without changes.

0 comments on commit 68f6d6e

Please sign in to comment.