diff options
author | Sean Callanan <scallanan@apple.com> | 2011-09-20 23:01:51 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-09-20 23:01:51 +0000 |
commit | 90539456a10254fe8c707ad955a43d36cff5187d (patch) | |
tree | 81221b223c6bc8c16b93498f6c217d7a43b69d55 /lldb/source/Expression/ClangExpressionParser.cpp | |
parent | 5227ea6028371f6d8538680fef1a79b49eb87f76 (diff) | |
download | bcm5719-llvm-90539456a10254fe8c707ad955a43d36cff5187d.tar.gz bcm5719-llvm-90539456a10254fe8c707ad955a43d36cff5187d.zip |
Fixed a problem where expressions would attempt to
allocate memory in a process that did not support
expression execution. Also improved detection of
whether or not a process can execute expressions.
llvm-svn: 140202
Diffstat (limited to 'lldb/source/Expression/ClangExpressionParser.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionParser.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp index 921dc00c7f4..3549196ed68 100644 --- a/lldb/source/Expression/ClangExpressionParser.cpp +++ b/lldb/source/Expression/ClangExpressionParser.cpp @@ -496,8 +496,32 @@ ClangExpressionParser::PrepareForExecution (lldb::addr_t &func_allocation_addr, return err; } - if (m_expr.NeedsValidation() && exe_ctx.process && exe_ctx.process->GetDynamicCheckers()) + if (execution_policy != eExecutionPolicyNever && + m_expr.NeedsValidation() && + exe_ctx.process) { + if (!exe_ctx.process->GetDynamicCheckers()) + { + DynamicCheckerFunctions *dynamic_checkers = new DynamicCheckerFunctions(); + + StreamString install_errors; + + if (!dynamic_checkers->Install(install_errors, exe_ctx)) + { + if (install_errors.GetString().empty()) + err.SetErrorString ("couldn't install checkers, unknown error"); + else + err.SetErrorString (install_errors.GetString().c_str()); + + return err; + } + + exe_ctx.process->SetDynamicCheckers(dynamic_checkers); + + if (log) + log->Printf("== [ClangUserExpression::Evaluate] Finished installing dynamic checkers =="); + } + IRDynamicChecks ir_dynamic_checks(*exe_ctx.process->GetDynamicCheckers(), function_name.c_str()); if (!ir_dynamic_checks.runOnModule(*module)) |