-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Load embedded type summary section #7859
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
[lldb] Load embedded type summary section #7859
Conversation
5ce447d
to
7f3c702
Compare
@swift-ci test |
@swift-ci test |
@swift-ci test Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
lldb/source/Target/Target.cpp
Outdated
summaries_sp = data_sp->GetChildren().FindSectionByName( | ||
ConstString("__lldbsummaries")); | ||
} else if (triple.isOSLinux() || triple.isOSWindows()) { | ||
summaries_sp = sections->FindSectionByName(ConstString(".lldbsummaries")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This knowledge about the exact section name should be abstracted behind a virtual method in ObjectFile, which (at least in the LLVM variant) already has a mechanism to access differently named sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is the only place the names are used, I wonder if it's worth adding abstraction, worth expanding the ObjectFile
interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also SwiftObjectFileFormat
at swift/include/swift/ABI/ObjectFile.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting forward a question, I will say: I think it's there's value in not adding abstraction in this case. My arguments against adding an abstraction are:
- These names aren't used anywhere else, and I don't see that changing
- Divides the knowledge across multiple files vs having the names in one place
- Expands the API of
ObjectFile
etc
If in the future these names do get used from multiple locations, the abstraction can be added at that time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding cases to FindSectionByType?
https://lldb.llvm.org/cpp_reference/classlldb__private_1_1SectionList.html#ad8f56673377eb9d1fc130724d1ef6a4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 137a211
@swift-ci test |
@swift-ci test windows |
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci test |
@swift-ci test |
@swift-ci test windows |
Add support for type summaries embedded into the binary. These embedded summaries will typically be generated by macros, but can be generated by any other means. rdar://115184658 (cherry picked from commit a614c4d)
…#8040) Add support for type summaries embedded into the binary. These embedded summaries will typically be generated by Swift macros, but can also be generated by any other means. rdar://115184658
…#8040) Add support for type summaries embedded into the binary. These embedded summaries will typically be generated by Swift macros, but can also be generated by any other means. rdar://115184658
…#8040) Add support for type summaries embedded into the binary. These embedded summaries will typically be generated by Swift macros, but can also be generated by any other means. rdar://115184658
Add support for type summaries embedded into the binary.
These embedded summaries will typically be generated by macros, but can be generated by any other means.
rdar://115184658