Added support for dynamic sanity checking in
expressions. Values used by the expression are
checked by validation functions which cause the
program to crash if the values are unsafe.
Major changes:
- Added IRDynamicChecks.[ch], which contains the
core code related to this feature
- Modified CommandObjectExpression to install the
validator functions into the target process.
- Added an accessor to Process that gets/sets the
helper functions
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112690 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangUtilityFunction.cpp b/source/Expression/ClangUtilityFunction.cpp
index 3acd3f2..17ba7db 100644
--- a/source/Expression/ClangUtilityFunction.cpp
+++ b/source/Expression/ClangUtilityFunction.cpp
@@ -37,7 +37,9 @@
ClangUtilityFunction::ClangUtilityFunction (const char *text,
const char *name) :
m_function_text(text),
- m_function_name(name)
+ m_function_name(name),
+ m_jit_begin(LLDB_INVALID_ADDRESS),
+ m_jit_end(LLDB_INVALID_ADDRESS)
{
}
@@ -56,7 +58,13 @@
bool
ClangUtilityFunction::Install (Stream &error_stream,
ExecutionContext &exe_ctx)
-{
+{
+ if (m_jit_begin != LLDB_INVALID_ADDRESS)
+ {
+ error_stream.PutCString("error: already installed\n");
+ return false;
+ }
+
////////////////////////////////////
// Set up the target and compiler
//