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-10822] Swift 5.x LLDB fails on Linux with "error: failed to get module 'MyApp' from AST context" #4565
Comments
cc @dcci |
This is something that @adrian-prantl knows best. |
Can you add "log enable lldb types -f /tmp/types.log" to ~/.lldbinit, relaunch lldb, reproduce the issue and upload /tmp/types.log? It will contain all the info we need to diagnose the issue. |
Comment by Edward Connell (JIRA) Okay done! Hey thanks for checking this out. |
> lldb Found 0 AST file data entries for library: /home/ed/hello/.build/debug/hello. > lldb ((SwiftASTContext*)0x24e55f0)->GetModule('hello') This indicates that LLDB may have had trouble finding the .swiftmodule for "hello". How did you compile your program? |
Can you paste the swiftc invocation that you used for hello and then also append `-###` at the end and paste the result of that? |
Comment by Edward Connell (JIRA) I just added a terminal transcript from start to finish. I use the swift package manager to create the project. On line 16, I gedit "main.swift" and paste in the following contents. struct MyStruct{
var a: Int = 0
var b: Int = 42
}
var data = MyStruct()
print("Hello, world! data: (data)") // set a breakpoint here break on line 8 and try to examine "data", it bombs. |
This may be the known issue of the Swift package manager not performing the modulewrap action. I'll need to try and reproduce to confirm. When you compile hello.swift with swiftc directly (not using swiftopm), does debugging work? |
Comment by Edward Connell (JIRA) I just tried it. Yes, using "swiftc -g main.swift" debugging works. So it's an SPM issue. I guess I will need to use an external build system like CMake. I really appreciate you helping me with this. I have to say, I am really surprised Apple would allow a product release without testing one of the most obvious features like build and debug. I also can't believe it hasn't already been fixed. Anyway, thank you so much for your help. Have a great day, Ed |
@neonichu do you have an existing swiftpm JIRA ticked this should be duped to? I think the problem here is that similar how on macOS swiftpm doesn't add -add-ast-path to the linker invocation, it (presumable) also doesn't invoke the modulewrap action on Linux. |
(This could actually make for a nice starter bug?) |
Attachment: Download
Environment
Ubuntu 16.04, 18.04, or the official swift docker images for Linux. They all fail.
Additional Detail from JIRA
md5: 0a2586239d4df0ce1604b3fbefb62b96
Issue Description:
Using any version of Swift 5.x on Ubuntu 18.04 (and 16.04) I can run and step though an app, but I am unable to examine any variables in lldb. It just bombs with "failed to get module 'MyApp' from AST context".
The Swift 4.2 toolchain works fine.
I tried the Swift latest docker image for ubuntu 18.04 and it fails also, which means it has nothing to do with my installation.
This is blocking all work for my company. Please fix this quickly or provide a workaround.
Thanks, Ed
The text was updated successfully, but these errors were encountered: