From: Julian Seward Date: Fri, 21 Oct 2011 04:59:56 +0000 (+0000) Subject: Debug printing only: when printing SB translation header lines, X-Git-Tag: svn/VALGRIND_3_7_0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bb0938218fe0b90c1dda88f683d3a137ab791db;p=thirdparty%2Fvalgrind.git Debug printing only: when printing SB translation header lines, 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 --- diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c index 1f1cb6642c..7eb6847a44 100644 --- a/coregrind/m_translate.c +++ b/coregrind/m_translate.c @@ -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? */