First stage of implementing step by "run to next branch".  Doesn't work yet, is turned off.
<rdar://problem/10975912>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152376 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlanStepOverRange.cpp b/source/Target/ThreadPlanStepOverRange.cpp
index 8b4907f..54fe8ea 100644
--- a/source/Target/ThreadPlanStepOverRange.cpp
+++ b/source/Target/ThreadPlanStepOverRange.cpp
@@ -63,31 +63,6 @@
 }
 
 bool
-ThreadPlanStepOverRange::PlanExplainsStop ()
-{
-    // We don't explain signals or breakpoints (breakpoints that handle stepping in or
-    // out will be handled by a child plan.
-    StopInfoSP stop_info_sp = GetPrivateStopReason();
-    if (stop_info_sp)
-    {
-        StopReason reason = stop_info_sp->GetStopReason();
-
-        switch (reason)
-        {
-        case eStopReasonBreakpoint:
-        case eStopReasonWatchpoint:
-        case eStopReasonSignal:
-        case eStopReasonException:
-            return false;
-        default:
-            return true;
-        }
-    }
-    return true;
-}
-
-
-bool
 ThreadPlanStepOverRange::ShouldStop (Event *event_ptr)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
@@ -100,10 +75,6 @@
         log->Printf("ThreadPlanStepOverRange reached %s.", s.GetData());
     }
     
-    // If we're still in the range, keep going.
-    if (InRange())
-        return false;
-
     // 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.
@@ -158,15 +129,29 @@
             }
         }
     }
-    else if (!InSymbol())
+    else
     {
-        // This one is a little tricky.  Sometimes we may be in a stub or something similar,
-        // in which case we need to get out of there.  But if we are in a stub then it's 
-        // likely going to be hard to get out from here.  It is probably easiest to step into the
-        // stub, and then it will be straight-forward to step out.        
-        new_plan = m_thread.QueueThreadPlanForStepThrough (false, stop_others);
+        // If we're still in the range, keep going.
+        if (InRange())
+        {
+            SetNextBranchBreakpoint();
+            return false;
+        }
+
+
+        if (!InSymbol())
+        {
+            // This one is a little tricky.  Sometimes we may be in a stub or something similar,
+            // in which case we need to get out of there.  But if we are in a stub then it's 
+            // likely going to be hard to get out from here.  It is probably easiest to step into the
+            // stub, and then it will be straight-forward to step out.        
+            new_plan = m_thread.QueueThreadPlanForStepThrough (false, stop_others);
+        }
     }
 
+    // If we get to this point, we're not going to use a previously set "next branch" breakpoint, so delete it:
+    ClearNextBranchBreakpoint();
+    
     if (new_plan == NULL)
         m_no_more_plans = true;
     else