Skip to content

[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

Merged

Conversation

kastiglione
Copy link

@kastiglione kastiglione commented Dec 8, 2023

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

@kastiglione kastiglione marked this pull request as draft December 8, 2023 00:17
@kastiglione kastiglione force-pushed the dl/lldb-Load-embedded-type-summary-section branch from 5ce447d to 7f3c702 Compare December 8, 2023 00:20
@kastiglione kastiglione marked this pull request as ready for review December 8, 2023 18:34
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test Windows

Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

summaries_sp = data_sp->GetChildren().FindSectionByName(
ConstString("__lldbsummaries"));
} else if (triple.isOSLinux() || triple.isOSWindows()) {
summaries_sp = sections->FindSectionByName(ConstString(".lldbsummaries"));

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.

Copy link
Author

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?

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

Copy link
Author

@kastiglione kastiglione Dec 8, 2023

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that, thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 137a211

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test windows

@kastiglione
Copy link
Author

@swift-ci test

1 similar comment
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione
Copy link
Author

@swift-ci test windows

@kastiglione kastiglione merged commit a614c4d into stable/20230725 Dec 11, 2023
@kastiglione kastiglione deleted the dl/lldb-Load-embedded-type-summary-section branch December 11, 2023 21:43
kastiglione added a commit that referenced this pull request Jan 24, 2024
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)
kastiglione added a commit that referenced this pull request Jan 24, 2024
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)
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Oct 25, 2024
…#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
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Dec 10, 2024
…#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
adrian-prantl pushed a commit to adrian-prantl/llvm-project that referenced this pull request Dec 10, 2024
…#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants