When using a custom Swift toolchain (here: trunk snapshot May 26, 2020), lldb fails with an incompatible target error on a normal iOS project:
::GetInstanceVariableOffset_Metadata() – ivar_name = _url, type = Foundation.URL
warning: Swift error in fallback scratch context: error: module 'Swift' was created for incompatible target x86_64-apple-ios13.0-simulator: /Users/steipete/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Swift-3K8REJ00QGV2U.swiftmodule
note: This error message is displayed only once. If the error displayed above is due to conflicting search paths to Clang modules in different images of the debugged executable, this can slow down debugging of Swift code significantly, since a fresh Swift context has to be created every time a conflict is encountered.
SwiftASTContextForExpressions::SetTriple("x86_64-apple-ios12.0.0") setting to "x86_64-apple-ios12.0.0"
Full log with lldb type logging enabled:
This is unexpected and only with bumping ideas back with Johannes Weiss I found out that I can fix this by changing the iOS Deployment Target to 13. It was set to 12 before, since our project still supports iOS 12. A barebones example with the issue is attached.
I would expect that using a Swift toolchain works like the integrated toolchain that comes with Xcode. Debugging works fine If I move the toolchain back to the Xcode 11.5 default.