From: Petr Machata Date: Tue, 5 Oct 2010 16:38:52 +0000 (+0200) Subject: dwarflint: Fix handling of indirect forms in check_debug_info X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d79772203369fd0e28dc182627868dba1d0d75b6;p=thirdparty%2Felfutils.git dwarflint: Fix handling of indirect forms in check_debug_info - and commit a couple other nits --- diff --git a/dwarflint/TODO b/dwarflint/TODO index 872e6b2c2..f5393a5b8 100644 --- a/dwarflint/TODO +++ b/dwarflint/TODO @@ -17,8 +17,8 @@ http://www.mail-archive.com/elfutils-devel@lists.fedorahosted.org/msg00816.html ** dwarflint --stats -*** the mutable/immutable part is not implemented yet - http://www.mail-archive.com/elfutils-devel@lists.fedorahosted.org/msg00849.html +*** mutability probably needs to take into account DW_OP_call* + https://fedorahosted.org/pipermail/elfutils-devel/2010-October/001628.html ** expected trees/attributes This is about the check_expected_trees check. All attributes are diff --git a/dwarflint/check_debug_info.cc b/dwarflint/check_debug_info.cc index 87b81c885..13f2bedc2 100644 --- a/dwarflint/check_debug_info.cc +++ b/dwarflint/check_debug_info.cc @@ -630,7 +630,10 @@ namespace if (!checked_read_uleb128 (ctx, &value, &where, "indirect attribute form")) return -1; + form = value; + // xxx Some of what's below is probably duplicated in + // check_debug_abbrev. Consolidate. if (!ver->form_allowed (form)) { wr_error (where) @@ -638,7 +641,6 @@ namespace << '.' << std::endl; return -1; } - form = value; if (it->name == DW_AT_sibling) switch (ver->check_sibling_form (form)) @@ -654,7 +656,13 @@ namespace << "DW_AT_sibling attribute with non-reference " "(indirect) form \"" << pri::form (value) << "\"." << std::endl; - }; + } + } + + if (form == DW_FORM_indirect) + { + wr_error (&where, ": indirect form is again indirect.\n"); + return -1; } value_check_cb_t value_check_cb = NULL; @@ -939,10 +947,6 @@ namespace break; } - case DW_FORM_indirect: - wr_error (&where, ": indirect form is again indirect.\n"); - return -1; - default: wr_error (&where, ": internal error: unhandled form 0x%x.\n", form); diff --git a/dwarflint/check_debug_info.ii b/dwarflint/check_debug_info.ii index 70c4cbae8..ea388e397 100644 --- a/dwarflint/check_debug_info.ii +++ b/dwarflint/check_debug_info.ii @@ -1,3 +1,5 @@ +struct cu_head; +struct cu; class read_cu_headers; class check_debug_info; class check_debug_info_refs;