From: Peter O. <obe...@us...> - 2012-07-11 14:09:30
|
Update of /cvsroot/ltp/utils/analysis/lcov/bin In directory vz-cvs-4.sog:/tmp/cvs-serv3493 Modified Files: geninfo lcov Log Message: geninfo: more improvements to the .gcno format auto-detection Suggestions by ga...@go...: - rename command line setting - simplify logic Index: geninfo =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/geninfo,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** geninfo 6 Jul 2012 14:29:27 -0000 1.100 --- geninfo 11 Jul 2012 14:09:27 -0000 1.101 *************** *** 104,108 **** our $COMPAT_MODE_LIBTOOL = 1 << 0; our $COMPAT_MODE_HAMMER = 1 << 1; ! our $COMPAT_MODE_GCC_4_7 = 1 << 2; # Compatibility mode names --- 104,108 ---- our $COMPAT_MODE_LIBTOOL = 1 << 0; our $COMPAT_MODE_HAMMER = 1 << 1; ! our $COMPAT_MODE_SPLIT_CRC = 1 << 2; # Compatibility mode names *************** *** 110,122 **** "libtool" => $COMPAT_MODE_LIBTOOL, "hammer" => $COMPAT_MODE_HAMMER, ! "gcc_4_7" => $COMPAT_MODE_GCC_4_7, ! "android_4_4_0" => $COMPAT_MODE_GCC_4_7, ); # Map modes to names our %COMPAT_MODE_TO_NAME = ( ! $COMPAT_MODE_LIBTOOL => "libtool", ! $COMPAT_MODE_HAMMER => "hammer", ! $COMPAT_MODE_GCC_4_7 => "gcc_4_7", ); --- 110,122 ---- "libtool" => $COMPAT_MODE_LIBTOOL, "hammer" => $COMPAT_MODE_HAMMER, ! "split_crc" => $COMPAT_MODE_SPLIT_CRC, ! "android_4_4_0" => $COMPAT_MODE_SPLIT_CRC, ); # Map modes to names our %COMPAT_MODE_TO_NAME = ( ! $COMPAT_MODE_LIBTOOL => "libtool", ! $COMPAT_MODE_HAMMER => "hammer", ! $COMPAT_MODE_SPLIT_CRC => "split_crc", ); *************** *** 125,129 **** $COMPAT_MODE_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_MODE_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_MODE_GCC_4_7 => $COMPAT_VALUE_AUTO, ); --- 125,129 ---- $COMPAT_MODE_LIBTOOL => $COMPAT_VALUE_ON, $COMPAT_MODE_HAMMER => $COMPAT_VALUE_OFF, ! $COMPAT_MODE_SPLIT_CRC => $COMPAT_VALUE_AUTO, ); *************** *** 132,136 **** our %COMPAT_MODE_AUTO = ( $COMPAT_MODE_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_MODE_GCC_4_7 => 1, # will be done later ); --- 132,136 ---- our %COMPAT_MODE_AUTO = ( $COMPAT_MODE_HAMMER => \&compat_hammer_autodetect, ! $COMPAT_MODE_SPLIT_CRC => 1, # will be done later ); *************** *** 188,191 **** --- 188,192 ---- sub read_gcno_string(*$); sub read_gcno_lines_record(*$$$$$$$); + sub determine_gcno_split_crc($$$); sub read_gcno_function_record(*$$$$$); sub read_gcno($$); *************** *** 241,245 **** our $opt_compat; our %compat_value; ! our $gcno_fmt_4_7; our $cwd = `pwd`; --- 242,246 ---- our $opt_compat; our %compat_value; ! our $gcno_split_crc; our $cwd = `pwd`; *************** *** 548,552 **** --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url --- 549,553 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, split_crc) For more information see: $lcov_url *************** *** 3038,3049 **** # ! # determine_gcno_fmt(handle, big_endian, rec_length) # ! # Determine if HANDLE refers to a .gcno file with a gcc 4.7 format function ! # record. Return non-zero in case of gcc 4.7 format, zero otherwise, ! # undef in case of read error. # ! sub determine_gcno_fmt($$$) { my ($handle, $big_endian, $rec_length) = @_; --- 3039,3050 ---- # ! # determine_gcno_split_crc(handle, big_endian, rec_length) # ! # 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($$$) { my ($handle, $big_endian, $rec_length) = @_; *************** *** 3052,3056 **** return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_MODE_GCC_4_7)); # Heuristic: --- 3053,3057 ---- return 1 if ($gcov_version >= $GCOV_VERSION_4_7_0); ! return 1 if (is_compat($COMPAT_MODE_SPLIT_CRC)); # Heuristic: *************** *** 3066,3083 **** $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if (!is_compat_auto($COMPAT_MODE_GCC_4_7)) { ! # Sanity check ! if ($overlong_string) { warn("Found overlong string in function record: ". ! "try --compat gcc_4_7\n"); } - return 0; - } elsif (!$overlong_string) { - return 0; } ! info("Auto-detected compatibility mode for GCC 4.7\n"); ! ! return 1; } --- 3067,3084 ---- $overlong_string = 1 if ($strlen * 4 >= $rec_length - 12); ! if ($overlong_string) { ! if (is_compat_auto($COMPAT_MODE_SPLIT_CRC)) { ! info("Auto-detected compatibility mode for split ". ! "checksum .gcno file format\n"); ! ! return 1; ! } else { ! # Sanity check warn("Found overlong string in function record: ". ! "try '--compat split_crc'\n"); } } ! return 0; } *************** *** 3100,3111 **** # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! # Determine if this is a gcc 4.7 format function record ! if (!defined($gcno_fmt_4_7)) { ! $gcno_fmt_4_7 = determine_gcno_fmt($handle, $big_endian, ! $rec_length); ! return undef if (!defined($gcno_fmt_4_7)); } ! # Skip cfg checksum word in case of gcc 4.7 format function record ! graph_skip($handle, 4, "function cfg checksum") if ($gcno_fmt_4_7); # Read function name graph_expect("function name"); --- 3101,3112 ---- # Skip ident and checksum graph_skip($handle, 8, "function ident and checksum") or return undef; ! # 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); ! return undef if (!defined($gcno_split_crc)); } ! # Skip cfg checksum word in case of split checksums ! graph_skip($handle, 4, "function cfg checksum") if ($gcno_split_crc); # Read function name graph_expect("function name"); Index: lcov =================================================================== RCS file: /cvsroot/ltp/utils/analysis/lcov/bin/lcov,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** lcov 6 Jul 2012 09:03:27 -0000 1.82 --- lcov 11 Jul 2012 14:09:27 -0000 1.83 *************** *** 525,529 **** --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, gcc_4_7) For more information see: $lcov_url --- 525,529 ---- --(no-)external Include (ignore) data for external files --config-file FILENAME Specify configuration file location ! --compat MODE=on|off|auto Set compat MODE (libtool, hammer, split_crc) For more information see: $lcov_url |