Skip to content

Fixes for lldb 5.1 #22641

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

Merged
merged 10 commits into from
Feb 16, 2019
Merged

Conversation

fredriss
Copy link
Contributor

Pulling some changes needed for recent LLDB fixes onto the initial 5.1 branch

slavapestov and others added 10 commits February 14, 2019 16:55
…g#22498)

This allows Remote Mirrors and RemoteAST to inspect existentials
containing instances of imported classes.

(cherry picked from commit dc3abd1)
This is failing for me ~10% of the time. It is resulting in spurious PR testing
failures.

SR-9908

(cherry picked from commit fffbbfe)
If resolving the type of an instance produces a class metadata for
which we cannot build a type (for example, a special class like
__NSCFNumber, which the ClangImporter does not produce a ClassDecl
for), we try the superclass.

The caching logic was broken in this case, so subsequent calls
would return an empty type.

(cherry picked from commit 28f305b)
An Error existential value can directly store a
reference to an NSError instance without wrapping
it in an Error container.

When "projecting" such an existential, the dynamic type
is the NSError's isa pointer, and the payload is the
address of the instance itself.

(cherry picked from commit 76ebaee)
LLDB calls getDynamicTypeAndAddressForExistential() on an existential
value without knowing if its a class existential or opaque existential.

Class existentials return the address of the instance itself here,
whereas opaque existentials always returned the address of the
payload value.

This meant the caller could not usefully operate on the payload value
if it was of class type, because there was no way of knowing if the
extra dereference had occurred or not.

Now, always load the reference if the wrapped type is a class, even
if the existential is opaque.

Will be tested on the lldb side with another change I'm working on.

(cherry picked from commit bd3b451)
The getDynamicTypeAndAddressForExistential() function takes the
address of an existential value; so when looking at an Error,
this is the address of the reference, not the address of the
instance.

lldb needs to look at Error instances too, so add a new entry
point named getDynamicTypeAndAddressForError() which avoids the
extra dereference.

This will be tested on the lldb side.

(cherry picked from commit 56a74c4)
I need this to reproduce a test failure.

(cherry picked from commit c16fed7)
…ntials with named structs

(cherry picked from commit 905a6de)
The new trick is that of leavign an unresolved identifier for
the expression parser to fill in.

<rdar://problem/47982630>

(cherry picked from commit 49b2f4e)
@fredriss fredriss requested a review from slavapestov February 15, 2019 02:57
@fredriss
Copy link
Contributor Author

@slavapestov I'd like to take some of your recent changes to RemoteAST in the initial 5.1 branch. It would make it easier to branch lldb. Does this set of commits make sense in isolation?

@fredriss
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 28d1cd3

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 28d1cd3

@fredriss
Copy link
Contributor Author

Note that this is failing to build in LLDB because PR testing is not setup correctly for 5.1.

@fredriss fredriss merged commit 4f969b4 into swiftlang:swift-5.1-branch Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants