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
This commit is contained in:
Greg Clayton
2010-10-05 03:13:51 +00:00
parent dfbdfbba8f
commit b71f384455
9 changed files with 50 additions and 17 deletions

View File

@@ -20,6 +20,7 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/ValueObjectRegister.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Expression/ClangUserExpression.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/VariableList.h"
@@ -416,6 +417,9 @@ SBFrame::EvaluateExpression (const char *expr)
lldb::SBValue expr_result_value;
if (m_opaque_sp)
{
ExecutionContext exe_ctx;
m_opaque_sp->CalculateExecutionContext (exe_ctx);
*expr_result_value = ClangUserExpression::Evaluate (exe_ctx, expr);
}
return expr_result_value;
}