Skip to content
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-10686] LLDB fails for iOS when using custom Swift toolchains #4338

Closed
jpsim opened this issue May 14, 2019 · 16 comments
Closed

[SR-10686] LLDB fails for iOS when using custom Swift toolchains #4338

jpsim opened this issue May 14, 2019 · 16 comments
Assignees
Labels
bug Something isn't working LLDB for Swift

Comments

@jpsim
Copy link

jpsim commented May 14, 2019

Previous ID SR-10686
Radar rdar://problem/50894825
Original Reporter @jpsim
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

macOS Mojave 10.14.5 (18F132)
Xcode 10.2.1 (10E1001)
swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: 714e8c2d8326e82def6005df93ca8b68

duplicates:

  • SR-12932 Custom toolchain picks up wrong target based on iOS deployment target

Issue Description:

Setting a breakpoint in an empty iOS app's view controller's viewDidLoad method logs the following to the console:

warning: Swift error in fallback scratch context: <module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:94:18: error: 'UIWebView' is unavailable: not available on macOS
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                 ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:95:30: error: 'UIWebView' is unavailable: not available on macOS
- (void)webViewDidStartLoad:(UIWebView *)webView API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                             ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:96:31: error: 'UIWebView' is unavailable: not available on macOS
- (void)webViewDidFinishLoad:(UIWebView *)webView API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                              ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:97:18: error: 'UIWebView' is unavailable: not available on macOS
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                 ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

error: <EXPR>:6:8: error: could not build Objective-C module 'UIKit'
import UIKit
       ^



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.

error: expression failed to parse, unknown error

Attempting to print something produces the following log and error messages:

po self
error: warning: failed to get module "UIKit" from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:94:18: error: 'UIWebView' is unavailable: not available on macOS
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                 ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:95:30: error: 'UIWebView' is unavailable: not available on macOS
- (void)webViewDidStartLoad:(UIWebView *)webView API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                             ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:96:31: error: 'UIWebView' is unavailable: not available on macOS
- (void)webViewDidFinishLoad:(UIWebView *)webView API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                              ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/UIKit.h"
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:9:
#import <UIKit/UIKitCore.h>
        ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:9: note: in file included from /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h:187:
#import <UIKit/UIWebView.h>
        ^

error: /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:97:18: error: 'UIWebView' is unavailable: not available on macOS
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error API_DEPRECATED("No longer supported.", ios(2.0, 12.0));
                 ^

/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:42:133: note: 'UIWebView' has been explicitly marked unavailable here
UIKIT_EXTERN API_DEPRECATED("No longer supported; please adopt WKWebView.", ios(2.0, 12.0)) API_UNAVAILABLE(tvos, macos) @interface UIWebView : UIView <NSCoding, UIScrollViewDelegate>
                                                                                                                                    ^

error: could not build Objective-C module 'UIKit'


error: in auto-import:
failed to get module "LLDBNoContextRepro" from AST context
@jpsim
Copy link
Author

jpsim commented May 14, 2019

Filed following conversation here: https://twitter.com/slava_pestov/status/1128366446512418820

cc @slavapestov

@belkadan
Copy link

jingham@apple.com (JIRA User), @dcci, are we getting the wrong target somehow?

@swift-ci
Copy link

Comment by Jim Ingham (JIRA)

It does look like we think this is a macOS not an iOSSimulator binary. @adrian-prantl might have better guesses how that might happen...

@adrian-prantl
Copy link
Member

What's the output of

`(lldb) image list -t -f`

?

Also, can you capture a types log by putting

`lldb log enable types -f /tmp/types.log`

into ~/.lldbinit-Xcode and restarting Xcode and reproducing the issue?

@jpsim
Copy link
Author

jpsim commented May 17, 2019

I've attached the output of running image list -t -f both with and without the logging line to capture the types log you asked me to add to ~/.lldbinit-Xcode.

No file at /tmp/types.log was created either during the Xcode session or after. I'm not sure if that's what you expected.

Were you not able to reproduce this issue @adrian-prantl? It may be more practical to get you to reproduce the problem so you can debug in depth, otherwise we might be playing a very inefficient game of debug telephone back and forth.

I've attached a basic iOS app Xcode project that reproduces the problems for me with a breakpoint set on the super.viewDidLoad() line.

LLDBNoContextRepro.tar.gz

@adrian-prantl
Copy link
Member

> [ 0] x86_64--

Interesting: your application doesn't have a definitive operating system (in the sense of: LLDB doesn't properly detect it).

> Were you not able to reproduce this issue

Unfortunately, no, but I tried to reproduce it with my latest local build, not with a dowloaded toolchain. I will try that next. Thanks a lot for the project!

@adrian-prantl
Copy link
Member

@swift-ci create

@adrian-prantl
Copy link
Member

Could you please also attach the /tmp/types.log file you created?

@jpsim
Copy link
Author

jpsim commented May 17, 2019

No file at /tmp/types.log was created either during the Xcode session or after. I'm not sure if that's what you expected.

@adrian-prantl
Copy link
Member

Sorry

`lldb log enable types -f /tmp/types.log`

should have been

`log enable lldb types -f /tmp/types.log`

@jpsim
Copy link
Author

jpsim commented May 17, 2019

Thanks that worked. Attached the log.

