summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionDeclMap.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-12-10 03:12:34 +0000
committerSean Callanan <scallanan@apple.com>2011-12-10 03:12:34 +0000
commit9b3569bacc32f475c68520907da0ea3f2f1a4d8d (patch)
tree52f04c644bbdd84813fbde6f354b1d5baebd6b96 /lldb/source/Expression/ClangExpressionDeclMap.cpp
parent146ac7b609ea3e0a8e2429bca4da488a32b89514 (diff)
downloadbcm5719-llvm-9b3569bacc32f475c68520907da0ea3f2f1a4d8d.tar.gz
bcm5719-llvm-9b3569bacc32f475c68520907da0ea3f2f1a4d8d.zip
Two fixes for file variables:
- Even if a frame isn't present, we always try to use FindGlobalVariable to find variables. Instead of using frame->TrackGlobalVariable() to promote the VariableSP into a ValueObject, we now simply use ValueObjectVariable. - When requesting the value of a variable, we allow returning of the "live version" of the variable -- that is, the variable in the target instead of a pointer to its freeze dried version in LLDB -- even if there is no process present. llvm-svn: 146315
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 08a507490fb..31abd188856 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -22,6 +22,7 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/ValueObjectConstResult.h"
+#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Expression/ASTDumper.h"
#include "lldb/Expression/ClangASTSource.h"
#include "lldb/Expression/ClangPersistentVariables.h"
@@ -411,8 +412,7 @@ ClangExpressionDeclMap::CompleteResultVariable (lldb::ClangExpressionVariableSP
const size_t pvar_byte_size = pvar_sp->GetByteSize();
uint8_t *pvar_data = pvar_sp->GetValueBytes();
- if (!ReadTarget(pvar_data, value, pvar_byte_size))
- return false;
+ ReadTarget(pvar_data, value, pvar_byte_size);
pvar_sp->m_flags &= ~(ClangExpressionVariable::EVNeedsFreezeDry);
}
@@ -1031,8 +1031,10 @@ ClangExpressionDeclMap::LookupDecl (clang::NamedDecl *decl)
if ((persistent_var_sp->m_flags & ClangExpressionVariable::EVIsProgramReference ||
persistent_var_sp->m_flags & ClangExpressionVariable::EVIsLLDBAllocated) &&
persistent_var_sp->m_live_sp &&
- m_parser_vars->m_exe_ctx->GetProcessSP() &&
- m_parser_vars->m_exe_ctx->GetProcessSP()->IsAlive())
+ ((persistent_var_sp->m_live_sp->GetValue().GetValueType() == Value::eValueTypeLoadAddress &&
+ m_parser_vars->m_exe_ctx->GetProcessSP() &&
+ m_parser_vars->m_exe_ctx->GetProcessSP()->IsAlive()) ||
+ (persistent_var_sp->m_live_sp->GetValue().GetValueType() == Value::eValueTypeFileAddress)))
{
return persistent_var_sp->m_live_sp->GetValue();
}
@@ -2539,7 +2541,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
return;
}
}
- else if (frame && target)
+ else if (target)
{
var = FindGlobalVariable (*target,
module_sp,
@@ -2549,7 +2551,7 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
if (var)
{
- valobj = frame->TrackGlobalVariable(var, eNoDynamicValues);
+ valobj = ValueObjectVariable::Create(target, var);
AddOneVariable(context, var, valobj, current_id);
context.m_found.variable = true;
}
OpenPOWER on IntegriCloud