Skip to content

[lldb] Add support for structs and tuple info lookup from DWARF #7775

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

augusto2112
Copy link

To support embedded Swift, lldb will need to support reading type information from DWARF instead of reflection metadata (whivh it corrently relies on). This patch implements the DescriptorFinder interface by DWARFASTParserSwift, which allows it to provide the data necessary for type info reconstruction without relying on reflection metadata.

@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

swiftlang/swift#69752
@swift-ci test

1 similar comment
@augusto2112
Copy link
Author

swiftlang/swift#69752
@swift-ci test

# Check if we should compile in Swift embedded mode
#----------------------------------------------------------------------
ifeq "$(SWIFT_EMBEDDED_MODE)" "1"
SWIFTFLAGS += -gdwarf-types -enable-experimental-feature Embedded -Xfrontend -disable-objc-interop

Choose a reason for hiding this comment

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

Should -enable-experimental-feature Embedded imply -gdwarf-types?

Choose a reason for hiding this comment

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

I guess it shouldn't turn on debug info if it's off

Choose a reason for hiding this comment

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

What I'm trying to say is: The swift-driver should turn -g -enable-experimental-feature Embedded into -gdwarf-types -enable-experimental-feature Embedded. Feel free to make this a separate commit

@augusto2112
Copy link
Author

@swift-ci test Windows

@augusto2112
Copy link
Author

@swift-ci test


// TODO: this seems simple to calculate but maybe we should encode the stride
// in DWARF? That's what reflection metadata does.
unsigned stride = ((byte_size + alignment - 1) & ~(alignment - 1));

Choose a reason for hiding this comment

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

Should this use llvm::alignTo for better readability? https://llvm.org/doxygen/namespacellvm.html#a0654c8f28b6096222fdc77c843576ad6

Copy link
Author

Choose a reason for hiding this comment

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

I actually tried using that before, but it isn't the same operation as llvm::alignTo (or any other function in math extras that I could find).

@augusto2112
Copy link
Author

@swift-ci test macOS

@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test Windows

To support embedded Swift, lldb will need to support reading type
information from DWARF instead of reflection metadata (whivh it
corrently relies on). This patch implements the DescriptorFinder
interface by DWARFASTParserSwift, which allows it to provide the data
necessary for type info reconstruction without relying on reflection
metadata.
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test Windows

@augusto2112 augusto2112 merged commit 3d6e0f9 into swiftlang:stable/20230725 Nov 16, 2023
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.

2 participants