diff options
Diffstat (limited to 'lldb/source/Core/ValueObjectVariable.cpp')
-rw-r--r-- | lldb/source/Core/ValueObjectVariable.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp index 181324db251..24f189d9f95 100644 --- a/lldb/source/Core/ValueObjectVariable.cpp +++ b/lldb/source/Core/ValueObjectVariable.cpp @@ -127,7 +127,7 @@ ValueObjectVariable::UpdateValue () else { lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS; - ExecutionContext exe_ctx (GetExecutionContextScope()); + ExecutionContext exe_ctx (GetExecutionContextRef()); Target *target = exe_ctx.GetTargetPtr(); if (target) @@ -242,15 +242,27 @@ ValueObjectVariable::UpdateValue () bool ValueObjectVariable::IsInScope () { - ExecutionContextScope *exe_scope = GetExecutionContextScope(); - if (!exe_scope) - return true; - - StackFrame *frame = exe_scope->CalculateStackFrame(); - if (!frame) - return true; + const ExecutionContextRef &exe_ctx_ref = GetExecutionContextRef(); + if (exe_ctx_ref.HasFrameRef()) + { + ExecutionContext exe_ctx (exe_ctx_ref); + StackFrame *frame = exe_ctx.GetFramePtr(); + if (frame) + { + return m_variable_sp->IsInScope (frame); + } + else + { + // This ValueObject had a frame at one time, but now we + // can't locate it, so return false since we probably aren't + // in scope. + return false; + } + } + // We have a variable that wasn't tied to a frame, which + // means it is a global and is always in scope. + return true; - return m_variable_sp->IsInScope (frame); } Module * |