From 19fcd6696fd5b8758d1f44edfa97afc4fc6482e4 Mon Sep 17 00:00:00 2001 From: Lily Vulcano Date: Tue, 8 Jan 2019 14:52:17 -0800 Subject: [PATCH] Add LLDB formatters for types that live primarily in FoundationBase. --- .../Plugins/Language/Swift/SwiftLanguage.cpp | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/source/Plugins/Language/Swift/SwiftLanguage.cpp b/source/Plugins/Language/Swift/SwiftLanguage.cpp index d75965b7c1d0..a700d525073c 100644 --- a/source/Plugins/Language/Swift/SwiftLanguage.cpp +++ b/source/Plugins/Language/Swift/SwiftLanguage.cpp @@ -563,6 +563,8 @@ static void LoadSwiftFormatters(lldb::TypeCategoryImplSP swift_category_sp) { ConstString("CoreGraphics.CGFloat"), summary_flags); AddStringSummary(swift_category_sp, "${var.native}", ConstString("Foundation.CGFloat"), summary_flags); + AddStringSummary(swift_category_sp, "${var.native}", + ConstString("FoundationBase.CGFloat"), summary_flags); #endif // LLDB_DISABLE_PYTHON } @@ -585,6 +587,11 @@ LoadFoundationValueTypesFormatters(lldb::TypeCategoryImplSP swift_category_sp) { "Foundation.Date summary provider", ConstString("Foundation.Date"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, lldb_private::formatters::swift::Date_SummaryProvider, + "FoundationBase.Date summary provider", ConstString("FoundationBase.Date"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::NotificationName_SummaryProvider, @@ -597,17 +604,38 @@ LoadFoundationValueTypesFormatters(lldb::TypeCategoryImplSP swift_category_sp) { "Notification.Name summary provider", ConstString("Foundation.Notification.Name"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, + lldb_private::formatters::swift::NotificationName_SummaryProvider, + "Notification.Name summary provider", + ConstString("FoundationBase.Notification.Type.Name"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, + lldb_private::formatters::swift::NotificationName_SummaryProvider, + "Notification.Name summary provider", + ConstString("FoundationBase.Notification.Name"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::URL_SummaryProvider, "URL summary provider", ConstString("Foundation.URL"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, lldb_private::formatters::swift::URL_SummaryProvider, + "URL summary provider", ConstString("FoundationBase.URL"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::IndexPath_SummaryProvider, "IndexPath summary provider", ConstString("Foundation.IndexPath"), summary_flags); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, + lldb_private::formatters::swift::IndexPath_SummaryProvider, + "IndexPath summary provider", ConstString("FoundationBase.IndexPath"), + summary_flags); lldb_private::formatters::AddCXXSummary( swift_category_sp, @@ -615,22 +643,41 @@ LoadFoundationValueTypesFormatters(lldb::TypeCategoryImplSP swift_category_sp) { "Measurement summary provider", ConstString("Foundation.Measurement"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, + lldb_private::formatters::swift::Measurement_SummaryProvider, + "Measurement summary provider", + ConstString("FoundationBase.Measurement"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::UUID_SummaryProvider, "UUID summary provider", ConstString("Foundation.UUID"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, lldb_private::formatters::swift::UUID_SummaryProvider, + "UUID summary provider", ConstString("FoundationBase.UUID"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::Data_SummaryProvider, "Data summary provider", ConstString("Foundation.Data"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, lldb_private::formatters::swift::Data_SummaryProvider, + "Data summary provider", ConstString("FoundationBase.Data"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSummary( swift_category_sp, lldb_private::formatters::swift::Decimal_SummaryProvider, "Decimal summary provider", ConstString("Foundation.Decimal"), TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); + lldb_private::formatters::AddCXXSummary( + swift_category_sp, + lldb_private::formatters::swift::Decimal_SummaryProvider, + "Decimal summary provider", ConstString("FoundationBase.Decimal"), + TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true)); lldb_private::formatters::AddCXXSynthetic( swift_category_sp, @@ -641,6 +688,15 @@ LoadFoundationValueTypesFormatters(lldb::TypeCategoryImplSP swift_category_sp) { .SetCascades(true) .SetSkipReferences(false) .SetNonCacheable(false)); + lldb_private::formatters::AddCXXSynthetic( + swift_category_sp, + lldb_private::formatters::swift::URLComponentsSyntheticFrontEndCreator, + "URLComponents synthetic children", + ConstString("FoundationBase.URLComponents"), SyntheticChildren::Flags() + .SetSkipPointers(true) + .SetCascades(true) + .SetSkipReferences(false) + .SetNonCacheable(false)); #endif }