Index: include/lldb/Core/ValueObjectDynamicValue.h =================================================================== --- include/lldb/Core/ValueObjectDynamicValue.h +++ include/lldb/Core/ValueObjectDynamicValue.h @@ -85,7 +85,7 @@ { return m_parent->GetSP(); } - + void SetOwningSP (lldb::ValueObjectSP &owning_sp) { @@ -105,6 +105,9 @@ virtual TypeImpl GetTypeImpl (); + virtual bool + GetDeclaration (Declaration &decl); + protected: virtual bool UpdateValue (); Index: include/lldb/Core/ValueObjectSyntheticFilter.h =================================================================== --- include/lldb/Core/ValueObjectSyntheticFilter.h +++ include/lldb/Core/ValueObjectSyntheticFilter.h @@ -152,6 +152,9 @@ virtual void SetFormat (lldb::Format format); + virtual bool + GetDeclaration (Declaration &decl); + protected: virtual bool UpdateValue (); Index: source/Core/ValueObjectDynamicValue.cpp =================================================================== --- source/Core/ValueObjectDynamicValue.cpp +++ source/Core/ValueObjectDynamicValue.cpp @@ -421,3 +421,12 @@ SetNeedsUpdate(); return ret_val; } + +bool +ValueObjectDynamicValue::GetDeclaration (Declaration &decl) +{ + if (m_parent) + return m_parent->GetDeclaration(decl); + + return ValueObject::GetDeclaration(decl); +} Index: source/Core/ValueObjectSyntheticFilter.cpp =================================================================== --- source/Core/ValueObjectSyntheticFilter.cpp +++ source/Core/ValueObjectSyntheticFilter.cpp @@ -314,3 +314,12 @@ this->ValueObject::SetFormat(format); this->ClearUserVisibleData(eClearUserVisibleDataItemsAll); } + +bool +ValueObjectSynthetic::GetDeclaration (Declaration &decl) +{ + if (m_parent) + return m_parent->GetDeclaration(decl); + + return ValueObject::GetDeclaration(decl); +} Index: test/python_api/formatters/TestFormattersSBAPI.py =================================================================== --- test/python_api/formatters/TestFormattersSBAPI.py +++ test/python_api/formatters/TestFormattersSBAPI.py @@ -169,6 +169,7 @@ foo_var = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable('foo') self.assertTrue(foo_var.IsValid(), 'could not find foo') + self.assertTrue(foo_var.GetDeclaration().IsValid(), 'foo declaration is invalid') self.assertTrue(foo_var.GetNumChildren() == 2, 'synthetic value has wrong number of child items (synth)') self.assertTrue(foo_var.GetChildMemberWithName('X').GetValueAsUnsigned() == 1, 'foo_synth.X has wrong value (synth)')