[Lldb-commits] [lldb] r180244 - In Process::ProcessEventData::DoOnRemoval, we need to handle the case where NO thread has a stop reason

Jim Ingham jingham at apple.com
Wed Apr 24 19:05:00 PDT 2013


Author: jingham
Date: Wed Apr 24 21:04:59 2013
New Revision: 180244

URL: http://llvm.org/viewvc/llvm-project?rev=180244&view=rev
Log:
In Process::ProcessEventData::DoOnRemoval, we need to handle the case where NO thread has a stop reason
specially, and make sure we stop.  This shouldn't happen, but if it does, the user will probably want to
see it.

<rdar://problem/13273125>

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

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=180244&r1=180243&r2=180244&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Apr 24 21:04:59 2013
@@ -4094,6 +4094,12 @@ Process::ProcessEventData::DoOnRemoval (
         
         bool still_should_stop = false;
         
+        // Sometimes - for instance if we have a bug in the stub we are talking to, we stop but no thread has a
+        // valid stop reason.  In that case we should just stop, because we have no way of telling what the right
+        // thing to do is, and it's better to let the user decide than continue behind their backs.
+        
+        bool does_anybody_have_an_opinion = false;
+        
         for (idx = 0; idx < num_threads; ++idx)
         {
             curr_thread_list = m_process_sp->GetThreadList();
@@ -4121,6 +4127,7 @@ Process::ProcessEventData::DoOnRemoval (
             StopInfoSP stop_info_sp = thread_sp->GetStopInfo ();
             if (stop_info_sp && stop_info_sp->IsValid())
             {
+                does_anybody_have_an_opinion = true;
                 bool this_thread_wants_to_stop;
                 if (stop_info_sp->GetOverrideShouldStop())
                 {
@@ -4152,7 +4159,7 @@ Process::ProcessEventData::DoOnRemoval (
         
         if (m_process_sp->GetPrivateState() != eStateRunning)
         {
-            if (!still_should_stop)
+            if (!still_should_stop && does_anybody_have_an_opinion)
             {
                 // We've been asked to continue, so do that here.
                 SetRestarted(true);





More information about the lldb-commits mailing list