[Lldb-commits] [lldb] r166732 - in /lldb/trunk/source/Target: ThreadPlanStepInRange.cpp ThreadPlanStepInstruction.cpp ThreadPlanStepOverRange.cpp

Jim Ingham jingham at apple.com
Thu Oct 25 15:30:10 PDT 2012


Author: jingham
Date: Thu Oct 25 17:30:09 2012
New Revision: 166732

URL: http://llvm.org/viewvc/llvm-project?rev=166732&view=rev
Log:
Found a couple more places where we need to run all threads when stepping.

Modified:
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=166732&r1=166731&r2=166732&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Thu Oct 25 17:30:09 2012
@@ -95,14 +95,14 @@
     }
     else
     {
-        // Stepping through should be done stopping other threads in general, since we're setting a breakpoint and
-        // continuing...
+        // Stepping through should be done running other threads in general, since we're setting a breakpoint and
+        // continuing.  So only stop others if we are explicitly told to do so.
         
         bool stop_others;
-        if (m_stop_others != lldb::eAllThreads)
-            stop_others = true;
-        else
+        if (m_stop_others == lldb::eOnlyThisThread)
             stop_others = false;
+        else
+            stop_others = true;
             
         FrameComparison frame_order = CompareCurrentFrameToStartFrame();
         
@@ -291,10 +291,13 @@
     if (should_step_out)
     {
         // FIXME: Make sure the ThreadPlanForStepOut does the right thing with inlined functions.
+        // We really should have all plans take the tri-state for "stop others" so we can do the right
+        // thing.  For now let's be safe and always run others when we are likely to run arbitrary code.
+        const bool stop_others = false;
         return current_plan->GetThread().QueueThreadPlanForStepOut (false, 
                                                                     NULL, 
                                                                     true, 
-                                                                    current_plan->StopOthers(), 
+                                                                    stop_others,
                                                                     eVoteNo, 
                                                                     eVoteNoOpinion,
                                                                     0); // Frame index

Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=166732&r1=166731&r2=166732&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Thu Oct 25 17:30:09 2012
@@ -131,10 +131,14 @@
                     s.Address (return_addr, m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize());
                     log->Printf("%s.", s.GetData());
                 }
+                
+                // StepInstruction should probably have the tri-state RunMode, but for now it is safer to
+                // run others.
+                const bool stop_others = false;
                 m_thread.QueueThreadPlanForStepOut(false,
                                                    NULL,
                                                    true,
-                                                   m_stop_other_threads,
+                                                   stop_others,
                                                    eVoteNo,
                                                    eVoteNoOpinion,
                                                    0);

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=166732&r1=166731&r2=166732&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Thu Oct 25 17:30:09 2012
@@ -78,7 +78,7 @@
     
     // If we're out of the range but in the same frame or in our caller's frame
     // then we should stop.
-    // When stepping out we only step if we are forcing running one thread.
+    // When stepping out we only stop others if we are forcing running one thread.
     bool stop_others;
     if (m_stop_others == lldb::eOnlyThisThread)
         stop_others = true;





More information about the lldb-commits mailing list