[Lldb-commits] [lldb] r179641 - Make sure all the threads get a chance to compute their StopInfo's before we start running

Jim Ingham jingham at apple.com
Tue Apr 16 15:53:24 PDT 2013


Author: jingham
Date: Tue Apr 16 17:53:24 2013
New Revision: 179641

URL: http://llvm.org/viewvc/llvm-project?rev=179641&view=rev
Log:
Make sure all the threads get a chance to compute their StopInfo's before we start running
ShouldStop on the threads, which might destroy information needed to correctly compute another 
thread's StopInfo.

<rdar://problem/13664026>

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=179641&r1=179640&r2=179641&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadList.cpp (original)
+++ lldb/trunk/source/Target/ThreadList.cpp Tue Apr 16 17:53:24 2013
@@ -232,7 +232,18 @@ ThreadList::ShouldStop (Event *event_ptr
     }
 
     bool did_anybody_stop_for_a_reason = false;
-    bool should_stop = false;    
+    bool should_stop = false;
+    
+    // Now we run through all the threads and get their stop info's.  We want to make sure to do this first before
+    // we start running the ShouldStop, because one thread's ShouldStop could destroy information (like deleting a
+    // thread specific breakpoint another thread had stopped at) which could lead us to compute the StopInfo incorrectly.
+    // We don't need to use it here, we just want to make sure it gets computed.
+    
+    for (pos = threads_copy.begin(); pos != end; ++pos)
+    {
+        ThreadSP thread_sp(*pos);
+        thread_sp->GetStopInfo();
+    }
     
     for (pos = threads_copy.begin(); pos != end; ++pos)
     {





More information about the lldb-commits mailing list