]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Move all the low_pc/high_pc processing after the attribute loop
authorPetr Machata <pmachata@redhat.com>
Tue, 12 Oct 2010 11:24:20 +0000 (13:24 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 12 Oct 2010 11:24:20 +0000 (13:24 +0200)
- no point adding the low_pc/high_pc range once more for each attribute
  after the second in the DW_AT_{high,low}_pc pair

dwarflint/check_debug_info.cc

index 91296bf6940a9647f6203da6da50c7f1e73ef66f..b4ea0208be46a0d90918ceabb3927de831039fbd 100644 (file)
@@ -850,19 +850,19 @@ namespace
               low_pc or high_pc.  */
            if (valuep != NULL)
              *valuep = value;
+         }
+       where.ref = NULL;
 
-           /* Check PC coverage.  */
-           if (abbrev->tag == DW_TAG_compile_unit
-               || abbrev->tag == DW_TAG_partial_unit)
-             {
-               if (it->name == DW_AT_low_pc)
-                 cu->low_pc = value;
+       /* Check PC coverage.  */
+       if ((abbrev->tag == DW_TAG_compile_unit
+            || abbrev->tag == DW_TAG_partial_unit)
+           && low_pc != (uint64_t)-1)
+         {
+           cu->low_pc = low_pc;
 
-               if (low_pc != (uint64_t)-1 && high_pc != (uint64_t)-1)
-                 coverage_add (pc_coverage, low_pc, high_pc - low_pc);
-             }
+           if (high_pc != (uint64_t)-1)
+             coverage_add (pc_coverage, low_pc, high_pc - low_pc);
          }
-       where.ref = NULL;
 
        if (high_pc != (uint64_t)-1 && low_pc != (uint64_t)-1)
          {