Skip to content

[lldb] Implement missing queue overloads from ThreadMemory #132906

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions lldb/source/Plugins/Process/Utility/ThreadMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,69 @@ class ThreadMemory : public lldb_private::Thread {

void WillResume(lldb::StateType resume_state) override;

void SetQueueName(const char *name) override {
if (m_backing_thread_sp)
m_backing_thread_sp->SetQueueName(name);
}

lldb::queue_id_t GetQueueID() override {
if (m_backing_thread_sp)
return m_backing_thread_sp->GetQueueID();
return LLDB_INVALID_QUEUE_ID;
}

void SetQueueID(lldb::queue_id_t new_val) override {
if (m_backing_thread_sp)
m_backing_thread_sp->SetQueueID(new_val);
}

lldb::QueueKind GetQueueKind() override {
if (m_backing_thread_sp)
return m_backing_thread_sp->GetQueueKind();
return lldb::eQueueKindUnknown;
}

void SetQueueKind(lldb::QueueKind kind) override {
if (m_backing_thread_sp)
m_backing_thread_sp->SetQueueKind(kind);
}

lldb::QueueSP GetQueue() override {
if (m_backing_thread_sp)
return m_backing_thread_sp->GetQueue();
return lldb::QueueSP();
}

lldb::addr_t GetQueueLibdispatchQueueAddress() override {
if (m_backing_thread_sp)
return m_backing_thread_sp->GetQueueLibdispatchQueueAddress();
return LLDB_INVALID_ADDRESS;
}

void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t) override {
if (m_backing_thread_sp)
m_backing_thread_sp->SetQueueLibdispatchQueueAddress(dispatch_queue_t);
}

lldb_private::LazyBool GetAssociatedWithLibdispatchQueue() override {
if (m_backing_thread_sp)
return m_backing_thread_sp->GetAssociatedWithLibdispatchQueue();
return lldb_private::eLazyBoolNo;
}

void SetAssociatedWithLibdispatchQueue(
lldb_private::LazyBool associated_with_libdispatch_queue) override {
if (m_backing_thread_sp)
m_backing_thread_sp->SetAssociatedWithLibdispatchQueue(
associated_with_libdispatch_queue);
}

bool ThreadHasQueueInformation() const override {
if (m_backing_thread_sp)
return m_backing_thread_sp->ThreadHasQueueInformation();
return false;
}

void DidResume() override {
if (m_backing_thread_sp)
m_backing_thread_sp->DidResume();
Expand Down Expand Up @@ -134,6 +197,55 @@ class ThreadMemoryProvidingNameAndQueue : public ThreadMemoryProvidingName {
return ThreadMemory::GetQueueName();
}

/// TODO: this method should take into account the queue override.
void SetQueueName(const char *name) override { Thread::SetQueueName(name); }

/// TODO: this method should take into account the queue override.
lldb::queue_id_t GetQueueID() override { return Thread::GetQueueID(); }

/// TODO: this method should take into account the queue override.
void SetQueueID(lldb::queue_id_t new_val) override {
Thread::SetQueueID(new_val);
}

/// TODO: this method should take into account the queue override.
lldb::QueueKind GetQueueKind() override { return Thread::GetQueueKind(); }

/// TODO: this method should take into account the queue override.
void SetQueueKind(lldb::QueueKind kind) override {
Thread::SetQueueKind(kind);
}

/// TODO: this method should take into account the queue override.
lldb::QueueSP GetQueue() override { return Thread::GetQueue(); }

/// TODO: this method should take into account the queue override.
lldb::addr_t GetQueueLibdispatchQueueAddress() override {
return Thread::GetQueueLibdispatchQueueAddress();
}

/// TODO: this method should take into account the queue override.
void SetQueueLibdispatchQueueAddress(lldb::addr_t dispatch_queue_t) override {
Thread::SetQueueLibdispatchQueueAddress(dispatch_queue_t);
}

/// TODO: this method should take into account the queue override.
bool ThreadHasQueueInformation() const override {
return Thread::ThreadHasQueueInformation();
}

/// TODO: this method should take into account the queue override.
lldb_private::LazyBool GetAssociatedWithLibdispatchQueue() override {
return Thread::GetAssociatedWithLibdispatchQueue();
}

/// TODO: this method should take into account the queue override.
void SetAssociatedWithLibdispatchQueue(
lldb_private::LazyBool associated_with_libdispatch_queue) override {
Thread::SetAssociatedWithLibdispatchQueue(
associated_with_libdispatch_queue);
}

lldb::ValueObjectSP &GetValueObject() { return m_thread_info_valobj_sp; }

protected:
Expand Down
Loading