Skip to content

Commit 2d450cd

Browse files
committed
Better category for DB format error messages.
Signed-off-by: Henry Cox <[email protected]>
1 parent c1b16a6 commit 2d450cd

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

bin/geninfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ sub intermediate_json_to_info($)
25922592
if (!defined($line) || !defined($count));
25932593

25942594
if ($line <= 0) {
2595-
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
2595+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
25962596
'"' . $fileData->filename() .
25972597
"\":: unexpected line number '$line' in gcov record"
25982598
);

lib/lcovutil.pm

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8362,8 +8362,7 @@ sub _read_info
83628362
/^DA:(\d+),([^,]+)(,([^,\s]+))?/ && do {
83638363
my ($line, $count, $checksum) = ($1, $2, $4);
83648364
if ($line <= 0) {
8365-
lcovutil::ignorable_error(
8366-
$lcovutil::ERROR_INCONSISTENT_DATA,
8365+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
83678366
"\"$tracefile\":$.: unexpected line number '$line' in .info file record '$_'"
83688367
);
83698368
last;
@@ -8427,12 +8426,10 @@ sub _read_info
84278426
my $end_line = $3;
84288427
if ($lineNo <= 0 ||
84298428
(defined($end_line) && $end_line <= 0)) {
8430-
lcovutil::ignorable_error(
8431-
$lcovutil::ERROR_INCONSISTENT_DATA,
8429+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
84328430
"\"$tracefile\":$.: unexpected function line '$lineNo' in .info file record '$_'"
84338431
) if $lineNo <= 0;
8434-
lcovutil::ignorable_error(
8435-
$lcovutil::ERROR_INCONSISTENT_DATA,
8432+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
84368433
"\"$tracefile\":$.: unexpected function end line '$end_line' in .info file record '$_'"
84378434
) if defined($end_line) && $end_line <= 0;
84388435

@@ -8505,8 +8502,7 @@ sub _read_info
85058502
# - if we wrote one from geninfo, then we will not have
85068503
# produced bogus data - so no need to check.
85078504
# - only some (broken) external tool could have the issue
8508-
lcovutil::ignorable_error(
8509-
$lcovutil::ERROR_INCONSISTENT_DATA,
8505+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
85108506
"\"$tracefile\":$.: unexpected line number '$line' in .info file record '$_'"
85118507
);
85128508
last;
@@ -8562,8 +8558,7 @@ sub _read_info
85628558
my ($line, $groupSize, $sense, $count, $idx, $expr) =
85638559
($1, $2, $3, $4, $5, $6);
85648560
if ($line <= 0) {
8565-
lcovutil::ignorable_error(
8566-
$lcovutil::ERROR_INCONSISTENT_DATA,
8561+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
85678562
"\"$tracefile\":$.: unexpected line number '$line' in condition data record record '$_'"
85688563
);
85698564
last;
@@ -8754,8 +8749,7 @@ sub write_info($$$)
87548749

87558750
if ($line <= 0) {
87568751
my $alias = (sort keys %$aliases)[0];
8757-
lcovutil::ignorable_error(
8758-
$lcovutil::ERROR_INCONSISTENT_DATA,
8752+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
87598753
"\"$source_file\": unexpected line number '$line' for function $alias"
87608754
);
87618755
next;
@@ -8790,8 +8784,7 @@ sub write_info($$$)
87908784
foreach my $line (sort({ $a <=> $b } $testbrcount->keylist())) {
87918785

87928786
if ($line <= 0) {
8793-
lcovutil::ignorable_error(
8794-
$lcovutil::ERROR_INCONSISTENT_DATA,
8787+
lcovutil::ignorable_error($lcovutil::ERROR_FORMAT,
87958788
"\"$source_file\": unexpected line number '$line' in branch data record record '$_'"
87968789
);
87978790
last;

man/genhtml.1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,7 +2873,9 @@ If you see continued errors, either turn off or reduce parallelism, set a memory
28732873
.PP
28742874

28752875
.IP format: 3
2876-
Unexpected syntax found in .info file.
2876+
Unexpected syntax or value found in .info file - for example, negative number or
2877+
zero line number encountered.
2878+
28772879
.PP
28782880

28792881
.IP inconsistent: 3
@@ -2930,11 +2932,7 @@ function alias record (
29302932
.PP
29312933
.IP \- 3
29322934
branch expression (3rd field in the .info file 'BRDA' entry) of merge data does not match
2933-
.PP
29342935

2935-
.PP
2936-
.IP \- 3
2937-
Negative number or zero line number encounted.
29382936
.br
29392937
If the error is ignored, the offending record is skipped.
29402938
.RE

man/geninfo.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,8 @@ If you see continued errors, either turn off or reduce parallelism, set a memory
902902
.PP
903903

904904
.IP format: 3
905-
unexpected syntax found in .info file.
905+
Unexpected syntax or value found in .info file - for example, negative number or
906+
zero line number encountered.
906907
.PP
907908

908909
.IP gcov: 3

man/lcov.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,8 @@ If you see continued errors, either turn off or reduce parallelism, set a memory
13171317
.PP
13181318

13191319
.IP format: 3
1320-
unexpected syntax found in .info file.
1320+
Unexpected syntax or value found in .info file - for example, negative number or
1321+
zero line number encountered.
13211322
.PP
13221323

13231324
.IP gcov: 3

tests/lcov/errs/errs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ for f in badFncLine badFncEndLine fncMismatch badBranchLine badLine ; do
136136
fi
137137
138138
echo lcov $LCOV_OPTS --summary $f.info --ignore inconsistent
139-
$COVER $LCOV_TOOL $LCOV_OPTS --summary $f.info --ignore inconsistent 2>&1 | tee ${f}2.log
139+
$COVER $LCOV_TOOL $LCOV_OPTS --summary $f.info --ignore format,inconsistent 2>&1 | tee ${f}2.log
140140
if [ 0 != ${PIPESTATUS[0]} ] ; then
141141
echo "failed to ignore message ${f}2.log"
142142
status=1

0 commit comments

Comments
 (0)