From: Florian Krohm Date: Thu, 12 Mar 2015 18:56:21 +0000 (+0000) Subject: Fix two bugs: X-Git-Tag: svn/VALGRIND_3_11_0~589 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95d7b1d05418c1bd26aa87c94b79a3b027097a37;p=thirdparty%2Fvalgrind.git Fix two bugs: (1) In r14664 VG_(get_fnname_if_entry) was changed to always return a function name, even if that function was *not* an entry. That broke callgrind and was also confusing because it contradicts what "get_fnname_if_entry" suggests. (2) In r14189 a function call was removed because it was considered redundant which it was not. Both bugs were hunted down by Joseph Weidendorfer. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15003 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 5d235ac015..14d5e603a4 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1724,7 +1724,7 @@ static void search_all_loctabs ( Addr ptr, /*OUT*/DebugInfo** pdi, /* The whole point of this whole big deal: map a code address to a plausible symbol name. Returns False if no idea; otherwise True. - Caller supplies buf and nbuf. If do_cxx_demangling is False, don't do + Caller supplies buf. If do_cxx_demangling is False, don't do C++ demangling, regardless of VG_(clo_demangle) -- probably because the call has come from VG_(get_fnname_raw)(). findText indicates whether we're looking for a text symbol or a data symbol @@ -1850,13 +1850,19 @@ Bool VG_(get_fnname_w_offset) ( Addr a, const HChar** buf ) of the return string at function get_sym_name */ Bool VG_(get_fnname_if_entry) ( Addr a, const HChar** buf ) { - return get_sym_name ( /*C++-demangle*/True, /*Z-demangle*/True, + const HChar *tmp; + Bool res; + + res = get_sym_name ( /*C++-demangle*/True, /*Z-demangle*/True, /*below-main-renaming*/True, - a, buf, + a, &tmp, /*match_anywhere_in_fun*/False, /*show offset?*/False, /*text syms only*/True, /*offsetP*/NULL ); + if (res) + *buf = tmp; + return res; } /* This is only available to core... don't C++-demangle, don't Z-demangle, diff --git a/exp-bbv/bbv_main.c b/exp-bbv/bbv_main.c index d7008c1d9a..db7835f41c 100644 --- a/exp-bbv/bbv_main.c +++ b/exp-bbv/bbv_main.c @@ -392,6 +392,7 @@ static IRSB* bbv_instrument ( VgCallbackClosure* closure, block_num++; /* get function name and entry point information */ const HChar *fn_name; + VG_(get_fnname)(origAddr, &fn_name); bbInfo->is_entry=VG_(get_fnname_if_entry)(origAddr, &fn_name); bbInfo->fn_name =VG_(strdup)("bbv_strings", fn_name); /* insert structure into table */