From 3b207c66552297f35a3c8045ea979a0f53b08ce1 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Fri, 8 Jul 2016 18:39:36 +0000 Subject: [PATCH] Make IsSyntheticChildrenGenerated() virtual so that dynamic and synthetic values can refer back to their parents llvm-svn: 274901 --- lldb/include/lldb/Core/ValueObject.h | 4 ++-- lldb/include/lldb/Core/ValueObjectDynamicValue.h | 6 ++++++ .../lldb/Core/ValueObjectSyntheticFilter.h | 6 ++++++ lldb/source/Core/ValueObjectDynamicValue.cpp | 16 ++++++++++++++++ lldb/source/Core/ValueObjectSyntheticFilter.cpp | 16 ++++++++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index b3f6ff82f3d9..bef158feb39d 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -793,10 +793,10 @@ public: return false; } - bool + virtual bool IsSyntheticChildrenGenerated (); - void + virtual void SetSyntheticChildrenGenerated (bool b); virtual SymbolContextScope * diff --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h b/lldb/include/lldb/Core/ValueObjectDynamicValue.h index 80f37f104765..8a045c3b0db1 100644 --- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h +++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h @@ -117,6 +117,12 @@ public: void SetPreferredDisplayLanguage (lldb::LanguageType); + + bool + IsSyntheticChildrenGenerated () override; + + void + SetSyntheticChildrenGenerated (bool b) override; bool GetDeclaration(Declaration &decl) override; diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h index 3a8068298e27..38d9f7b5ade1 100644 --- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h +++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h @@ -147,6 +147,12 @@ public: void SetPreferredDisplayLanguage (lldb::LanguageType); + bool + IsSyntheticChildrenGenerated () override; + + void + SetSyntheticChildrenGenerated (bool b) override; + bool GetDeclaration(Declaration &decl) override; diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index 0ac86a68f19f..65deba096d82 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -418,6 +418,22 @@ ValueObjectDynamicValue::GetPreferredDisplayLanguage () return m_preferred_display_language; } +bool +ValueObjectDynamicValue::IsSyntheticChildrenGenerated () +{ + if (m_parent) + return m_parent->IsSyntheticChildrenGenerated(); + return false; +} + +void +ValueObjectDynamicValue::SetSyntheticChildrenGenerated (bool b) +{ + if (m_parent) + m_parent->SetSyntheticChildrenGenerated(b); + this->ValueObject::SetSyntheticChildrenGenerated(b); +} + bool ValueObjectDynamicValue::GetDeclaration (Declaration &decl) { diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp index 53e38ecd3fe1..f2f233711b9c 100644 --- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp +++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp @@ -416,6 +416,22 @@ ValueObjectSynthetic::GetPreferredDisplayLanguage () return m_preferred_display_language; } +bool +ValueObjectSynthetic::IsSyntheticChildrenGenerated () +{ + if (m_parent) + return m_parent->IsSyntheticChildrenGenerated(); + return false; +} + +void +ValueObjectSynthetic::SetSyntheticChildrenGenerated (bool b) +{ + if (m_parent) + m_parent->SetSyntheticChildrenGenerated(b); + this->ValueObject::SetSyntheticChildrenGenerated(b); +} + bool ValueObjectSynthetic::GetDeclaration (Declaration &decl) {