]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Finish checking .debug_abbrev before bailing out
authorPetr Machata <pmachata@redhat.com>
Mon, 18 Oct 2010 17:56:06 +0000 (19:56 +0200)
committerPetr Machata <pmachata@redhat.com>
Mon, 18 Oct 2010 17:56:06 +0000 (19:56 +0200)
dwarflint/check_debug_abbrev.cc

index fac1f4688b6ed477bfd187668650daaf648bd15b..b7e2f64af7b8b023ccba166a7ae723e0a4c52a00 100644 (file)
@@ -157,6 +157,7 @@ namespace
       }
     where.addr1 = 0;
 
+    bool failed = false;
     while (true)
       {
        /* If we get EOF at this point, either the CU was improperly
@@ -336,7 +337,6 @@ namespace
        bool low_pc = false;
        bool high_pc = false;
        bool ranges = false;
-       bool failed = false;
        std::map<unsigned, uint64_t> seen;
 
        do
@@ -379,7 +379,7 @@ namespace
            if (attribute == NULL)
              {
                wr_error (where)
-                 << "invalid name " << pri::hex (attrib_name)
+                 << "invalid or unknown name " << pri::hex (attrib_name)
                  << '.' << std::endl;
                failed = true;
                continue;
@@ -404,6 +404,9 @@ namespace
              (ver, attrib_form, attribute, &where, false);
            if (form == NULL)
              {
+               wr_error (where)
+                 << "invalid or unknown form " << pri::hex (attrib_form)
+                 << '.' << std::endl;
                failed = true;
                continue;
              }
@@ -434,11 +437,11 @@ namespace
          wr_error (where)
            << "the abbrev has DW_AT_high_pc & DW_AT_low_pc, "
            << "but also has DW_AT_ranges." << std::endl;
-
-       if (failed)
-         throw check_base::failed ();
       }
 
+    if (failed)
+      throw check_base::failed ();
+
     abbrev_table *last = NULL;
     for (check_debug_abbrev::abbrev_map::iterator it = abbrevs.begin ();
         it != abbrevs.end (); ++it)