From: Petr Machata Date: Wed, 21 Oct 2009 21:40:12 +0000 (+0200) Subject: dwarflint: check_debug_info not a strong prerequisite of check_debug_aranges X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7cd6d163615d05f5c506b5adcdcc2da187e907e;p=thirdparty%2Felfutils.git dwarflint: check_debug_info not a strong prerequisite of check_debug_aranges --- diff --git a/src/dwarflint/checks-low.cc b/src/dwarflint/checks-low.cc index 1f6ac8fb1..dd889c61e 100644 --- a/src/dwarflint/checks-low.cc +++ b/src/dwarflint/checks-low.cc @@ -353,13 +353,24 @@ check_debug_ranges::check_debug_ranges (dwarflint &lint) check_debug_aranges::check_debug_aranges (dwarflint &lint) : _m_sec_aranges (lint.check (_m_sec_aranges)) - , _m_cus (lint.check (_m_cus)) { - coverage *cov - = _m_cus->cu_cov.need_ranges ? NULL : &_m_cus->cu_cov.cov; + check_debug_info *info = toplev_check (lint); + coverage *cov = NULL; + if (info != NULL) + { + // xxx If need_ranges is true, we have to load ranges first. + // That's a flaw in design of checks, that data should have been + // stored in check_ranges, and that should have been requested + // explicitly. But for the time being... + if (info->cu_cov.need_ranges) + toplev_check (lint); + if (!info->cu_cov.need_ranges) + cov = &info->cu_cov.cov; + } + if (!check_aranges_structural (&_m_sec_aranges->file, &_m_sec_aranges->sect, - &_m_cus->cus.front (), + info != NULL ? &info->cus.front () : NULL, cov)) throw check_base::failed (""); //xxx } diff --git a/src/dwarflint/checks-low.hh b/src/dwarflint/checks-low.hh index 60b52bcb1..0519a17a2 100644 --- a/src/dwarflint/checks-low.hh +++ b/src/dwarflint/checks-low.hh @@ -54,6 +54,9 @@ class check_debug_info check_debug_abbrev *_m_abbrevs; public: + // The check pass adds all low_pc/high_pc ranges loaded from DIE + // tree into this following cu_cov structure. If it finds any + // rangeptr-class attributes, it sets cu_cov.need_ranges to true. cu_coverage cu_cov; std::vector cus; @@ -77,7 +80,6 @@ class check_debug_aranges : public check { section *_m_sec_aranges; - check_debug_info *_m_cus; public: explicit check_debug_aranges (dwarflint &lint);