Skip to content

[lldb] Add Foundation._NSSwiftTimeZone support #8034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lldb/source/Plugins/Language/ObjC/Cocoa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ bool lldb_private::formatters::NSTimeZoneSummaryProvider(
stream.Printf("%s", summary_stream.GetData());
return true;
}
} else if (class_name == "_NSSwiftTimeZone") {
llvm::ArrayRef<llvm::StringRef> identifier_path = {"timeZone", "_timeZone",
"some", "identifier"};
if (auto identifier_sp = valobj.GetChildAtNamePath(identifier_path)) {
std::string desc;
if (identifier_sp->GetSummaryAsCString(desc, options)) {
stream.PutCString(desc);
return true;
}
}
}

return false;
Expand Down
5 changes: 5 additions & 0 deletions lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ LoadFoundationValueTypesFormatters(lldb::TypeCategoryImplSP swift_category_sp) {
"Decimal summary provider", ConstString("Foundation.Decimal"),
TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true));

lldb_private::formatters::AddCXXSummary(
swift_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider,
"NSTimeZone summary provider", ConstString("Foundation._NSSwiftTimeZone"),
TypeSummaryImpl::Flags(summary_flags).SetDontShowChildren(true));

lldb_private::formatters::AddCXXSynthetic(
swift_category_sp,
lldb_private::formatters::swift::URLComponentsSyntheticFrontEndCreator,
Expand Down