From 68d1c27284699ce2316f8c1edae72606653444ce Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Fri, 18 Mar 2011 01:21:12 +0100 Subject: dwarflint: Also cover DW_AT_low_pc == DW_AT_high_pc (if that is > 0) --- dwarflint/check_debug_info.cc | 4 +++- dwarflint/tests/run-check_debug_info_refs.sh | 1 + dwarflint/tests/run-check_duplicate_DW_tag_variable.sh | 1 + dwarflint/tests/run-libdl-2.12.so.debug.sh | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) 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 <