Support for self modifying code on unfriendly platforms (x86, amd64)
via the use of self-checking translations. (Friendly platforms which
have icache-invalidation instructions we can observe, such as ppc32,
are already handled correctly.) This should finally fix the
longstanding problem of V incorrectly handling calls of statically
nested functions (a gcc extension), and more generally make it a lot
easier to use V to debug dynamic code generation systems.
Since self-checking is a large performance overhead, there is some
control via a command line flag:
--smc-support=none
Don't make any translations self-checking.
--smc-support=stack
Add checking code for translations taken from segments which
have the SF_GROWDOWN flag set -- stacks, basically.
This is the default. It should make gcc nested functions and
GNU Ada work correctly with no intervention from the user.
--smc-support=all
Make all translations self-checking. This is expensive and
you want to do this if you're debugging a JIT compiler or
some such.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4122 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_options.c b/coregrind/m_options.c
index 24d76f8..16f4a35 100644
--- a/coregrind/m_options.c
+++ b/coregrind/m_options.c
@@ -76,8 +76,9 @@
Bool VG_(clo_show_emwarns) = False;
Int VG_(clo_max_stackframe) = 2000000;
Bool VG_(clo_wait_for_gdb) = False;
+VgSmc VG_(clo_smc_support) = Vg_SmcStack;
+
/*--------------------------------------------------------------------*/
/*--- end m_options.c ---*/
/*--------------------------------------------------------------------*/
-