forked from OSchip/llvm-project
Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context
The issue is that a child can't really ask the root object, since this decision could actually hinge on whether a dynamic and/or synthetic value is present To do this, make values vote lazily for whether they are willing to allow this, so that we can navigate up the chain without recursively invoking ourselves Tentative fix for rdar://21949558 llvm-svn: 243077
This commit is contained in:
parent
29e9ae7891
commit
636cd262d6
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ protected:
|
|||
virtual bool
|
||||
UpdateValue ();
|
||||
|
||||
virtual bool
|
||||
virtual LazyBool
|
||||
CanUpdateWithInvalidExecutionContext ();
|
||||
|
||||
virtual ClangASTType
|
||||
|
|
|
|||
|
|
@ -109,10 +109,10 @@ protected:
|
|||
virtual bool
|
||||
UpdateValue ();
|
||||
|
||||
virtual bool
|
||||
virtual LazyBool
|
||||
CanUpdateWithInvalidExecutionContext ()
|
||||
{
|
||||
return true;
|
||||
return eLazyBoolYes;
|
||||
}
|
||||
|
||||
virtual lldb::DynamicValueType
|
||||
|
|
|
|||
|
|
@ -156,10 +156,10 @@ protected:
|
|||
virtual bool
|
||||
UpdateValue ();
|
||||
|
||||
virtual bool
|
||||
virtual LazyBool
|
||||
CanUpdateWithInvalidExecutionContext ()
|
||||
{
|
||||
return true;
|
||||
return eLazyBoolYes;
|
||||
}
|
||||
|
||||
virtual ClangASTType
|
||||
|
|
|
|||
|
|
@ -109,12 +109,14 @@ ValueObjectChild::GetDisplayTypeName()
|
|||
return display_name;
|
||||
}
|
||||
|
||||
bool
|
||||
LazyBool
|
||||
ValueObjectChild::CanUpdateWithInvalidExecutionContext ()
|
||||
{
|
||||
if (m_parent)
|
||||
return m_parent->CanUpdateWithInvalidExecutionContext();
|
||||
return this->ValueObject::CanUpdateWithInvalidExecutionContext();
|
||||
ValueObject* opinionated_ancestor = FollowParentChain([] (ValueObject* vo) -> bool {
|
||||
return (vo->CanUpdateWithInvalidExecutionContext() == eLazyBoolCalculate);
|
||||
});
|
||||
|
||||
return opinionated_ancestor ? opinionated_ancestor->CanUpdateWithInvalidExecutionContext() : this->ValueObject::CanUpdateWithInvalidExecutionContext();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
Loading…
Reference in New Issue