summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2011-03-21 16:47:26 +0100
committerPetr Machata <pmachata@redhat.com>2011-03-21 16:47:26 +0100
commitb87335df36653199d182978496aa92114460330b (patch)
treef5325b01844047661c6772f289d5a886e1b4b5fd
parent8990964cf319d4d326d5d510c1f9f5562fb63859 (diff)
downloadelfutils-b87335df36653199d182978496aa92114460330b.tar.gz
dwarflint: Fix reporting of CU x arange mismatch
- report the direction of mismatch correctly - clarify that we only care about CU DIEs, not any old DIE. Clarify that in a comment in check_debug_info
-rw-r--r--dwarflint/check_debug_aranges.cc4
-rw-r--r--dwarflint/check_debug_info.cc4
-rwxr-xr-xdwarflint/tests/run-aranges_terminate_early.sh4
3 files changed, 7 insertions, 5 deletions
diff --git a/dwarflint/check_debug_aranges.cc b/dwarflint/check_debug_aranges.cc
index 915dcae4..f044b43e 100644
--- a/dwarflint/check_debug_aranges.cc
+++ b/dwarflint/check_debug_aranges.cc
@@ -122,7 +122,7 @@ hole (uint64_t start, uint64_t length, void *user)
char buf[128];
where where = WHERE (info.id, NULL);
char const *what = info.what;
- char const *cu = "CUs";
+ char const *cu = "CU DIEs";
if (info.reverse)
{
char const *tmp = what;
@@ -158,7 +158,7 @@ compare_coverage (struct elf_file *file,
enum section_id id, char const *what)
{
compare_coverage_1 (file, coverage, other, id, what, false);
- compare_coverage_1 (file, other, coverage, id, what, false);
+ compare_coverage_1 (file, other, coverage, id, what, true);
}
inline static void
diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc
index b64a82eb..32bfd572 100644
--- a/dwarflint/check_debug_info.cc
+++ b/dwarflint/check_debug_info.cc
@@ -943,7 +943,9 @@ namespace
high_pc += low_pc;
}
- /* Check PC coverage. */
+ /* Check PC coverage. We do that only for CU DIEs. Any DIEs
+ lower in the tree (should) take subset of addresses taken
+ by the CU DIE. */
if (is_cudie && low_pc != (uint64_t)-1)
{
cu->low_pc = low_pc;
diff --git a/dwarflint/tests/run-aranges_terminate_early.sh b/dwarflint/tests/run-aranges_terminate_early.sh
index 9519f12e..7f695148 100755
--- a/dwarflint/tests/run-aranges_terminate_early.sh
+++ b/dwarflint/tests/run-aranges_terminate_early.sh
@@ -33,10 +33,10 @@ testfiles aranges_terminate_early
testrun_compare ./dwarflint --strict aranges_terminate_early <<EOF
warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes.
-warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CUs, but not with aranges.
+warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CU DIEs, but not with aranges.
EOF
testrun_compare ./dwarflint --check=check_debug_aranges --strict aranges_terminate_early <<EOF
warning: .debug_aranges: [0x20, 0x30): unnecessary padding with zero bytes.
-warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CUs, but not with aranges.
+warning: .debug_aranges: addresses [0x400474, 0x400481) are covered with CU DIEs, but not with aranges.
EOF