-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Improve handling of artificial subclasses #7423
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] Improve handling of artificial subclasses #7423
Conversation
@swift-ci test |
e92daeb
to
981dd9b
Compare
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.
LGTM with minor comment inline
@@ -1080,6 +1080,10 @@ CompilerType SwiftLanguageRuntimeImpl::GetChildCompilerTypeAtIndex( | |||
LLDBTypeInfoProvider tip(*this, *instance_ts); | |||
reflection_ctx->ForEachSuperClassType( | |||
&tip, pointer, [&](SuperClassType sc) -> bool { | |||
// If the typeref is invalid, we don't want to process it. | |||
if (!sc.get_typeref()) | |||
return false; |
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.
Is this an error, or expected? We might want to log it if it's an error.
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.
If it's expected, because this is normal for artificial base classes, maybe the comment could be more explicit about that?
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's expected if the current class is artificial, I'll add a comment
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.
is there a way we can know that the current class is artificial? In the case where the current class is not artificial, then we'd want a log or better.
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.
Remote Mirrors doesn't really tell us why getting the typeref failed (it could be an artificial class or conceivably something else). It'd be pretty straight forward to add an API asking if the class is artificial or not, if we want that.
An artificial subclass is a subclass which was registered at runtime, which is possible to do when Obj-C interop is enabled. Fix variables of these types being printed incorrectly. rdar://101519300
981dd9b
to
58f6d82
Compare
@swift-ci test |
@augusto2112 Can you rebase this on swift/release/5.10? |
An artificial subclass is a subclass which was registered at runtime, which is possible to do when Obj-C interop is enabled. Fix variables of these types being printed incorrectly.
rdar://101519300