summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-07-28 01:45:23 +0000
committerEnrico Granata <egranata@apple.com>2015-07-28 01:45:23 +0000
commit2e9f29932d8eba649f21a56c2e15f4c0c19ffd21 (patch)
treefa51225b54358dd11104dab1fe8ad6fc480db9fd
parent522b1d14efe523b983eea899ab07524b27d14ff7 (diff)
downloadbcm5719-llvm-2e9f29932d8eba649f21a56c2e15f4c0c19ffd21.tar.gz
bcm5719-llvm-2e9f29932d8eba649f21a56c2e15f4c0c19ffd21.zip
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
-rw-r--r--lldb/include/lldb/Core/ValueObject.h6
-rw-r--r--lldb/include/lldb/Core/ValueObjectChild.h5
-rw-r--r--lldb/include/lldb/Core/ValueObjectDynamicValue.h4
-rw-r--r--lldb/include/lldb/Core/ValueObjectSyntheticFilter.h4
-rw-r--r--lldb/source/Core/ValueObjectChild.cpp17
5 files changed, 24 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..6472deff873 100644
--- a/lldb/include/lldb/Core/ValueObjectChild.h
+++ b/lldb/include/lldb/Core/ValueObjectChild.h
@@ -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
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..dd7e05715d6 100644
--- a/lldb/source/Core/ValueObjectChild.cpp
+++ b/lldb/source/Core/ValueObjectChild.cpp
@@ -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
OpenPOWER on IntegriCloud