diff options
author | Petr Machata <pmachata@redhat.com> | 2011-03-18 01:21:12 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2011-03-18 01:21:12 +0100 |
commit | 68d1c27284699ce2316f8c1edae72606653444ce (patch) | |
tree | c3e8601869286de8cb2a2e128b6da6172d913e0f | |
parent | 290413c6be1bb320e0e8d067cedba0840dee86e8 (diff) | |
download | elfutils-68d1c27284699ce2316f8c1edae72606653444ce.tar.gz |
dwarflint: Also cover DW_AT_low_pc == DW_AT_high_pc (if that is > 0)
-rw-r--r-- | dwarflint/check_debug_info.cc | 4 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_debug_info_refs.sh | 1 | ||||
-rwxr-xr-x | dwarflint/tests/run-check_duplicate_DW_tag_variable.sh | 1 | ||||
-rwxr-xr-x | dwarflint/tests/run-libdl-2.12.so.debug.sh | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index 6bff11bf..e01b4c9c 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -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; diff --git a/dwarflint/tests/run-check_debug_info_refs.sh b/dwarflint/tests/run-check_debug_info_refs.sh index 74288261..88961a9d 100755 --- a/dwarflint/tests/run-check_debug_info_refs.sh +++ b/dwarflint/tests/run-check_debug_info_refs.sh @@ -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 diff --git a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh index 3687a18e..9b22daf5 100755 --- a/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh +++ b/dwarflint/tests/run-check_duplicate_DW_tag_variable.sh @@ -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. diff --git a/dwarflint/tests/run-libdl-2.12.so.debug.sh b/dwarflint/tests/run-libdl-2.12.so.debug.sh index 9caf59f9..c02a8095 100755 --- a/dwarflint/tests/run-libdl-2.12.so.debug.sh +++ b/dwarflint/tests/run-libdl-2.12.so.debug.sh @@ -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 |