]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make search_all_symtabs() work in the same way as search_all_loctabs()
authorNicholas Nethercote <njn@valgrind.org>
Tue, 21 Jun 2005 23:09:45 +0000 (23:09 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 21 Jun 2005 23:09:45 +0000 (23:09 +0000)
and search_all_scopetabs(), ie. search through SegInfos instead of Segments.
This reduces m_debuginfo's dependency on m_aspacemgr.

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

coregrind/m_debuginfo/symtab.c

index b649e8e28c6e28e632ea682587acc7ab8b98b388..49738f2df0d8633dcc8d9a72f21ac84776d585af 100644 (file)
@@ -1796,32 +1796,25 @@ Addr VG_(reverse_search_one_symtab) ( const SegInfo* si, const Char* name )
 /* Search all symtabs that we know about to locate ptr.  If found, set
    *psi to the relevant SegInfo, and *symno to the symtab entry number
    within that.  If not found, *psi is set to NULL.  */
-
 static void search_all_symtabs ( Addr ptr, /*OUT*/SegInfo** psi, 
                                            /*OUT*/Int* symno,
                                  Bool match_anywhere_in_fun )
 {
    Int      sno;
    SegInfo* si;
-   Segment *s;
 
    VGP_PUSHCC(VgpSearchSyms);
 
-   s = VG_(find_segment)(ptr);
-
-   if (s == NULL || s->seginfo == NULL)
-      goto not_found;
-   
-   si = s->seginfo;
-
-   sno = search_one_symtab ( si, ptr, match_anywhere_in_fun );
-   if (sno == -1) goto not_found;
-   
-   *symno = sno;
-   *psi = si;
-   VGP_POPCC(VgpSearchSyms);
-   return;
-
+   for (si = segInfo_list; si != NULL; si = si->next) {
+      if (si->start <= ptr && ptr < si->start+si->size) {
+         sno = search_one_symtab ( si, ptr, match_anywhere_in_fun );
+         if (sno == -1) goto not_found;
+         *symno = sno;
+         *psi = si;
+         VGP_POPCC(VgpSearchSyms);
+         return;
+      }
+   }
   not_found:
    *psi = NULL;
    VGP_POPCC(VgpSearchSyms);