[Lldb-commits] [lldb] r192741 - <rdar://problem/15235492>
Enrico Granata
egranata at apple.com
Tue Oct 15 15:42:14 PDT 2013
Author: enrico
Date: Tue Oct 15 17:42:14 2013
New Revision: 192741
URL: http://llvm.org/viewvc/llvm-project?rev=192741&view=rev
Log:
<rdar://problem/15235492>
Extend DummySyntheticProvider to actually use debug-info vended children as the source of information
Make Python synthetic children either be valid, or fallback to the dummy, like their C++ counterparts
This allows LLDB to actually stop bailing out upon encountering an invalid synthetic children provider front-end, and still displaying the non synthetized ivar info
Modified:
lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=192741&r1=192740&r2=192741&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Tue Oct 15 17:42:14 2013
@@ -532,6 +532,12 @@ namespace lldb_private {
FrontEnd (std::string pclass,
ValueObject &backend);
+ bool
+ IsValid ()
+ {
+ return m_wrapper_sp.get() != nullptr && m_wrapper_sp->operator bool() && m_interpreter != nullptr;
+ }
+
virtual
~FrontEnd ();
@@ -581,8 +587,11 @@ namespace lldb_private {
virtual SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend)
{
- return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));
- }
+ auto synth_ptr = SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));
+ if (synth_ptr && ((FrontEnd*)synth_ptr.get())->IsValid())
+ return synth_ptr;
+ return NULL;
+ }
private:
DISALLOW_COPY_AND_ASSIGN(ScriptedSyntheticChildren);
Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=192741&r1=192740&r2=192741&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Tue Oct 15 17:42:14 2013
@@ -30,19 +30,19 @@ public:
size_t
CalculateNumChildren()
{
- return 0;
+ return m_backend.GetNumChildren();
}
lldb::ValueObjectSP
GetChildAtIndex (size_t idx)
{
- return lldb::ValueObjectSP();
+ return m_backend.GetChildAtIndex(idx, true);
}
size_t
GetIndexOfChildWithName (const ConstString &name)
{
- return UINT32_MAX;
+ return m_backend.GetIndexOfChildWithName(name);
}
bool
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=192741&r1=192740&r2=192741&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Oct 15 17:42:14 2013
@@ -801,6 +801,12 @@ FormatManager::LoadLibcxxFormatters()
#endif
}
+static SyntheticChildrenFrontEnd*
+FooStructSynth (CXXSyntheticChildren*, lldb::ValueObjectSP)
+{
+ return NULL;
+}
+
void
FormatManager::LoadSystemFormatters()
{
@@ -834,6 +840,8 @@ FormatManager::LoadSystemFormatters()
sys_category_sp->GetSummaryNavigator()->Add(ConstString("unsigned char *"), string_format);
sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
+ AddCXXSynthetic(sys_category_sp, FooStructSynth, "Foo synth", ConstString("Foo"), ScriptedSyntheticChildren::Flags(), false);
+
lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
.SetSkipPointers(true)
.SetSkipReferences(true)
Modified: lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py?rev=192741&r1=192740&r2=192741&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py Tue Oct 15 17:42:14 2013
@@ -58,7 +58,7 @@ class DataFormatterOSTypeTestCase(TestBa
# Now check that we use the right summary for OSType
self.expect('frame variable',
- substrs = ["(OSType) a = 1952805748 'test'","(OSType) b = 1650815860 'best'"])
+ substrs = ["'test'","'best'"])
if __name__ == '__main__':
More information about the lldb-commits
mailing list