-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb] Add initial formatter for Swift Actors #10367
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] Add initial formatter for Swift Actors #10367
Conversation
@swift-ci test |
} | ||
|
||
size_t GetIndexOfChildWithName(ConstString name) override { | ||
if (m_is_supported_target && name == "unprioritised_jobs") |
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.
does ConstString::operator==(const char *)
do what we expect here?
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.
FWIW, it's probably faster to do name.GetStringRef() == "unprioritised_jobs" here unless we cache the constring lookup result.
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.
does
ConstString::operator==(const char *)
do what we expect here?
I'd say yes:
bool operator==(const char *rhs) const {
// ConstString differentiates between empty strings and nullptr strings, but
// StringRef doesn't. Therefore we have to do this check manually now.
if (m_string == nullptr && rhs != nullptr)
return false;
if (m_string != nullptr && rhs == nullptr)
return false;
return GetStringRef() == rhs;
}
eLanguageTypeSwift)) { | ||
if (auto *ts = llvm::dyn_cast_or_null<TypeSystemSwiftTypeRef>( | ||
ts_or_err->get())) | ||
// TypeMangling for "Swift.UnsafeCurrentTask" |
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.
FWIW, the nice thing to do here would be to wrap this in a TypeSystemSwift::GetUnsafeCurrentTaskType() helper
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.
agreed, should I do that as part of this PR? I plan to do some refactoring like this after the fact, but I can just as easily perform some refactorings in this PR.
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.
Both options are fine.
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test macOS |
@swift-ci test linux |
@swift-ci test macOS |
Adds a synthetic formatter for `Builtin.DefaultActorStorage`. Each actor instance has a field named `$defaultActor` which has a type of `DefaultActorStorage`. Prior to this, that field was shown as opaque bytes. With this change, the value now has a single child, `unprioritised_jobs`, which represents the job queue for the actor. This is the first of a few changes, including a summary formatter which will show which state the actor is in (ie "running", "idle", etc). (cherry-picked from commit 23f6dc9)
Adds a synthetic formatter for `Builtin.DefaultActorStorage`. Each actor instance has a field named `$defaultActor` which has a type of `DefaultActorStorage`. Prior to this, that field was shown as opaque bytes. With this change, the value now has a single child, `unprioritised_jobs`, which represents the job queue for the actor. This is the first of a few changes, including a summary formatter which will show which state the actor is in (ie "running", "idle", etc). (cherry-picked from commit 23f6dc9)
Adds a synthetic formatter for
Builtin.DefaultActorStorage
. Each actor instance has a field named$defaultActor
which has a type ofDefaultActorStorage
. Prior to this, that field was shown as opaque bytes. With this change, the value now has a single child,unprioritised_jobs
, which represents the job queue for the actor.This is the first of a few changes, including a summary formatter which will show which state the actor is in (ie "running", "idle", etc).