From: Nicholas Nethercote Date: Tue, 21 Jun 2005 23:09:45 +0000 (+0000) Subject: Make search_all_symtabs() work in the same way as search_all_loctabs() X-Git-Tag: svn/VALGRIND_3_0_0~324 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba5255ccdceab074f9c74acc6ac5816cd1a088d6;p=thirdparty%2Fvalgrind.git Make search_all_symtabs() work in the same way as search_all_loctabs() 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 --- diff --git a/coregrind/m_debuginfo/symtab.c b/coregrind/m_debuginfo/symtab.c index b649e8e28c..49738f2df0 100644 --- a/coregrind/m_debuginfo/symtab.c +++ b/coregrind/m_debuginfo/symtab.c @@ -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);