Skip to content

[lldb] Add missing return statements in ThreadMemory #126128

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
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions lldb/source/Plugins/Process/Utility/ThreadMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ class ThreadMemory : public lldb_private::Thread {

const char *GetInfo() override {
if (m_backing_thread_sp)
m_backing_thread_sp->GetInfo();
return m_backing_thread_sp->GetInfo();
return nullptr;
}

const char *GetName() override {
if (!m_name.empty())
return m_name.c_str();
if (m_backing_thread_sp)
m_backing_thread_sp->GetName();
return m_backing_thread_sp->GetName();
return nullptr;
}

const char *GetQueueName() override {
if (!m_queue.empty())
return m_queue.c_str();
if (m_backing_thread_sp)
m_backing_thread_sp->GetQueueName();
return m_backing_thread_sp->GetQueueName();
return nullptr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def run_python_os_step(self):
)
self.assertTrue(process, PROCESS_IS_VALID)

core_thread_zero = process.GetThreadAtIndex(0)

# Make sure there are no OS plug-in created thread when we first stop
# at our breakpoint in main
thread = process.GetThreadByID(0x111111111)
Expand All @@ -183,6 +185,10 @@ def run_python_os_step(self):
thread.IsValid(),
"Make sure there is a thread 0x111111111 after we load the python OS plug-in",
)
# This OS plugin does not set thread names / queue names, so it should
# inherit the core thread's name.
self.assertEqual(core_thread_zero.GetName(), thread.GetName())
self.assertEqual(core_thread_zero.GetQueueName(), thread.GetQueueName())

frame = thread.GetFrameAtIndex(0)
self.assertTrue(
Expand Down