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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124463 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/debugserver/source/MacOSX/MachThread.cpp b/tools/debugserver/source/MacOSX/MachThread.cpp
index e61d280..ca2dca9 100644
--- a/tools/debugserver/source/MacOSX/MachThread.cpp
+++ b/tools/debugserver/source/MacOSX/MachThread.cpp
@@ -672,11 +672,11 @@
 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;