-
Notifications
You must be signed in to change notification settings - Fork 342
[lldb] Support plain ObjC names in LLDBTypeInfoProvider #9320
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
[lldb] Support plain ObjC names in LLDBTypeInfoProvider #9320
Conversation
lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp
Show resolved
Hide resolved
lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp
Outdated
Show resolved
Hide resolved
self, "// break here", lldb.SBFileSpec("main.swift") | ||
) | ||
self.runCmd("settings set symbols.swift-enable-ast-context false") | ||
self.expect("v", substrs=["num = 15"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Usually I prefer frame variable c
over v
since v
is technically an alias, so there is a chance that it will be re-aliased later on to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to have a policy on this. The v
alias could change, but it would have to be a breaking change for a test like this to be a problem. A breaking change seems unlikely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other instances, I'll make a follow up change to catch them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ffset (#76678) This change is part of a fix for a regression that wasn't noticed because lldb has a fallback to using ASTContexts when type metadata resolution fails. For any Swift class that directly or indirectly inherits from an ObjC class (such as `NSObject`, `NSView`, etc), the function `computeUnalignedFieldStartOffset` will fail to compute the start offset. To compute the start offset, it traverses the parent classes and uses their sizes. Once the traversal reaches an ObjC class, the RemoteInspection does not know the size. The fix here is to get the size from the `TypeInfo` returned by the external `TypeInfoProvider` (which in LLDB is `LLDBTypeInforProvider`). Depended on by swiftlang/llvm-project#9320
It would be nice to squash follow-up fixes if they don't make sense on their own. Makes cherry-picking etc easier. |
Oh wait. This is even more confusing. You did! But Github only shows the original commits. |
Extend `LLDBTypeInfoProvider` to support ObjC class names (such as "NSObject", "NSView") in addition to mangled Swift names. This is to support `ObjCClassTypeRefs`, which contain the class name, but not the mangled name. Note that `ObjCClassTypeRefs` are typerefs for classes in the ObjC (`__C`) module. Depends on swiftlang/swift#76678 (cherry picked from commit 4a1abae)
[lldb] Support plain ObjC names in LLDBTypeInfoProvider (#9320)
Extend `LLDBTypeInfoProvider` to support ObjC class names (such as "NSObject", "NSView") in addition to mangled Swift names. This is to support `ObjCClassTypeRefs`, which contain the class name, but not the mangled name. Note that `ObjCClassTypeRefs` are typerefs for classes in the ObjC (`__C`) module. Depends on swiftlang/swift#76678 (cherry picked from commit 4a1abae)
Extend `LLDBTypeInfoProvider` to support ObjC class names (such as "NSObject", "NSView") in addition to mangled Swift names. This is to support `ObjCClassTypeRefs`, which contain the class name, but not the mangled name. Note that `ObjCClassTypeRefs` are typerefs for classes in the ObjC (`__C`) module. Depends on swiftlang/swift#76678 (cherry picked from commit 4a1abae)
This change is for two reasons: > prefer `frame variable` over `v` since `v` is technically an alias, so there is a chance that it will be re-aliased later on to something else. See #9320 (comment) Additionally, using `frame var` makes it easier to grep for than using `v`.
This change is for two reasons: > prefer `frame variable` over `v` since `v` is technically an alias, so there is a chance that it will be re-aliased later on to something else. See #9320 (comment) Additionally, using `frame var` makes it easier to grep for than using `v`. (cherry-picked from commit ab5b104)
This change is for two reasons: > prefer `frame variable` over `v` since `v` is technically an alias, so there is a chance that it will be re-aliased later on to something else. See #9320 (comment) Additionally, using `frame var` makes it easier to grep for than using `v`. (cherry-picked from commit ab5b104)
Extend
LLDBTypeInfoProvider
to support ObjC class names (such as "NSObject", "NSView") in addition to mangled Swift names.This is to support
ObjCClassTypeRefs
, which contain the class name, but not the mangled name. Note thatObjCClassTypeRefs
are typerefs for classes in the ObjC (__C
) module.Depends on swiftlang/swift#76678