diff options
author | Sean Callanan <scallanan@apple.com> | 2010-09-01 00:58:00 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2010-09-01 00:58:00 +0000 |
commit | 6961e87847cd39a65ecde0342ec5c7d1dee9622c (patch) | |
tree | b49e5acd42822d3575f26dd66242ebce14d65293 /lldb/source/Commands/CommandObjectExpression.cpp | |
parent | 6aaebe877bbff9d9b3b6e639d6e79d79fa50ebea (diff) | |
download | llvm-6961e87847cd39a65ecde0342ec5c7d1dee9622c.zip llvm-6961e87847cd39a65ecde0342ec5c7d1dee9622c.tar.gz llvm-6961e87847cd39a65ecde0342ec5c7d1dee9622c.tar.bz2 |
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
llvm-svn: 112690
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index b29c0c7..9026b74 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -190,6 +190,27 @@ bool CommandObjectExpression::EvaluateExpression (const char *expr, bool bare, Stream &output_stream, Stream &error_stream, CommandReturnObject *result) { + if (!m_exe_ctx.process) + { + error_stream.Printf ("Execution context doesn't contain a process"); + return false; + } + + if (!m_exe_ctx.process->GetDynamicCheckers()) + { + DynamicCheckerFunctions *dynamic_checkers = new DynamicCheckerFunctions(); + + StreamString install_errors; + + if (!dynamic_checkers->Install(install_errors, m_exe_ctx)) + { + error_stream.Printf("Couldn't install dynamic checkers into the execution context: %s", install_errors.GetData()); + return false; + } + + m_exe_ctx.process->SetDynamicCheckers(dynamic_checkers); + } + ClangUserExpression user_expression (expr); if (!user_expression.Parse (error_stream, m_exe_ctx)) |