[Lldb-commits] [lldb] r146315 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Sean Callanan
scallanan at apple.com
Fri Dec 9 19:12:34 PST 2011
Author: spyffe
Date: Fri Dec 9 21:12:34 2011
New Revision: 146315
URL: http://llvm.org/viewvc/llvm-project?rev=146315&view=rev
Log:
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.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=146315&r1=146314&r2=146315&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Fri Dec 9 21:12:34 2011
@@ -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 @@
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 @@
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 @@
return;
}
}
- else if (frame && target)
+ else if (target)
{
var = FindGlobalVariable (*target,
module_sp,
@@ -2549,7 +2551,7 @@
if (var)
{
- valobj = frame->TrackGlobalVariable(var, eNoDynamicValues);
+ valobj = ValueObjectVariable::Create(target, var);
AddOneVariable(context, var, valobj, current_id);
context.m_found.variable = true;
}
More information about the lldb-commits
mailing list