]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Fix handling of indirect forms in check_debug_info
authorPetr Machata <pmachata@redhat.com>
Tue, 5 Oct 2010 16:38:52 +0000 (18:38 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 5 Oct 2010 16:38:52 +0000 (18:38 +0200)
- and commit a couple other nits

dwarflint/TODO
dwarflint/check_debug_info.cc
dwarflint/check_debug_info.ii

index 872e6b2c28aefc0f659f181e7554f4a68e1a000f..f5393a5b89cff015067df696a2494296b659ef57 100644 (file)
@@ -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
index 87b81c885145b00ab941566b7d7bdebbad7874e4..13f2bedc2ba01930946fc1584ec0a98e1e82bc66 100644 (file)
@@ -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);
index 70c4cbae83294130bd2c92b5e78d7bd8877d3541..ea388e39768f3c2f8461770a399019ee959ea8d4 100644 (file)
@@ -1,3 +1,5 @@
+struct cu_head;
+struct cu;
 class read_cu_headers;
 class check_debug_info;
 class check_debug_info_refs;