]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix two bugs:
authorFlorian Krohm <florian@eich-krohm.de>
Thu, 12 Mar 2015 18:56:21 +0000 (18:56 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Thu, 12 Mar 2015 18:56:21 +0000 (18:56 +0000)
(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

coregrind/m_debuginfo/debuginfo.c
exp-bbv/bbv_main.c

index 5d235ac015ad75a447c02750d4e1491bcf915769..14d5e603a4086f505eb7345e7f6827f3e0a33d67 100644 (file)
@@ -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,
index d7008c1d9a482da1cf78847b9c74fb1024bc9284..db7835f41cbf74b7af97f9a52c3b1002537712ea 100644 (file)
@@ -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 */