Second attempt at the fix for the recursion in ValueObjectChild::CanUpdateWithInvalidExecutionContext()

This one should prevent the previous issues, and be the one true fix for rdar://21949558

llvm-svn: 243367
This commit is contained in:
Enrico Granata 2015-07-28 01:45:23 +00:00
parent 522b1d14ef
commit 2e9f29932d
5 changed files with 24 additions and 12 deletions

View File

@ -861,7 +861,7 @@ public:
bool
NeedsUpdating ()
{
const bool accept_invalid_exe_ctx = CanUpdateWithInvalidExecutionContext();
const bool accept_invalid_exe_ctx = (CanUpdateWithInvalidExecutionContext() == eLazyBoolYes);
return m_update_point.NeedsUpdating(accept_invalid_exe_ctx);
}
@ -1172,10 +1172,10 @@ protected:
virtual bool
UpdateValue () = 0;
virtual bool
virtual LazyBool
CanUpdateWithInvalidExecutionContext ()
{
return false;
return eLazyBoolCalculate;
}
virtual void

View File

@ -16,6 +16,8 @@
// Project includes
#include "lldb/Core/ValueObject.h"
#include "llvm/ADT/Optional.h"
namespace lldb_private {
//----------------------------------------------------------------------
@ -84,7 +86,7 @@ protected:
virtual bool
UpdateValue ();
virtual bool
virtual LazyBool
CanUpdateWithInvalidExecutionContext ();
virtual ClangASTType
@ -101,6 +103,7 @@ protected:
uint8_t m_bitfield_bit_offset;
bool m_is_base_class;
bool m_is_deref_of_parent;
llvm::Optional<LazyBool> m_can_update_with_invalid_exe_ctx;
//
// void

View File

@ -109,10 +109,10 @@ protected:
virtual bool
UpdateValue ();
virtual bool
virtual LazyBool
CanUpdateWithInvalidExecutionContext ()
{
return true;
return eLazyBoolYes;
}
virtual lldb::DynamicValueType

View File

@ -156,10 +156,10 @@ protected:
virtual bool
UpdateValue ();
virtual bool
virtual LazyBool
CanUpdateWithInvalidExecutionContext ()
{
return true;
return eLazyBoolYes;
}
virtual ClangASTType

View File

@ -44,7 +44,8 @@ ValueObjectChild::ValueObjectChild
m_bitfield_bit_size (bitfield_bit_size),
m_bitfield_bit_offset (bitfield_bit_offset),
m_is_base_class (is_base_class),
m_is_deref_of_parent (is_deref_of_parent)
m_is_deref_of_parent (is_deref_of_parent),
m_can_update_with_invalid_exe_ctx()
{
m_name = name;
SetAddressTypeOfChildren(child_ptr_or_ref_addr_type);
@ -109,12 +110,20 @@ ValueObjectChild::GetDisplayTypeName()
return display_name;
}
bool
LazyBool
ValueObjectChild::CanUpdateWithInvalidExecutionContext ()
{
if (m_can_update_with_invalid_exe_ctx.hasValue())
return m_can_update_with_invalid_exe_ctx.getValue();
if (m_parent)
return m_parent->CanUpdateWithInvalidExecutionContext();
return this->ValueObject::CanUpdateWithInvalidExecutionContext();
{
ValueObject *opinionated_parent = m_parent->FollowParentChain([] (ValueObject* valobj) -> bool {
return (valobj->CanUpdateWithInvalidExecutionContext() == eLazyBoolCalculate);
});
if (opinionated_parent)
return (m_can_update_with_invalid_exe_ctx = opinionated_parent->CanUpdateWithInvalidExecutionContext()).getValue();
}
return (m_can_update_with_invalid_exe_ctx = this->ValueObject::CanUpdateWithInvalidExecutionContext()).getValue();
}
bool