[Debug] Handle AnyObject.Protocol in stringForPrintObject(_:mangledTypeName:)#90032
Conversation
…edTypeName:) The mangled type name for `AnyObject` (s9AnyObjectaD) cannot be resolved by `_getTypeByMangledNameInContext`. Handle this early and bitcasting the pointer to `AnyObject` directly. This is used by LLDB as a fallback when the dynamic type's mangled name contains a private class discriminator, which is not resolved by the Swift runtime.
|
@swift-ci smoke test |
augusto2112
left a comment
There was a problem hiding this comment.
Do you know why _getTypeByMangledNameInContext cannot resolve AnyObject?
|
The proper mangled name for |
It's a typealias declared by the stdlib (https://developer.apple.com/documentation/swift/anyobject). I've seen debug info reference both the alias ( I didn't go with the builtin because, although type lookup succeed, there were downstream failures that made me think I wasn't taking the right path. I'll debug further and find out where and why it fails after type lookup. |
|
Thanks @mikeash, I've updated the code to support |
|
@swift-ci smoke test |
|
Capturing a bit of offline discussion: there's a difference between |
|
@swift-ci smoke test macOS |
|
@swift-ci test |
Update
stringForPrintObject(_:mangledTypeName:)to support mangled type name forAnyObject("yXlD"). Handle this by adding a secondtype is AnyObject.Protocolcondition to the branch that bitcasts toAnyObject.AnyObject is used by LLDB as a fallback when the dynamic type's mangled name contains a private class discriminator, which is not resolved by the Swift runtime.
Assisted-by: claude