]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Also cover DW_AT_low_pc == DW_AT_high_pc (if that is > 0)
authorPetr Machata <pmachata@redhat.com>
Fri, 18 Mar 2011 00:21:12 +0000 (01:21 +0100)
committerPetr Machata <pmachata@redhat.com>
Fri, 18 Mar 2011 00:21:12 +0000 (01:21 +0100)
dwarflint/check_debug_info.cc
dwarflint/tests/run-check_debug_info_refs.sh
dwarflint/tests/run-check_duplicate_DW_tag_variable.sh
dwarflint/tests/run-libdl-2.12.so.debug.sh

index 6bff11bf0eb5442acabe2f9826e1bce9944664fc..e01b4c9c1011b341706fd3b2f966a390905f1bb1 100644 (file)
@@ -965,7 +965,9 @@ namespace
                                           &file,
                                           low_pc_symbol, high_pc_symbol,
                                           "DW_AT_low_pc and DW_AT_high_pc");
-               if (low_pc > high_pc)
+               /* If there is no coverage, these attributes should
+                  not ever be there.  */
+               if (low_pc > high_pc || (low_pc == high_pc && low_pc > 0))
                  wr_message (where, mc_die_other | mc_impact_3)
                    << "DW_AT_low_pc value not below DW_AT_high_pc."
                    << std::endl;
index 74288261ccfd5591cc2bec265533eeb98bf6041e..88961a9d547adf8cff6f9eaf096d333aab70676a 100755 (executable)
@@ -40,5 +40,6 @@ warning: .debug_info: CU 0: no aranges table is associated with this CU.
 EOF
 
 testrun_compare ./dwarflint --check=check_debug_info_refs check_debug_info_refs-2 <<EOF
+warning: .debug_info: DIE 0xb: DW_AT_low_pc value not below DW_AT_high_pc.
 warning: .debug_info: CU 0: no aranges table is associated with this CU.
 EOF
index 3687a18eb8591ed818556f14844445b0fb53bf23..9b22daf500372c604fac573b9bb608e4a9c66f1d 100755 (executable)
@@ -30,6 +30,7 @@ srcdir=$srcdir/tests
 testfiles crc7.ko.debug
 
 testrun_compare ./dwarflint --check check_duplicate_DW_tag_variable crc7.ko.debug <<EOF
+warning: .debug_info: DIE 0x40f1: DW_AT_low_pc value not below DW_AT_high_pc.
 warning: .debug_info: CU 16614: no aranges table is associated with this CU.
 error: .debug_info: DIE 0x3d21: Redeclaration of variable 'console_printk', originally seen at DIE 37f3.
 error: .debug_info: DIE 0x3d2e: Redeclaration of variable 'hex_asc', originally seen at DIE 380b.
index 9caf59f9f7f4f31fd1729baa805b2dbddcf2ca07..c02a8095f4735d39ca8265b348b915d85269572d 100755 (executable)
@@ -36,12 +36,16 @@ error: .debug_abbrev: abbr. attribute 0x330: invalid or unknown name 0x2107.
 error: .debug_abbrev: abbr. attribute 0xa28: invalid or unknown name 0x2107.
 error: .debug_abbrev: abbr. attribute 0x108e: invalid or unknown name 0x2107.
 error: .debug_abbrev: abbr. attribute 0x1300: invalid or unknown name 0x2107.
+warning: .debug_info: DIE 0xd9a8: DW_AT_low_pc value not below DW_AT_high_pc.
+warning: .debug_info: DIE 0xdcd7: DW_AT_low_pc value not below DW_AT_high_pc.
 warning: .debug_info: CU 55709: no aranges table is associated with this CU.
 warning: .debug_info: CU 56524: no aranges table is associated with this CU.
 EOF
 
 # Here we test proper support for DW_AT_GNU_vector
 testrun_compare ./dwarflint --check=@low --ignore-bloat libdl-2.12.so.debug <<EOF
+warning: .debug_info: DIE 0xd9a8: DW_AT_low_pc value not below DW_AT_high_pc.
+warning: .debug_info: DIE 0xdcd7: DW_AT_low_pc value not below DW_AT_high_pc.
 warning: .debug_info: CU 55709: no aranges table is associated with this CU.
 warning: .debug_info: CU 56524: no aranges table is associated with this CU.
 EOF