Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Add LLDB formatters for types that live primarily in FoundationBase.
Browse files Browse the repository at this point in the history
  • Loading branch information
millenomi committed Jan 8, 2019
1 parent 83f0728 commit 19fcd66
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions source/Plugins/Language/Swift/SwiftLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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,
Expand All @@ -597,40 +604,80 @@ 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,
lldb_private::formatters::swift::Measurement_SummaryProvider,
"Measurement summary provider",
ConstString("Foundation.Measurement<Foundation.Unit>"),
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<FoundationBase.Unit>"),
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,
Expand All @@ -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
}

Expand Down

0 comments on commit 19fcd66

Please sign in to comment.