aboutsummaryrefslogtreecommitdiff
path: root/callgrind
diff options
context:
space:
mode:
authorflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2015-01-13 17:33:59 +0000
committerflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>2015-01-13 17:33:59 +0000
commit5f1aeb620eb5a3aab662f8b949b031a77a0d14fe (patch)
tree1c4d9ea5ef2e47e27f3d2846db1981c849db3814 /callgrind
parenta9176d9640606a083a6e9b97515b15f631de5059 (diff)
downloadvalgrind-5f1aeb620eb5a3aab662f8b949b031a77a0d14fe.tar.gz
Export VG_(discard_tranalsations_safely) to the tools. It is
only allowed to be called in certain contexts which is enforced at runtime. Change callgrind accordingly. New header file pub_tool_transtab.h added. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14867 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'callgrind')
-rw-r--r--callgrind/main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/callgrind/main.c b/callgrind/main.c
index ad61d459a..26e5c5dc9 100644
--- a/callgrind/main.c
+++ b/callgrind/main.c
@@ -37,6 +37,7 @@
#include "pub_tool_threadstate.h"
#include "pub_tool_gdbserver.h"
+#include "pub_tool_transtab.h" // VG_(discard_translations_safely)
#include "cg_branchpred.c"
@@ -1448,10 +1449,6 @@ void zero_state_cost(thread_info* t)
CLG_(zero_cost)( CLG_(sets).full, CLG_(current_state).cost );
}
-/* Ups, this can go very wrong...
- FIXME: We should export this function or provide other means to get a handle */
-extern void VG_(discard_translations) ( Addr start, ULong range, const HChar* who );
-
void CLG_(set_instrument_state)(const HChar* reason, Bool state)
{
if (CLG_(instrument_state) == state) {
@@ -1463,7 +1460,7 @@ void CLG_(set_instrument_state)(const HChar* reason, Bool state)
CLG_DEBUG(2, "%s: Switching instrumentation %s ...\n",
reason, state ? "ON" : "OFF");
- VG_(discard_translations)( (Addr)0x1000, (ULong) ~0xfffl, "callgrind");
+ VG_(discard_translations_safely)( (Addr)0x1000, ~(SizeT)0xfff, "callgrind");
/* reset internal state: call stacks, simulator */
CLG_(forall_threads)(unwind_thread);