[Lldb-commits] [lldb] r139567 - /lldb/trunk/source/Target/ThreadList.cpp

Jason Molenda jmolenda at apple.com
Mon Sep 12 18:13:17 PDT 2011


Author: jmolenda
Date: Mon Sep 12 20:13:16 2011
New Revision: 139567

URL: http://llvm.org/viewvc/llvm-project?rev=139567&view=rev
Log:
In ThreadList::GetSelectedThread, handle the case where we have no
valid threads - can happen if attaching to a process fails in a
certain way.


Modified:
    lldb/trunk/source/Target/ThreadList.cpp

Modified: lldb/trunk/source/Target/ThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadList.cpp?rev=139567&r1=139566&r2=139567&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadList.cpp (original)
+++ lldb/trunk/source/Target/ThreadList.cpp Mon Sep 12 20:13:16 2011
@@ -548,6 +548,8 @@
     ThreadSP thread_sp = FindThreadByID(m_selected_tid);
     if (!thread_sp.get())
     {
+        if (m_threads.size() == 0)
+            return thread_sp;
         m_selected_tid = m_threads[0]->GetID();
         thread_sp = m_threads[0];
     }





More information about the lldb-commits mailing list