]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Reinstate code to extent SegInfo ranges to cover all PT_LOAD segments
authorTom Hughes <tom@compton.nu>
Wed, 16 Nov 2005 00:09:15 +0000 (00:09 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 16 Nov 2005 00:09:15 +0000 (00:09 +0000)
when VG_(needs_data_syms) has been called by the tool.

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

coregrind/m_debuginfo/symtab.c

index 7458a059943da68f9248f116d65a0b075d2f2128..a92685f2d26ecb9fefe33b1e82d40745817b9f8c 100644 (file)
@@ -1525,11 +1525,8 @@ Bool read_lib_symbols ( SegInfo* si )
            else
               si->bss_size = 0;
         }
-#if 0
-        /* 20050228: disabled this until VG_(next_segment) can be
-           reinstated in some clean incarnation of the low level
-           memory manager. */
-        mapped = mapped & ~(VKI_PAGE_SIZE-1);
+
+         mapped = mapped & ~(VKI_PAGE_SIZE-1);
         mapped_end = (mapped_end + VKI_PAGE_SIZE - 1) & ~(VKI_PAGE_SIZE-1);
 
         if (VG_(needs).data_syms &&
@@ -1537,36 +1534,14 @@ Bool read_lib_symbols ( SegInfo* si )
             (mapped_end > (si->start+si->size))) {
            UInt newsz = mapped_end - si->start;
            if (newsz > si->size) {
-              Segment *seg;
-
               if (0)
                  VG_(printf)("extending mapping %p..%p %d -> ..%p %d\n", 
                              si->start, si->start+si->size, si->size,
                              si->start+newsz, newsz);
 
-              for(seg = VG_(find_segment_containing)(si->start);
-                  seg != NULL && VG_(seg_overlaps)(seg, si->start, si->size); 
-                  seg = VG_(next_segment)(seg)) {
-                 if (seg->symtab == si)
-                    continue;
-
-                 if (seg->symtab != NULL)
-                    VG_(seginfo_decref)(seg->symtab, seg->addr);
-
-                 VG_(seginfo_incref)(si);
-                 seg->symtab = si;
-                 
-                 if (0)
-                    VG_(printf)("adding symtab %p (%p-%p) to segment %p (%p-%p)\n",
-                                si, si->start, si->start+newsz,
-                                seg, seg->addr, seg->addr+seg->len);
-              }
-              
               si->size = newsz;
            }
         }
-#endif
-
       }
    }
 
@@ -1863,21 +1838,6 @@ static void unload_symbols ( Addr start, SizeT length )
    VGP_POPCC(VgpReadSyms);
 }
 
-//static void seginfo_decref(SegInfo *si, Addr start)
-//{
-//   vg_assert(si);
-//   vg_assert(si->ref >= 1);
-//   if (--si->ref == 0)
-//      unload_symbols(si->start, si->size);
-//}
-//
-//static void seginfo_incref(SegInfo *si)
-//{
-//   vg_assert(si);
-//   vg_assert(si->ref > 0);
-//   si->ref++;
-//}
-
 /*------------------------------------------------------------*/
 /*--- Use of symbol table & location info to create        ---*/
 /*--- plausible-looking stack dumps.                       ---*/