summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-10-05 03:13:51 +0000
committerGreg Clayton <gclayton@apple.com>2010-10-05 03:13:51 +0000
commitb71f384455e299fbad5dee9582f7b59f45b6f72c (patch)
tree772de9059a3fb05301d279bd9775e7f668c298ce /lldb/source/Commands/CommandObjectExpression.cpp
parentdfbdfbba8f687dfc7f1745256246a92fcb64652f (diff)
downloadbcm5719-llvm-b71f384455e299fbad5dee9582f7b59f45b6f72c.tar.gz
bcm5719-llvm-b71f384455e299fbad5dee9582f7b59f45b6f72c.zip
Added the notion that a value object can be constant by adding:
bool ValueObject::GetIsConstant() const; void ValueObject::SetIsConstant(); This will stop anything from being re-evaluated within the value object so that constant result value objects can maintain their frozen values without anything being updated or changed within the value object. Made it so the ValueObjectConstResult can be constructed with an lldb_private::Error object to allow for expression results to have errors. Since ValueObject objects contain error objects, I changed the expression evaluation in ClangUserExpression from static Error ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr, lldb::ValueObjectSP &result_valobj_sp); to: static lldb::ValueObjectSP Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr); Even though expression parsing is borked right now (pending fixes coming from Sean Callanan), I filled in the implementation for: SBValue SBFrame::EvaluateExpression (const char *expr); Modified all expression code to deal with the above changes. llvm-svn: 115589
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index a02451ceb46..1f6c3de1903 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -233,13 +233,10 @@ CommandObjectExpression::EvaluateExpression
m_exe_ctx.process->SetDynamicCheckers(dynamic_checkers);
}
- lldb::ValueObjectSP result_valobj_sp;
-
- Error expr_error (ClangUserExpression::Evaluate (m_exe_ctx, expr, result_valobj_sp));
-
- if (expr_error.Success())
+ lldb::ValueObjectSP result_valobj_sp (ClangUserExpression::Evaluate (m_exe_ctx, expr));
+ assert (result_valobj_sp.get());
+ if (result_valobj_sp->GetError().Success())
{
- assert (result_valobj_sp.get() != NULL);
ValueObject::DumpValueObject (output_stream,
m_exe_ctx.GetBestExecutionContextScope(),
result_valobj_sp.get(), // Variable object to dump
@@ -257,9 +254,9 @@ CommandObjectExpression::EvaluateExpression
}
else
{
- error_stream.PutCString(expr_error.AsCString());
+ error_stream.PutCString(result_valobj_sp->GetError().AsCString());
if (result)
- result->SetStatus (eReturnStatusSuccessFinishNoResult);
+ result->SetStatus (eReturnStatusFailed);
}
return true;
OpenPOWER on IntegriCloud