@adrian-prantl
Copy link
Member

There we go:

 SwiftASTContext("LLDBNoContextRepro")::SetTriple("x86_64--macosx") setting to "x86_64--macosx12.2.0"
 SwiftASTContext("LLDBNoContextRepro")::DeserializeAllCompilerFlags() -- Found 1 AST file data entries.
 SwiftASTContext("LLDBNoContextRepro")::DeserializeAllCompilerFlags() -- SDK path from module "LLDBNoContextRepro" is "/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk".
 SwiftASTContext("LLDBNoContextRepro")::DeserializeAllCompilerFlags() -- Picking SDK path "/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk".
 SwiftASTContext("LLDBNoContextRepro")::CreateInstance() -- Found serialized triple x86_64-apple-ios12.2-simulator.
 SwiftASTContext("LLDBNoContextRepro")::SetTriple("x86_64-apple-ios12.2-simulator") setting to "x86_64-apple-ios12.2-simulator"
 SwiftASTContext("LLDBNoContextRepro")::CreateInstance() -- Got serialized SDK path /Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk.
 SwiftASTContext::GetResourceDir() -- trying ePathTypeSwiftDir: /Library/Developer/Toolchains/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Resources/Swift
 SwiftASTContext::GetResourceDir() -- trying toolchain path: /Library/Developer/Toolchains/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a.xctoolchain/
 SwiftASTContext::GetResourceDir() -- trying toolchain-based lib path: /Library/Developer/Toolchains/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a.xctoolchain/usr/lib/swift
 SwiftASTContext::GetResourceDir() -- found Swift resource dir via toolchain path + 'usr/lib/swift': /Library/Developer/Toolchains/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a.xctoolchain/usr/lib/swift
 SwiftASTContext("LLDBNoContextRepro")::GetASTContext() -- Using prebuilt module cache path: /Library/Developer/Toolchains/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a.xctoolchain/usr/lib/swift/macosx/prebuilt-modules
 SwiftASTContext("LLDBNoContextRepro")::RegisterSectionModules() -- retrieved 1 AST Data blobs from the symbol vendor.
 SwiftASTContext("LLDBNoContextRepro")::RegisterSectionModules() -- parsed module "LLDBNoContextRepro" from Swift AST section 1 of 1.
 SwiftASTContext("LLDBNoContextRepro")::GetModule("LLDBNoContextRepro")
 SwiftASTContext("LLDBNoContextRepro")::GetModule("LLDBNoContextRepro") -- error: error: module 'LLDBNoContextRepro' was created for incompatible target x86_64-apple-ios12.2-simulator: LLDBNoContextRepro

 SwiftASTContext("LLDBNoContextRepro")::CreateInstance((Module*)0x7fa871d574e8, "LLDBNoContextRepro") = 0x7fa811d0a7e0
 SwiftASTContext("LLDBNoContextRepro")::LogConfiguration(SwiftASTContext*)0x7fa811d0a7e0:
   Architecture                 : x86_64--macosx

@adrian-prantl
Copy link
Member

I tried now with 10E1001 + swift-5.1-DEVELOPMENT-SNAPSHOT-2019-05-09-a-osx.pkg and I still can't reproduce this...

Would you be able to do another run, this time with

settings set target.process.extra-startup-command QSetLogging:bitmask=LOG_RNB_REMOTE;
log enable gdb-remote all -f /tmp/packets.log

in your .lldbinit-Xcode ?

@jpsim
Copy link
Author

jpsim commented May 22, 2019

Done, I've uploaded packets.log.tgz

@adrian-prantl
Copy link
Member

Thank you. debugserver does report the platform correctly as ios-12.2:

<171430> read packet: ${"images":[{"load_address":4309229568,"mod_date":0,"pathname":"/Users/jsimard/Library/Developer/CoreSimulator/Devices/8FAE9403-9A71-45BE-9EDB-75838D23D3DD/data/Containers/Bundle/Application/5F2FF041-8231-4594-9DFD-238CF3EE4B7C/LLDBNoContextRepro.app/LLDBNoContextRepro","uuid":"AAAE4344-3865-3E8E-969E-D68067F4B686","min_version_os_name":"ios","min_version_os_sdk":"12.2","mach_header":{"magic":4277009103,"cputype":16777223,"cpusubtype":3,"filetype":2,"flags":2097285}],"segments":[{"name":"_PAGEZERO","vmaddr":0,"vmsize":4294967296,"fileoff":0,"filesize":0,"maxprot":0}],{"name":"_TEXT","vmaddr":4294967296,"vmsize":20480,"fileoff":0,"filesize":20480,"maxprot":7}],

So without having a way to reproduce this, I'll see if I can read the source code to figure out why this:

SwiftASTContext("LLDBNoContextRepro")::SetTriple("x86_64-apple-ios12.2-simulator") setting to "x86_64-apple-ios12.2-simulator"

isn't getting picked up here:

SwiftASTContext("LLDBNoContextRepro")::LogConfiguration(SwiftASTContext*)0x7fa811d0a7e0:
Architecture : x86_64--macosx

@adrian-prantl
Copy link
Member

This should be addressed by the simulator triple fixes in SR-12932. If it still doesn't work, please let me know!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LLDB for Swift
Projects
None yet
Development

No branches or pull requests

4 participants