]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When reading Dwarf3 variable type and location information, print a
authorJulian Seward <jseward@acm.org>
Wed, 11 May 2011 15:31:24 +0000 (15:31 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 11 May 2011 15:31:24 +0000 (15:31 +0000)
line showing the number of variables read for each object.  Currently
disabled -- is a sanity-check mechanism for exp-sgcheck.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11744

coregrind/m_debuginfo/readelf.c

index fcfb06ca8a27f9dca8a45ff8b37748ca28ee5208..88376d687d6a55b594619823b9adca96e52256b2 100644 (file)
@@ -2234,6 +2234,35 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
    }
    res = True;
 
+   /* If reading Dwarf3 variable type/location info, print a line
+      showing the number of variables read for each object.
+      (Currently disabled -- is a sanity-check mechanism for
+      exp-sgcheck.) */
+   if (0 && (VG_(needs).var_info || VG_(clo_read_var_info))) {
+      UWord nVars = 0;
+      Word  j;
+      if (di->varinfo) {
+         for (j = 0; j < VG_(sizeXA)(di->varinfo); j++) {
+            OSet* /* of DiAddrRange */ scope
+               = *(OSet**)VG_(indexXA)(di->varinfo, j);
+            vg_assert(scope);
+            VG_(OSetGen_ResetIter)( scope );
+            while (True) {
+               DiAddrRange* range  = VG_(OSetGen_Next)( scope );
+               if (!range) break;
+               vg_assert(range->vars);
+               Word w = VG_(sizeXA)(range->vars);
+               vg_assert(w >= 0);
+               if (0) VG_(printf)("range %#lx %#lx %ld\n",
+                                  range->aMin, range->aMax, w);
+               nVars += (UWord)w;
+            }
+         }
+      }
+      VG_(umsg)("VARINFO: %7lu vars   %7ld text_size   %s\n",
+                nVars, di->text_size, di->filename);
+   }
+
   out: {
    SysRes m_res;