]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Avoid m_redir.c importing priv_symtab.h.
authorNicholas Nethercote <njn@valgrind.org>
Sat, 25 Jun 2005 20:22:43 +0000 (20:22 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 25 Jun 2005 20:22:43 +0000 (20:22 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4024

coregrind/m_debuginfo/symtab.c
coregrind/m_redir.c
include/pub_tool_debuginfo.h

index 3cc568bc938590f21c2bce02c1268eee477ada6b..b37dd2bf99cdf513f58e03078b8137fe3491aedd 100644 (file)
@@ -2580,6 +2580,11 @@ SizeT VG_(seginfo_size)(const SegInfo* si)
    return si->size;
 }
 
+const UChar* VG_(seginfo_soname)(const SegInfo* si)
+{
+   return si->soname;
+}
+
 const UChar* VG_(seginfo_filename)(const SegInfo* si)
 {
    return si->filename;
index 960aa7ff99277ed4413aa486fed9c88efd4681f9..9048b2d846033ad6c197d3dc1a7388a1c5cb0e8b 100644 (file)
@@ -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 internals
 
 /*------------------------------------------------------------*/
 /*--- General purpose redirection.                         ---*/
@@ -97,16 +96,16 @@ static SkipList sk_resolved_redir =
 
 static CodeRedirect *unresolved_redir = NULL;
 
-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 != pattern);
    vg_assert(0 == VG_(strncmp)(pattern, "soname:", 7));
 
-   if (si->soname == NULL)
+   if (NULL == soname)
       return False;
    
-   return VG_(string_match)(pattern + 7, si->soname);
+   return VG_(string_match)(pattern + 7, soname);
 }
 
 static inline Bool from_resolved(const CodeRedirect *redir)
@@ -200,7 +199,7 @@ static Bool resolve_redir(CodeRedirect *redir, const SegInfo *si)
    vg_assert(!resolved);
    vg_assert(redir->from_sym != NULL);
 
-   if (match_lib(redir->from_lib, si)) {
+   if (soname_matches(redir->from_lib, VG_(seginfo_soname)(si))) {
       redir->from_addr = VG_(reverse_search_one_symtab)(si, redir->from_sym);
       if (VG_(clo_trace_redir) && redir->from_addr != 0)
          VG_(printf)("   bind FROM: %p = %s:%s\n", 
@@ -244,7 +243,7 @@ void VG_(resolve_seg_redirs)(SegInfo *si)
 
    if (VG_(clo_trace_redir))
       VG_(printf)("Considering redirs to/from %s(soname=%s)\n",
-                  si->filename, si->soname);
+                  VG_(seginfo_filename)(si), VG_(seginfo_soname)(si));
 
    /* visit each unresolved redir - if it becomes resolved, then
       remove it from the unresolved list */
index bafb59caf120d5e337f4bdffbbe863c5b813a524..acbd511e9de272b536859e5a6e40043a05eb8ecc 100644 (file)
@@ -105,6 +105,7 @@ extern SegInfo* VG_(get_obj)  ( Addr a );
 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 );