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
[SR-3280] Package manager should link main swiftmodule in executables #5164
Comments
Comment by Jan Paul (JIRA) The problem doesnt' exist when I build the main.swift manually via swiftc -g main.swift just in case there was doubt 😉 |
This looks like a problem with the compiler or lldb. lldb doesn't work when we use create executable via objects: $ cat main.swift This works: This doesn't: -- Toolchain: swift-DEVELOPMENT-SNAPSHOT-2016-11-15-a-ubuntu16.04 |
That's correct. Swift needs to include the swiftmodule in the debug info, so if you link in a separate step it doesn't have a chance to do that. Take a look at what swiftc -### does. |
Comment by Jin Mingling (JIRA) this seem more critical because the SPM debug outcome can not be debugged. do we have some workaround, such as some flag to let lldb(swift version) load swiftmodule info by manual? |
This is fixed right? |
Nope, see PR |
The problem is package manager need to link main swiftmodule with the executable to make them debuggable. The PR #933 on package manager is currently blocked by SR-3863 (duped by SR-2660). It looks like the debugging works fine without linking swiftmodule if there is a search path to the system module package. So if you invoke swiftpm with it, debugging will work: or if you convert the system module to a "fake" Clang module, swiftpm will automatically add a search path. This is of course not the correct solution but maybe is useful in the mean time. |
@aciidb0mb3r/@neonichu any updates on this? Apparently this is blocking all debugging on Linux and also partially on macOS. |
I believe this is fixed in Swift 5.3. Comments in SR-11543 also suggest that this is fixed. |
Additional Detail from JIRA
md5: cd20a7b4bf80be0100567d8c27f63fe5
is blocked by:
is duplicated by:
relates to:
Issue Description:
Upon creation of empty packgage of type --executable when I build the package via swift build. I receive a binary that works, but isn't debuggable.
The text was updated successfully, but these errors were encountered: