summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-01-28 02:21:37 +0000
committerJim Ingham <jingham@apple.com>2011-01-28 02:21:37 +0000
commitf2c6ccf0431b8fe4abdef29a2485d5ffd608474c (patch)
treef19881e1cd48409ae1c65ed226134c4b00f94d37 /lldb/tools/debugserver/source/MacOSX/MachThread.cpp
parent417fca86c4a1c53afeb363190450c2d05e434d2f (diff)
downloadbcm5719-llvm-f2c6ccf0431b8fe4abdef29a2485d5ffd608474c.tar.gz
bcm5719-llvm-f2c6ccf0431b8fe4abdef29a2485d5ffd608474c.zip
The thread_info changes over the life of the thread, so you can't get it once and cache it, you have to fetch it every time you want to use it.
llvm-svn: 124463
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachThread.cpp')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThread.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
index e61d2800287..ca2dca9d91b 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
@@ -672,11 +672,11 @@ bool
MachThread::GetIdentifierInfo ()
{
#ifdef THREAD_IDENTIFIER_INFO_COUNT
- if (m_ident_info.thread_id == 0)
- {
+ // Don't try to get the thread info once and cache it for the life of the thread. It changes over time, for instance
+ // if the thread name changes, then the thread_handle also changes... So you have to refetch it every time.
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
- return ::thread_info (ThreadID(), THREAD_IDENTIFIER_INFO, (thread_info_t) &m_ident_info, &count) == KERN_SUCCESS;
- }
+ kern_return_t kret = ::thread_info (ThreadID(), THREAD_IDENTIFIER_INFO, (thread_info_t) &m_ident_info, &count);
+ return kret == KERN_SUCCESS;
#endif
return false;
OpenPOWER on IntegriCloud