diff options
author | Enrico Granata <egranata@apple.com> | 2015-07-24 00:57:19 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-07-24 00:57:19 +0000 |
commit | 636cd262d6ae996e76faba51e24eccb603e7e42f (patch) | |
tree | abed501fc4ca48cc644a309d350f4757317f04ff /lldb | |
parent | 29e9ae7891ea7758657cb2d3636b749051834c90 (diff) | |
download | bcm5719-llvm-636cd262d6ae996e76faba51e24eccb603e7e42f.tar.gz bcm5719-llvm-636cd262d6ae996e76faba51e24eccb603e7e42f.zip |
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
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 6 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObjectChild.h | 2 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObjectDynamicValue.h | 4 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObjectSyntheticFilter.h | 4 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectChild.cpp | 10 |
5 files changed, 14 insertions, 12 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index cdc507093b2..a7fb62ee17e 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -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 diff --git a/lldb/include/lldb/Core/ValueObjectChild.h b/lldb/include/lldb/Core/ValueObjectChild.h index bf8707ea3b0..b34368cd482 100644 --- a/lldb/include/lldb/Core/ValueObjectChild.h +++ b/lldb/include/lldb/Core/ValueObjectChild.h @@ -84,7 +84,7 @@ protected: virtual bool UpdateValue (); - virtual bool + virtual LazyBool CanUpdateWithInvalidExecutionContext (); virtual ClangASTType diff --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h b/lldb/include/lldb/Core/ValueObjectDynamicValue.h index 8d42706be16..21f5f2f6072 100644 --- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h +++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h @@ -109,10 +109,10 @@ protected: virtual bool UpdateValue (); - virtual bool + virtual LazyBool CanUpdateWithInvalidExecutionContext () { - return true; + return eLazyBoolYes; } virtual lldb::DynamicValueType diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h index 88824ef4fa5..87b30b267f4 100644 --- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -156,10 +156,10 @@ protected: virtual bool UpdateValue (); - virtual bool + virtual LazyBool CanUpdateWithInvalidExecutionContext () { - return true; + return eLazyBoolYes; } virtual ClangASTType diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp index c1e45e1f48d..06c311f22cf 100644 --- a/lldb/source/Core/ValueObjectChild.cpp +++ b/lldb/source/Core/ValueObjectChild.cpp @@ -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 |