|
From: <sv...@va...> - 2005-06-21 23:09:47
|
Author: njn
Date: 2005-06-22 00:09:45 +0100 (Wed, 22 Jun 2005)
New Revision: 3994
Log:
Make search_all_symtabs() work in the same way as search_all_loctabs()
and search_all_scopetabs(), ie. search through SegInfos instead of Segmen=
ts.
This reduces m_debuginfo's dependency on m_aspacemgr.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
Modified: trunk/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtab.c 2005-06-21 23:03:36 UTC (rev 399=
3)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-21 23:09:45 UTC (rev 399=
4)
@@ -1796,32 +1796,25 @@
/* 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,=20
/*OUT*/Int* symno,
Bool match_anywhere_in_fun )
{
Int sno;
SegInfo* si;
- Segment *s;
=20
VGP_PUSHCC(VgpSearchSyms);
=20
- s =3D VG_(find_segment)(ptr);
-
- if (s =3D=3D NULL || s->seginfo =3D=3D NULL)
- goto not_found;
- =20
- si =3D s->seginfo;
-
- sno =3D search_one_symtab ( si, ptr, match_anywhere_in_fun );
- if (sno =3D=3D -1) goto not_found;
- =20
- *symno =3D sno;
- *psi =3D si;
- VGP_POPCC(VgpSearchSyms);
- return;
-
+ for (si =3D segInfo_list; si !=3D NULL; si =3D si->next) {
+ if (si->start <=3D ptr && ptr < si->start+si->size) {
+ sno =3D search_one_symtab ( si, ptr, match_anywhere_in_fun );
+ if (sno =3D=3D -1) goto not_found;
+ *symno =3D sno;
+ *psi =3D si;
+ VGP_POPCC(VgpSearchSyms);
+ return;
+ }
+ }
not_found:
*psi =3D NULL;
VGP_POPCC(VgpSearchSyms);
|