summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Machata <[email protected]>2011-03-10 16:03:18 +0100
committerPetr Machata <[email protected]>2011-03-10 16:03:18 +0100
commitc1dfae6e870eec0bf83aa5edc0343d2d72f0585c (patch)
tree314b07fdac651c6b1e5bbe07d56ee25869ab69ea
parentfef55ed3b49c1d1b632685e4079ca7caac759dc9 (diff)
dwarflint: Fix "die chain not terminated by a null entry" for CU DIE
- CU DIE is not part of DIE chain, it's a singleton (with optional null entries following it as padding) - consequently, don't emit this message for CU DIE, and change it to full error for all other cases
-rw-r--r--dwarflint/check_debug_info.cc10
-rwxr-xr-xdwarflint/tests/run-aranges_terminate_early.sh2
-rwxr-xr-xdwarflint/tests/run-bad.sh5
-rwxr-xr-xdwarflint/tests/run-check_debug_info_refs.sh4
4 files changed, 11 insertions, 10 deletions
diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc
index 4a1128cf..b7e801d6 100644
--- a/dwarflint/check_debug_info.cc
+++ b/dwarflint/check_debug_info.cc
@@ -967,10 +967,12 @@ namespace
if (read_ctx_eof (ctx))
{
- // DWARF 4 Ch. 2.3: A chain of sibling entries is
- // terminated by a null entry.
- wr_message (where, cat (mc_impact_1, mc_info))
- << "DIE chain not terminated with null entry." << std::endl;
+ if (level > 0)
+ // DWARF 4 Ch. 2.3: A chain of sibling entries is
+ // terminated by a null entry. N.B. the CU DIE is a
+ // singleton, not part of a DIE chain.
+ wr_error (where)
+ << "DIE chain not terminated with null entry." << std::endl;
break;
}
}
diff --git a/dwarflint/tests/run-aranges_terminate_early.sh b/dwarflint/tests/run-aranges_terminate_early.sh
index 36ed8a14..9519f12e 100755
--- a/dwarflint/tests/run-aranges_terminate_early.sh
+++ b/dwarflint/tests/run-aranges_terminate_early.sh
@@ -32,13 +32,11 @@ srcdir=$srcdir/tests
testfiles aranges_terminate_early
testrun_compare ./dwarflint --strict aranges_terminate_early <<EOF
-warning: .debug_info: DIE 0xb (abbreviation 0): DIE chain not terminated with null entry.
warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes.
warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CUs, but not with aranges.
EOF
testrun_compare ./dwarflint --check=check_debug_aranges --strict aranges_terminate_early <<EOF
-warning: .debug_info: DIE 0xb (abbreviation 0): DIE chain not terminated with null entry.
warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes.
warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CUs, but not with aranges.
EOF
diff --git a/dwarflint/tests/run-bad.sh b/dwarflint/tests/run-bad.sh
index 3803336a..919e098e 100755
--- a/dwarflint/tests/run-bad.sh
+++ b/dwarflint/tests/run-bad.sh
@@ -57,6 +57,7 @@ EOF
testrun_compare ./dwarflint garbage-2 <<EOF
error: .debug_info: CU 0: toplevel DIE must be either compile_unit or partial_unit.
+error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
EOF
testrun_compare ./dwarflint --check=@low garbage-3 <<EOF
@@ -65,9 +66,11 @@ EOF
testrun_compare ./dwarflint garbage-4 <<EOF
error: .debug_info: DIE 0x6c: this DIE claims that its sibling is 0x80000085 but it's actually 0x85.
+error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
EOF
testrun_compare ./dwarflint garbage-5 <<EOF
+error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
error: .debug_line: offset 0x3e: not enough data to read an opcode of length 5.
error: .debug_info: DIE 0xb (abbr. attribute 0xc): unresolved reference to .debug_line table 0x0.
EOF
@@ -88,9 +91,11 @@ EOF
testrun_compare ./dwarflint garbage-8 <<EOF
error: .debug_info: DIE 0x6c (abbr. attribute 0x43): DW_AT_sibling with a value of 0.
+error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
EOF
testrun_compare ./dwarflint garbage-9 <<EOF
error: .debug_info: DIE 0x84 (abbr. attribute 0x5f): invalid reference outside the CU: 0xef00ab.
error: .debug_info: DIE 0x6c: is the last sibling in chain, but has a DW_AT_sibling attribute.
+error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
EOF
diff --git a/dwarflint/tests/run-check_debug_info_refs.sh b/dwarflint/tests/run-check_debug_info_refs.sh
index 604f4441..7b36243f 100755
--- a/dwarflint/tests/run-check_debug_info_refs.sh
+++ b/dwarflint/tests/run-check_debug_info_refs.sh
@@ -34,14 +34,10 @@ error: .debug_aranges: table 48 (CU DIE 95): there has already been arange secti
EOF
testrun_compare ./dwarflint --strict --check=check_debug_info_refs check_debug_info_refs-1 <<EOF
-warning: .debug_info: DIE 0xb (abbreviation 0): DIE chain not terminated with null entry.
-warning: .debug_info: DIE 0x5f (abbreviation 54): DIE chain not terminated with null entry.
error: .debug_aranges: table 48 (CU DIE 95): there has already been arange section for this CU.
warning: .debug_info: CU 0: no aranges table is associated with this CU.
EOF
testrun_compare ./dwarflint --strict --check=check_debug_info_refs check_debug_info_refs-2 <<EOF
-warning: .debug_info: DIE 0xb (abbreviation 0): DIE chain not terminated with null entry.
-warning: .debug_info: DIE 0x54 (abbreviation 48): DIE chain not terminated with null entry.
warning: .debug_info: CU 0: no aranges table is associated with this CU.
EOF