|
From: <sv...@va...> - 2005-06-25 20:23:17
|
Author: njn
Date: 2005-06-25 21:22:43 +0100 (Sat, 25 Jun 2005)
New Revision: 4024
Log:
Avoid m_redir.c importing priv_symtab.h.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_redir.c
trunk/include/pub_tool_debuginfo.h
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-25 20:13:05 UTC (rev 402=
3)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-25 20:22:43 UTC (rev 402=
4)
@@ -2580,6 +2580,11 @@
return si->size;
}
=20
+const UChar* VG_(seginfo_soname)(const SegInfo* si)
+{
+ return si->soname;
+}
+
const UChar* VG_(seginfo_filename)(const SegInfo* si)
{
return si->filename;
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 20:13:05 UTC (rev 4023)
+++ trunk/coregrind/m_redir.c 2005-06-25 20:22:43 UTC (rev 4024)
@@ -42,7 +42,6 @@
#include "pub_core_skiplist.h"
#include "pub_core_trampoline.h"
#include "pub_core_transtab.h"
-#include "m_debuginfo/priv_symtab.h" // XXX: bad! For SegInfo internal=
s
=20
/*------------------------------------------------------------*/
/*--- General purpose redirection. ---*/
@@ -97,16 +96,16 @@
=20
static CodeRedirect *unresolved_redir =3D NULL;
=20
-static Bool match_lib(const Char *pattern, const SegInfo *si)
+static Bool soname_matches(const Char *pattern, const Char* soname)
{
// pattern must start with "soname:"
vg_assert(NULL !=3D pattern);
vg_assert(0 =3D=3D VG_(strncmp)(pattern, "soname:", 7));
=20
- if (si->soname =3D=3D NULL)
+ if (NULL =3D=3D soname)
return False;
=20
- return VG_(string_match)(pattern + 7, si->soname);
+ return VG_(string_match)(pattern + 7, soname);
}
=20
static inline Bool from_resolved(const CodeRedirect *redir)
@@ -200,7 +199,7 @@
vg_assert(!resolved);
vg_assert(redir->from_sym !=3D NULL);
=20
- if (match_lib(redir->from_lib, si)) {
+ if (soname_matches(redir->from_lib, VG_(seginfo_soname)(si))) {
redir->from_addr =3D VG_(reverse_search_one_symtab)(si, redir->fro=
m_sym);
if (VG_(clo_trace_redir) && redir->from_addr !=3D 0)
VG_(printf)(" bind FROM: %p =3D %s:%s\n",=20
@@ -244,7 +243,7 @@
=20
if (VG_(clo_trace_redir))
VG_(printf)("Considering redirs to/from %s(soname=3D%s)\n",
- si->filename, si->soname);
+ VG_(seginfo_filename)(si), VG_(seginfo_soname)(si));
=20
/* visit each unresolved redir - if it becomes resolved, then
remove it from the unresolved list */
Modified: trunk/include/pub_tool_debuginfo.h
=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/include/pub_tool_debuginfo.h 2005-06-25 20:13:05 UTC (rev 4023)
+++ trunk/include/pub_tool_debuginfo.h 2005-06-25 20:22:43 UTC (rev 4024)
@@ -105,6 +105,7 @@
extern const SegInfo* VG_(next_seginfo) ( const SegInfo *si );
extern Addr VG_(seginfo_start) ( const SegInfo *si );
extern SizeT VG_(seginfo_size) ( const SegInfo *si );
+extern const UChar* VG_(seginfo_soname) ( const SegInfo *si );
extern const UChar* VG_(seginfo_filename) ( const SegInfo *si );
extern ULong VG_(seginfo_sym_offset)( const SegInfo *si );
=20
|