diff options
author | Jim Ingham <jingham@apple.com> | 2011-08-09 00:00:49 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-08-09 00:00:49 +0000 |
commit | 41c7591a1af7ba10cb98b0d3f6af01c55cc5bd58 (patch) | |
tree | a230bd6b8794ad8aee3155e9a576e3868f4ba370 /lldb/source | |
parent | 53ea71674cb0475796d5f585e60e3995570a56ba (diff) | |
download | bcm5719-llvm-41c7591a1af7ba10cb98b0d3f6af01c55cc5bd58.tar.gz bcm5719-llvm-41c7591a1af7ba10cb98b0d3f6af01c55cc5bd58.zip |
Add EvaluateWithError static method. Fix a bug in handling constant expressions - we weren't setting the result even though the expression evaluation succeeded...
llvm-svn: 137077
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Expression/ClangUserExpression.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Expression/ClangUserExpression.cpp b/lldb/source/Expression/ClangUserExpression.cpp index b4a704cf33c..9cd84894854 100644 --- a/lldb/source/Expression/ClangUserExpression.cpp +++ b/lldb/source/Expression/ClangUserExpression.cpp @@ -605,9 +605,20 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, const char *expr_prefix, lldb::ValueObjectSP &result_valobj_sp) { + Error error; + return EvaluateWithError (exe_ctx, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error); +} + +ExecutionResults +ClangUserExpression::EvaluateWithError (ExecutionContext &exe_ctx, + bool discard_on_error, + const char *expr_cstr, + const char *expr_prefix, + lldb::ValueObjectSP &result_valobj_sp, + Error &error) +{ lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP)); - Error error; ExecutionResults execution_results = eExecutionSetupError; if (exe_ctx.process == NULL || exe_ctx.process->GetState() != lldb::eStateStopped) @@ -668,6 +679,7 @@ ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, log->Printf("== [ClangUserExpression::Evaluate] Expression evaluated as a constant =="); result_valobj_sp = user_expression_sp->m_const_result->GetValueObject(); + execution_results = eExecutionCompleted; } else { |