]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Debug printing only: when printing SB translation header lines,
authorJulian Seward <jseward@acm.org>
Fri, 21 Oct 2011 04:59:56 +0000 (04:59 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 21 Oct 2011 04:59:56 +0000 (04:59 +0000)
print the object and SVMA too, so as to make it easy to find the
relevant bit of code by objdump -d of the object, even if the
function name is unknown.  Also re-order some of the fields.

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

coregrind/m_translate.c

index 1f1cb6642c356247e9ce8e3573806966eb5ec505..7eb6847a4470eb3d3d354af1b677583f875880c2 100644 (file)
@@ -1337,12 +1337,21 @@ Bool VG_(translate) ( ThreadId tid,
 
    /* If doing any code printing, print a basic block start marker */
    if (VG_(clo_trace_flags) || debugging_translation) {
-      Char fnname[64] = "";
+      Char fnname[64] = "UNKNOWN_FUNCTION";
       VG_(get_fnname_w_offset)(addr, fnname, 64);
+      const UChar* objname = "UNKNOWN_OBJECT";
+      OffT         objoff  = 0;
+      DebugInfo*   di      = VG_(find_DebugInfo)( addr );
+      if (di) {
+         objname = VG_(DebugInfo_get_filename)(di);
+         objoff  = addr - VG_(DebugInfo_get_text_bias)(di);
+      }
+      vg_assert(objname);
       VG_(printf)(
-              "==== SB %d [tid %d] %s(0x%llx) SBs exec'd %lld ====\n",
-              VG_(get_bbs_translated)(), (Int)tid, fnname, addr, 
-              bbs_done);
+         "==== SB %d (exec'd %lld) [tid %d] 0x%llx %s %s+0x%llx\n",
+         VG_(get_bbs_translated)(), bbs_done, (Int)tid, addr,
+         fnname, objname, (ULong)objoff
+      );
    }
 
    /* Are we allowed to translate here? */