Skip to content

[lldb] Add a heuristic for handling DW_AT_specification #10289

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

adrian-prantl
Copy link

in sized containers. Due to a limitation of LLVM, the Swift frontend cannot add a DW_AT_specification attribute to a forward declaration, so it attaches it to the outer, anonymous, sized container. LLDB dutyfully follows specification attributes and collects everything into one list of attributes, which results in the anonymous container inheriting the names of the DIE linked by DW_AT_specification. This patch adds a heuristic to detect this situation.

The correct thing to do here would be to fix LLVM to allow a forward declaration to have a specification, or potentially even better designate a new attribute for this.

in sized containers. Due to a limitation of LLVM, the Swift frontend
cannot add a DW_AT_specification attribute to a forward declaration,
so it attaches it to the outer, anonymous, sized container. LLDB
dutyfully follows specification attributes and collects everything
into one list of attributes, which results in the anonymous container
inheriting the names of the DIE linked by DW_AT_specification. This
patch adds a heuristic to detect this situation.

The correct thing to do here would be to fix LLVM to allow a forward
declaration to have a specification, or potentially even better
designate a new attribute for this.
@adrian-prantl adrian-prantl requested a review from a team as a code owner March 19, 2025 00:15
@adrian-prantl
Copy link
Author

test with swiftlang/swift#80078
@swift-ci test

@adrian-prantl adrian-prantl merged commit a5a7ef3 into swiftlang:stable/20240723 Mar 19, 2025
3 checks passed
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