-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix the hardcoded Swift AST section / segment name for Mach-O #32362
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
Conversation
to match the one specified in LLVM's Mach-O parser. Otherwise LLDB could not possibly find it! This name is used by the swift -modulewrap subcommand, which is currently unused on Darwin, and primarily intended for use under Linux. However, it may be useful to better support static archives (.a) files with Swift debug info in the future. To fully support this, dsymutil and LLDB need to know to look for Swift AST sections in Mach-O objects other than .dSYM bundled. Implementation note: It would be nice to get the section name out of libObject, but with the current architecture this needs a major refactoring that didn't seem justified, given that there is an end-to-end test to prevent such a mishap in the future. <rdar://problem/63991514>
@swift-ci test |
@swift-ci please test |
@adrian-prantl - do we need to worry about compatibility? The older segment/section has shipped, so what do we do about existing binaries? |
@compnerd This patch only affects Mach-O, and LLDB is unable to find the section under this name. To my knowledge, no one is using -modulewrap on Darwin. In its place there is the ld64 |
Ah, awesome! I didn't know that |
@compnerd The backstory here is, I added -modulewrap specifically for Linux (Windows wasn't really a thing yet) because we don't control the ELF linker and ELF linkers store the debug info in the executable anyway. |
Thanks, looks good, we might consolidate some definitions into a shared header as a follow up. |
I looked at that, and it's a massive refactoring for very little gain. I thought it would be nice to encode the section names in Dwarf.def, but there is so much extra data there, that I shied away from it. Doable, but quite a big patch. |
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.
LG
to match the one specified in LLVM's Mach-O parser.
Otherwise LLDB could not possibly find it!
This name is used by the swift -modulewrap subcommand, which is currently unused
on Darwin, and primarily intended for use under Linux. However, it may be useful
to better support static archives (.a) files with Swift debug info in the
future. To fully support this, dsymutil and LLDB need to know to look for Swift
AST sections in Mach-O objects other than .dSYM bundled.
Implementation note: It would be nice to get the section name out of libObject,
but with the current architecture this needs a major refactoring that didn't
seem justified, given that there is an end-to-end test to prevent such a mishap
in the future.
rdar://problem/63991514