Skip to content

Commit 496a44a

Browse files
Merge pull request #9972 from felipepiovezan/felipe/fix_thread_missing_return_cherry_pick
2 parents f1ce5b4 + e9e4d37 commit 496a44a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lldb/source/Plugins/Process/Utility/ThreadMemory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ class ThreadMemory : public lldb_private::Thread {
3333

3434
const char *GetInfo() override {
3535
if (m_backing_thread_sp)
36-
m_backing_thread_sp->GetInfo();
36+
return m_backing_thread_sp->GetInfo();
3737
return nullptr;
3838
}
3939

4040
const char *GetName() override {
4141
if (!m_name.empty())
4242
return m_name.c_str();
4343
if (m_backing_thread_sp)
44-
m_backing_thread_sp->GetName();
44+
return m_backing_thread_sp->GetName();
4545
return nullptr;
4646
}
4747

4848
const char *GetQueueName() override {
4949
if (!m_queue.empty())
5050
return m_queue.c_str();
5151
if (m_backing_thread_sp)
52-
m_backing_thread_sp->GetQueueName();
52+
return m_backing_thread_sp->GetQueueName();
5353
return nullptr;
5454
}
5555

lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def run_python_os_step(self):
160160
)
161161
self.assertTrue(process, PROCESS_IS_VALID)
162162

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

187193
frame = thread.GetFrameAtIndex(0)
188194
self.assertTrue(

0 commit comments

Comments
 (0)