Skip to content

Respect the module ABI name when mangling for the debugger #73090

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 1 commit into from
Apr 18, 2024

Conversation

augusto2112
Copy link
Contributor

The mangled name produced for the debugger should match the one emitted in reflection metadata, otherwise LLDB will not be able to lookup types when the module is compiled with the -module-abi-name flag.

rdar://125848324

The mangled name produced for the debugger should match the one emitted
in reflection metadata, otherwise LLDB will not be able to lookup types
when the module is compiled with the -module-abi-name flag.

rdar://125848324
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

// reconstruct AST types from mangled names when using that attribute.
if ((RespectOriginallyDefinedIn ||
(module->getName().str() != SWIFT_CONCURRENCY_NAME &&
!module->getABIName().str().starts_with(
Copy link
Contributor

Choose a reason for hiding this comment

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

why starts_with?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a CMake variable:

# Add unique ABI prefix to swift-syntax libraries so that compiler libraries (e.g. sourcekitdInProc)
# can be used from tools that has its own swift-syntax libraries as SwiftPM dependencies.
set(SWIFT_MODULE_ABI_NAME_PREFIX "Compiler")

This is prefixed to swift-syntax. It could potentially be prefixed to some other special compiler library in the future, so I'm checking for that. Option 2 would be to specifically check for "CompilerSwiftSyntax"

@augusto2112
Copy link
Contributor Author

@swift-ci macOS

@adrian-prantl
Copy link
Contributor

@swift-ci test macos

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