|
From: <sv...@va...> - 2005-06-25 20:13:14
|
Author: njn
Date: 2005-06-25 21:13:05 +0100 (Sat, 25 Jun 2005)
New Revision: 4023
Log:
Remove unneeded cases from match_lib.
Modified:
trunk/coregrind/m_redir.c
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-25 19:52:02 UTC (rev 4022)
+++ trunk/coregrind/m_redir.c 2005-06-25 20:13:05 UTC (rev 4023)
@@ -91,37 +91,22 @@
return buf;
}
=20
-static SkipList sk_resolved_redir =3D VG_SKIPLIST_INIT(CodeRedirect, fro=
m_addr,=20
- VG_(cmp_Addr), straddr, VG_AR_SYMTAB);
+static SkipList sk_resolved_redir =3D=20
+ VG_SKIPLIST_INIT(CodeRedirect, from_addr, VG_(cmp_Addr),=20
+ straddr, VG_AR_SYMTAB);
+
static CodeRedirect *unresolved_redir =3D NULL;
=20
static Bool match_lib(const Char *pattern, const SegInfo *si)
{
- /* pattern =3D=3D NULL matches everything, otherwise use globbing
+ // pattern must start with "soname:"
+ vg_assert(NULL !=3D pattern);
+ vg_assert(0 =3D=3D VG_(strncmp)(pattern, "soname:", 7));
=20
- If the pattern starts with:
- file:, then match filename
- soname:, then match soname
- something else, match filename
- */
- const Char *name =3D si->filename;
-
- if (pattern =3D=3D NULL)
- return True;
-
- if (VG_(strncmp)(pattern, "file:", 5) =3D=3D 0) {
- pattern +=3D 5;
- name =3D si->filename;
- }
- if (VG_(strncmp)(pattern, "soname:", 7) =3D=3D 0) {
- pattern +=3D 7;
- name =3D si->soname;
- }
-
- if (name =3D=3D NULL)
+ if (si->soname =3D=3D NULL)
return False;
=20
- return VG_(string_match)(pattern, name);
+ return VG_(string_match)(pattern + 7, si->soname);
}
=20
static inline Bool from_resolved(const CodeRedirect *redir)
|