You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before Xcode 10.2, a dSYM DBGSourcePathRemapping of `./` -> `source_dir` would work properly to remap paths in a given binary without impacting the loading of swift modules in lldb.
In Xcode 10.2, this is no longer the case. A dSYM DBGSourcePathRemapping of `./` -> `source_dir` breaks lldb's ability to load swift modules, which means that swift objects cannot be `po`'d.
See also rdar://47642498 as target.source-map seems to suffer from similar issues leading me to believe this is a general problem with relative path handling introduced into swift-lldb between Xcode 10.1 and Xcode 10.2.
Steps to Reproduce:
1) Unzip the attached xcodeproj
2) Open the attached xcodeproj in Xcode 10.2 (beta 2 or 1). Note that the DBGRemappingSwift target is the same as the DBGRemappingSwiftNoPrefixMap target besides the `-debug-prefix-map` that the DBGRemappingSwift target has (this flag was introduced in Swift 5)
3) Set a breakpoint on each main.swift line 15.
4) Run the DBGRemappingSwift target, observe that the breakpoint hits but `po terminal` fails.
5) Run the DBGRemappingSwiftNoPrefixMap target, observe that the breakpoint hits but `po terminal` fails.
6) Doing the same thing but with Xcode 10.1, the DBGRemappingSwiftNoPrefixMap can be debugged just fine (although the DBGRemappingSwift target won't build as it requires Swift 5).
7) If you modify the DBGRemappingSwiftNoPrefixMap target's `Create dSYM Remappings` `Run Script Phase` to change `./` to anything else, note that the target can then be debugged without any issue. Doing the same for the `DBGRemappingSwift` target breaks breakpoints since it relies on `-debug-prefix-map` and `DBGSourcePathRemapping` working together.
Results: (lldb) po terminal
Error while loading Swift module: DBGRemappingSwiftNoPrefixMap Debug info from this module will be unavailable in the debugger. error: warning: failed to get module 'DBGRemappingSwiftNoPrefixMap' from AST context error: in auto-import: failed to get module 'DBGRemappingSwiftNoPrefixMap' from AST context
The text was updated successfully, but these errors were encountered:
With his suggestions, removing `SWIFT_FORCE_STATIC_LINK_STDLIB=YES` from the sample Xcode project settings and adding `${DEVELOPER_DIR}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx` to runpath search paths, this seems to have been fixed in Xcode 10.2 beta 4.
Attachment: Download
Environment
Xcode 10.2, beta 1 and 2
Additional Detail from JIRA
md5: 8cc3764088e38135d7e41b2d4797f6a5
Issue Description:
Before Xcode 10.2, a dSYM DBGSourcePathRemapping of `./` -> `source_dir` would work properly to remap paths in a given binary without impacting the loading of swift modules in lldb.
In Xcode 10.2, this is no longer the case. A dSYM DBGSourcePathRemapping of `./` -> `source_dir` breaks lldb's ability to load swift modules, which means that swift objects cannot be `po`'d.
See also rdar://47642498 as target.source-map seems to suffer from similar issues leading me to believe this is a general problem with relative path handling introduced into swift-lldb between Xcode 10.1 and Xcode 10.2.
Steps to Reproduce:
1) Unzip the attached xcodeproj
2) Open the attached xcodeproj in Xcode 10.2 (beta 2 or 1). Note that the DBGRemappingSwift target is the same as the DBGRemappingSwiftNoPrefixMap target besides the `-debug-prefix-map` that the DBGRemappingSwift target has (this flag was introduced in Swift 5)
3) Set a breakpoint on each main.swift line 15.
4) Run the DBGRemappingSwift target, observe that the breakpoint hits but `po terminal` fails.
5) Run the DBGRemappingSwiftNoPrefixMap target, observe that the breakpoint hits but `po terminal` fails.
6) Doing the same thing but with Xcode 10.1, the DBGRemappingSwiftNoPrefixMap can be debugged just fine (although the DBGRemappingSwift target won't build as it requires Swift 5).
7) If you modify the DBGRemappingSwiftNoPrefixMap target's `Create dSYM Remappings` `Run Script Phase` to change `./` to anything else, note that the target can then be debugged without any issue. Doing the same for the `DBGRemappingSwift` target breaks breakpoints since it relies on `-debug-prefix-map` and `DBGSourcePathRemapping` working together.
Results: (lldb) po terminal
Error while loading Swift module: DBGRemappingSwiftNoPrefixMap Debug info from this module will be unavailable in the debugger. error: warning: failed to get module 'DBGRemappingSwiftNoPrefixMap' from AST context error: in auto-import: failed to get module 'DBGRemappingSwiftNoPrefixMap' from AST context
The text was updated successfully, but these errors were encountered: