]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When printing "REDIR:" lines at -v, print not only the name of the
authorJulian Seward <jseward@acm.org>
Tue, 17 Jun 2014 20:37:08 +0000 (20:37 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 17 Jun 2014 20:37:08 +0000 (20:37 +0000)
function being redirected but also the soname of the object that it is
in.  This makes it a bit easier to diagnose redirection problems.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14051

coregrind/m_translate.c

index 8cc70383151068f23275e4b63c699e351474832f..d1757bb0ce76cb5402654cd411538c149cbb0f87 100644 (file)
@@ -1389,13 +1389,23 @@ Bool VG_(translate) ( ThreadId tid,
       HChar name1[512] = "";
       HChar name2[512] = "";
       name1[0] = name2[0] = 0;
-      ok = VG_(get_fnname_w_offset)(nraddr, name1, 512);
+      ok = VG_(get_fnname_w_offset)(nraddr, name1, sizeof(name1));
       if (!ok) VG_(strcpy)(name1, "???");
-      ok = VG_(get_fnname_w_offset)(addr, name2, 512);
+      ok = VG_(get_fnname_w_offset)(addr, name2, sizeof(name2));
       if (!ok) VG_(strcpy)(name2, "???");
+      /* Try also to get the soname (not the filename) of the "from"
+         object.  This makes it much easier to debug redirection
+         problems. */
+      const HChar* nraddr_soname = "???";
+      DebugInfo*   nraddr_di     = VG_(find_DebugInfo)(nraddr);
+      if (nraddr_di) {
+         const HChar* t = VG_(DebugInfo_get_soname)(nraddr_di);
+         if (t)
+            nraddr_soname = t;
+      }
       VG_(message)(Vg_DebugMsg, 
-                   "REDIR: 0x%llx (%s) redirected to 0x%llx (%s)\n",
-                   nraddr, name1,
+                   "REDIR: 0x%llx (%s:%s) redirected to 0x%llx (%s)\n",
+                   nraddr, nraddr_soname, name1,
                    addr, name2 );
    }