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-9928] lldb Xcode 10.2 regression: lldb does not show source file when using target.source-map with breakpoints #4608
Comments
This isn't really the place to report LLDB bugs that aren't about Swift, but I'll tag one of them anyway: @adrian-prantl |
Should be fixed by apple/swift-lldb#1302 |
FYI @belkadan this is actually a Swift bug although the description mentions a .m file. |
Ah, sorry for being overzealous, then, David! |
Comment by David Goldman (JIRA) Still showing assembly with Xcode 10.2 beta 4 |
What does the types log say? |
Comment by David Goldman (JIRA) Perhaps there were two different errors? I don't see the remapping in the types log anymore, but I do still see assembly instead of the source file for the example project. |
Comment by David Goldman (JIRA) @adrian-prantl My bad, it looks as if I was using the wrong version of Xcode. I'm no longer seeing issues with breakpoints with Xcode 10.2 beta 4, but I'm still seeing issues with `po <variable>`, I believe you might have missed the `-fmodule-map-file=` flag in your change. |
Comment by Nicholas Levin (JIRA) I can't recreate the po issues with the sample project that was given. ~/.lldbinit contents:
LLDB output:
I think the specific issue outlined by the sample project has been fully resolved. Working with David right now to see if an -fmodulemap-file based sample Xcode project can be made for a new Xcode 10.2/Swift 5 bug. |
Attachment: Download
Environment
Xcode 10.2 and Swift Development Snapshot 2018-12-18 (a) Toolchain, possibly due to
apple/swift-lldb@327df73#diff-d2637d31d2f0d43dbf858b42da33f62d?
Additional Detail from JIRA
md5: cc3d12117e1dd112d037d37f12268568
Issue Description:
As of Xcode 10.2, lldb only shows assembly for files compiled with `-fdebug-prefix-map=$(PROJECT_DIR)=.` (which makes debug info relative to the source root) which are then remapped to the proper PROJECT_DIR via ~/.lldbinit's `target.source-map` setting (e.g. `settings set target.source-map "./" "/SOURCE_ROOT/"`).
With Xcode 10, the source file properly shows up instead of assembly (e.g. `main.m` in the attached Xcode project).
Steps to Reproduce:
1) Unzip attached Xcodeproj
2) Modify your ~/.lldbinit to be `settings set target.source-map "./" "<path to TargetSourceMapIssue folder>/"`
3) Open Xcodeproj with Xcode 10.2 and set a breakpoint on main.m:21 via the Xcode UI.
4) Run.
5) Note that the breakpoint hits but the source file does not resolve - only assembly is shown.
Other information:
It looks as if target.source-map somehow is being applied to flags:
In ~/.lldbinit:
settings set target.source-map "./" "/SOURCE_ROOT/" (after `log enable lldb types`)
In Xcode's LLDB (after `log enable lldb types`):
```
remapped -iquote/BUILD_ROOT -> /SOURCE_ROOT-iquote/BUILD_ROOT
remapped -O0 -> /SOURCE_ROOT-O0
remapped -DDEBUG=1 -> /SOURCE_ROOT-DDEBUG=1
remapped -fstack-protector -> /SOURCE_ROOT-fstack-protector
remapped -fstack-protector-all -> /SOURCE_ROOT-fstack-protector-all
remapped -fdebug-prefix-map=/BUILD_ROOT=. -> /SOURCE_ROOT-fdebug-prefix-map=/BUILD_ROOT=.
remapped -iquote/BUILD_ROOT/folder -> /SOURCE_ROOT-iquote/BUILD_ROOT/folder
remapped -iquote/BUILD_ROOT -> /SOURCE_ROOT-iquote/BUILD_ROOT
remapped -O0 -> /SOURCE_ROOT-O0
remapped -fstack-protector -> /SOURCE_ROOT-fstack-protector
remapped -fstack-protector-all -> /SOURCE_ROOT-fstack-protector-all
remapped -fdebug-prefix-map=/BUILD_ROOT=. -> /SOURCE_ROOT-fdebug-prefix-map=/BUILD_ROOT=.
((Target*)0x7f8c686dbe00)->GetSwiftASTContext() returning NULL - couldn't create a ClangImporter
```
The text was updated successfully, but these errors were encountered: