]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Fix "die chain not terminated by a null entry" for CU DIE
authorPetr Machata <pmachata@redhat.com>
Thu, 10 Mar 2011 15:03:18 +0000 (16:03 +0100)
committerPetr Machata <pmachata@redhat.com>
Thu, 10 Mar 2011 15:03:18 +0000 (16:03 +0100)
- 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

dwarflint/check_debug_info.cc
dwarflint/tests/run-aranges_terminate_early.sh
dwarflint/tests/run-bad.sh
dwarflint/tests/run-check_debug_info_refs.sh

index 4a1128cf22e1cfb50a2fa3d7f20f88861cf3c943..b7e801d6a842d9f58032b5b01f7507f14be4933b 100644 (file)
@@ -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;
          }
       }
index 36ed8a141faa332c78f906d96b35d9c36f72e57b..9519f12e12e6aa474a017c86e0d4b6ea7c29c47d 100755 (executable)
@@ -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
index 3803336a77199cd5b2975d7acdbe5320a225289d..919e098edb6ee533b61923e57b26101809249adf 100755 (executable)
@@ -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
index 604f44415ea02d035bd449e35963a47985d1cbb9..7b36243fa70be3df4bf454c82838e053d82ab7d5 100755 (executable)
@@ -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