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-11971] simulator environment is missing from the triple for SwiftASTContextForExpressions #4475

Closed
swift-ci opened this issue Dec 19, 2019 · 6 comments
Assignees
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-11971
Radar rdar://problem/58438125
Original Reporter dylansturg (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

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

md5: f94c34d07829038be0b30d52e5a861dc

Issue Description:

While working to verify debugging of remotely built Swift libraries, @adrian-prantl read through some types logs from my project and noted that the "-simulator" suffix was missing from the triple used by the SwiftASTContextForExpressions. I have verified this is reproducible on the latest dev snapshot (from 12/18/19).

From the LLDB types log, I can see that the SwiftASTContextForExpressions is using the wrong triple ("-simulator" is missing):

SwiftASTContextForExpressions::LogConfiguration(SwiftASTContext*):
Architecture : x86_64-apple-ios12.0.0

From the same types log, other instances of SwiftASTContext are using the correct triple (contains "-simulator"):

SwiftASTContext("AppShell")::LogConfiguration(SwiftASTContext*):
Architecture : x86_64-apple-ios12.0-simulator

Steps to repro

  1. Download and unzip the attached Xcode project "AppShell".

  2. Select the appropriate Swift toolchain in Xcode (I used dev snapshot from 12/18/19).

  3. Set a breakpoint anywhere in AppDelegate.

  4. Build and run the project.

  5. When the breakpoint is hit, exec po self in the LLDB console.

  6. Observe the LLDB types log.

About the sample project

This is an Xcode project that resembles the way an iOS app is created by Bazel. The only source code is contained in "AppLib", which is linked with the source-less target "AppShell". To closely simulate my build environment, I have also set the -no-serialize-debugging-options flag which may or may not be related.

@swift-ci
Copy link
Author

Comment by Dylan Sturgeon (JIRA)

Just to clarify - debugging seems to work correctly and I'm able to evaluate expressions in the debug session. I'm unsure what internal info/data structures could be corrupted and whether it has some subtle or hard to see impact on debugging.

@adrian-prantl
Copy link
Member

@swift-ci create

@adrian-prantl
Copy link
Member

LLDB is super sensitive to triples in many places, so this really valuable. Thanks!

@adrian-prantl
Copy link
Member

First patch: https://reviews.llvm.org/D75696

@adrian-prantl
Copy link
Member

And that is also the last patch, because the final verdict on whether something is ios-simulator or not can only be made once we have a process, so it "behaves correctly" that we misidentify it in the per-module SwiftASTContext.

Thanks!

@adrian-prantl
Copy link
Member

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 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

2 participants