]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Callgrind: fix BB discarding
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Thu, 8 Jan 2015 14:15:18 +0000 (14:15 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Thu, 8 Jan 2015 14:15:18 +0000 (14:15 +0000)
When the info struct for a BB is created, we use the first guest
instruction address as key to insert the info into a hash table.
We should do the same when discarding.

This actually is not a real problem, as Callgrind obviously
is used very rarely with redirections. But we should be consistent
with cachegrind.

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

callgrind/main.c

index 5d10b40d4d5f073bf04cb2f0178c31ccdf3ca9ba..30a0cce17cba83a4a8ef4c82847c4e5fced4d0bb 100644 (file)
@@ -1377,9 +1377,11 @@ void clg_discard_superblock_info ( Addr orig_addr, VexGuestExtents vge )
                    (void*)orig_addr,
                    (void*)vge.base[0], (ULong)vge.len[0]);
 
-   // Get BB info, remove from table, free BB info.  Simple!  Note that we
-   // use orig_addr, not the first instruction address in vge.
-   CLG_(delete_bb)(orig_addr);
+   // Get BB info, remove from table, free BB info.  Simple!
+   // When created, the BB is keyed by the first instruction address,
+   // (not orig_addr, but eventually redirected address). Thus, we
+   // use the first instruction address in vge.
+   CLG_(delete_bb)(vge.base[0]);
 }