[Lldb-commits] [lldb] r175922 - The thread plans run before the event is broadcast, so they should be calling ShouldStopSynchronous on any Stop Info's

Jim Ingham jingham at apple.com
Fri Feb 22 13:23:43 PST 2013


Author: jingham
Date: Fri Feb 22 15:23:43 2013
New Revision: 175922

URL: http://llvm.org/viewvc/llvm-project?rev=175922&view=rev
Log:
The thread plans run before the event is broadcast, so they should be calling ShouldStopSynchronous on any Stop Info's
they want to check.  The full ShouldStop should only be called on the public side of the event system.

Modified:
    lldb/trunk/source/Target/StopInfo.cpp
    lldb/trunk/source/Target/ThreadPlanBase.cpp

Modified: lldb/trunk/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=175922&r1=175921&r2=175922&view=diff
==============================================================================
--- lldb/trunk/source/Target/StopInfo.cpp (original)
+++ lldb/trunk/source/Target/StopInfo.cpp Fri Feb 22 15:23:43 2013
@@ -569,7 +569,7 @@ public:
 
 protected:
     virtual bool
-    ShouldStop (Event *event_ptr)
+    ShouldStopSynchronous (Event *event_ptr)
     {
         // ShouldStop() method is idempotent and should not affect hit count.
         // See Process::RunPrivateStateThread()->Process()->HandlePrivateEvent()
@@ -604,6 +604,15 @@ protected:
         return m_should_stop;
     }
     
+    bool
+    ShouldStop (Event *event_ptr)
+    {
+        // This just reports the work done by PerformAction or the synchronous stop.  It should
+        // only ever get called after they have had a chance to run.
+        assert (m_should_stop_is_valid);
+        return m_should_stop;
+    }
+    
     virtual void
     PerformAction (Event *event_ptr)
     {
@@ -759,6 +768,8 @@ protected:
         if (log)
             log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop);
         
+        m_should_stop_is_valid = true;
+        
     }
         
 private:

Modified: lldb/trunk/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanBase.cpp?rev=175922&r1=175921&r2=175922&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanBase.cpp Fri Feb 22 15:23:43 2013
@@ -101,7 +101,7 @@ ThreadPlanBase::ShouldStop (Event *event
 
         case eStopReasonBreakpoint:
         case eStopReasonWatchpoint:
-            if (stop_info_sp->ShouldStop(event_ptr))
+            if (stop_info_sp->ShouldStopSynchronous(event_ptr))
             {
                 // If we are going to stop for a breakpoint, then unship the other plans
                 // at this point.  Don't force the discard, however, so Master plans can stay





More information about the lldb-commits mailing list