diff options
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index b336d59f794..1a7e3702b83 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -204,23 +204,30 @@ ValueObject::UpdateValueIfNeeded (DynamicValueType use_dynamic, bool update_form ClearUserVisibleData(); - const bool value_was_valid = GetValueIsValid(); - SetValueDidChange (false); - - m_error.Clear(); - - // Call the pure virtual function to update the value - bool success = UpdateValue (); - - SetValueIsValid (success); - - if (first_update) + if (IsInScope()) + { + const bool value_was_valid = GetValueIsValid(); SetValueDidChange (false); - else if (!m_value_did_change && success == false) + + m_error.Clear(); + + // Call the pure virtual function to update the value + bool success = UpdateValue (); + + SetValueIsValid (success); + + if (first_update) + SetValueDidChange (false); + else if (!m_value_did_change && success == false) + { + // The value wasn't gotten successfully, so we mark this + // as changed if the value used to be valid and now isn't + SetValueDidChange (value_was_valid); + } + } + else { - // The value wasn't gotten successfully, so we mark this - // as changed if the value used to be valid and now isn't - SetValueDidChange (value_was_valid); + m_error.SetErrorString("out of scope"); } } return m_error.Success(); |