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-6831] LLDB get wrong variable in an enum #4500
Comments
Comment by Jim Ingham (JIRA) @swift-ci create |
Comment by Jim Ingham (JIRA) I see this in the swift-4.0 branch of lldb, but I don't see the same behavior when using tools from the swift-4.1 development branch. |
Comment by Thomas Dougnac-Galant (JIRA) Ah. I'm currently developing and debugging my app only with Xcode release. Could this bug change the behaviour of accessing the data (inside item struct) ? |
Comment by Jim Ingham (JIRA) BTW, it looks like the bug is when you have a let variable with a struct within a struct. Changing myStruct to a var fixes the problem. Also, if you copying myStruct.item to a local var, the original still prints incorrectly but the copy prints correctly. |
Comment by Thomas Dougnac-Galant (JIRA) ok thanks |
Comment by Jim Ingham (JIRA) I don't think so. I suspect this is an artifact of some special magic the compiler does to make let variables be visible to the debugger after the compiler would have discarded them. It makes a "shadow copy" at -Onone and points the debugger at that. That doesn't affect the actual code behavior, however, since "real code" doesn't use this shadow copy. Also, the code in question actually behaves correctly, so it looks like it is a debugger-only failure. |
TheSnowFox (JIRA User) Hello, I was able to reproduce this with a release version of Xcode, but not with a nightly toolchain. |
Attachment: Download
Environment
High Sierra: 10.13 (17A405)
Xcode: 9.2 (9C40b)
Framework created with:
App created with:
Additional Detail from JIRA
md5: da766bcf40e5048a35ae1f3a526742dd
Issue Description:
Hi,
As I explained here, I have weird reaction of Xcode (or LLDB) when I pause my app at a breakpoint and look for variables.
Here is the struct in framework :
Here at the breakpoint in a test app, myStruct > item > type should be .utility not itemA :
It works fine if the code is executed in main.swift but bug if in another file...
As asked in the forum, here is a ZIP of this test project: Test.zip
Hope this will help !
The text was updated successfully, but these errors were encountered: