Callgrind: make globals for log_* helpers visible outside sim.c
At beginning of each BB, Callgrind inserts a call to setup_bbcc,
which (among a lot other things), sets global vars needed for
the log_* helpers called afterwards in this BB.
These globals, bb_base and cost_base, previously we static declared
and only visible in sim.c. Make them visible also in the rest of
callgrind to allow for log_* handlers outside sim.c.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11166 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/callgrind/bbcc.c b/callgrind/bbcc.c
index 66d609c..8620c6f 100644
--- a/callgrind/bbcc.c
+++ b/callgrind/bbcc.c
@@ -864,6 +864,9 @@
}
CLG_(current_state).bbcc = bbcc;
+ // needed for log_* handlers called in this BB
+ CLG_(bb_base) = bb->obj->offset + bb->offset;
+ CLG_(cost_base) = bbcc->cost;
CLG_DEBUGIF(1) {
VG_(printf)(" ");
@@ -878,7 +881,5 @@
CLG_(print_cxt)(-8, CLG_(current_state).cxt, bbcc->rec_index);
CLG_DEBUG(3,"\n");
- (*CLG_(cachesim).after_bbsetup)();
-
CLG_(stat).bb_executions++;
}