<div dir="ltr">Thanks for following up! It's really appreciated!<div><br></div><div>-Tim</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 11:51 PM, Boris Ulasevich via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: bulasevich<br>
Date: Fri Jan 27 01:51:43 2017<br>
New Revision: 293269<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=293269&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=293269&view=rev</a><br>
Log:<br>
Unroll r292930 due to TestCallThatThrows test fail is not fixed in reasonable time.<br>
<br>
Removed:<br>
    lldb/trunk/packages/Python/<wbr>lldbsuite/test/<wbr>functionalities/breakpoint/<wbr>step_over_breakpoint/<br>
Modified:<br>
    lldb/trunk/include/lldb/<wbr>Target/Thread.h<br>
    lldb/trunk/include/lldb/<wbr>Target/ThreadPlan.h<br>
    lldb/trunk/source/Target/<wbr>StopInfo.cpp<br>
    lldb/trunk/source/Target/<wbr>Thread.cpp<br>
    lldb/trunk/source/Target/<wbr>ThreadPlanStepInstruction.cpp<br>
    lldb/trunk/source/Target/<wbr>ThreadPlanStepRange.cpp<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Target/Thread.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/Thread.h?rev=<wbr>293269&r1=293268&r2=293269&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/Thread.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/Thread.h Fri Jan 27 01:51:43 2017<br>
@@ -126,7 +126,6 @@ public:<br>
                            // bit of data.<br>
     lldb::StopInfoSP stop_info_sp; // You have to restore the stop info or you<br>
                                    // might continue with the wrong signals.<br>
-    std::vector<lldb::<wbr>ThreadPlanSP> m_completed_plan_stack;<br>
     lldb::RegisterCheckpointSP<br>
         register_backup_sp; // You need to restore the registers, of course...<br>
     uint32_t current_inlined_depth;<br>
@@ -1030,15 +1029,6 @@ public:<br>
   bool WasThreadPlanDiscarded(<wbr>ThreadPlan *plan);<br>
<br>
   //----------------------------<wbr>------------------------------<wbr>--------<br>
-  /// Check if we have completed plan to override breakpoint stop reason<br>
-  ///<br>
-  /// @return<br>
-  ///     Returns true if completed plan stack is not empty<br>
-  ///     false otherwise.<br>
-  //----------------------------<wbr>------------------------------<wbr>--------<br>
-  bool CompletedPlanOverridesBreakpoi<wbr>nt();<br>
-<br>
-  //----------------------------<wbr>------------------------------<wbr>--------<br>
   /// Queues a generic thread plan.<br>
   ///<br>
   /// @param[in] plan_sp<br>
@@ -1223,8 +1213,6 @@ public:<br>
<br>
   void SetStopInfo(const lldb::StopInfoSP &stop_info_sp);<br>
<br>
-  void ResetStopInfo();<br>
-<br>
   void SetShouldReportStop(Vote vote);<br>
<br>
   //----------------------------<wbr>------------------------------<wbr>------------<br>
<br>
Modified: lldb/trunk/include/lldb/<wbr>Target/ThreadPlan.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlan.h?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/include/<wbr>lldb/Target/ThreadPlan.h?rev=<wbr>293269&r1=293268&r2=293269&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/include/lldb/<wbr>Target/ThreadPlan.h (original)<br>
+++ lldb/trunk/include/lldb/<wbr>Target/ThreadPlan.h Fri Jan 27 01:51:43 2017<br>
@@ -40,10 +40,9 @@ namespace lldb_private {<br>
 //  The thread maintaining a thread plan stack, and you program the actions of a<br>
 //  particular thread<br>
 //  by pushing plans onto the plan stack.<br>
-//  There is always a "Current" plan, which is the top of the plan stack,<br>
+//  There is always a "Current" plan, which is the head of the plan stack,<br>
 //  though in some cases<br>
-//  a plan may defer to plans higher in the stack for some piece of information<br>
-//  (let us define that the plan stack grows downwards).<br>
+//  a plan may defer to plans higher in the stack for some piece of information.<br>
 //<br>
 //  The plan stack is never empty, there is always a Base Plan which persists<br>
 //  through the life<br>
@@ -110,15 +109,6 @@ namespace lldb_private {<br>
 //  plans in the time between when<br>
 //  your plan gets unshipped and the next resume.<br>
 //<br>
-//  Thread State Checkpoint:<br>
-//<br>
-//  Note that calling functions on target process (ThreadPlanCallFunction) changes<br>
-//  current thread state. The function can be called either by direct user demand or<br>
-//  internally, for example lldb allocates memory on device to calculate breakpoint<br>
-//  condition expression - on Linux it is performed by calling mmap on device.<br>
-//  ThreadStateCheckpoint saves Thread state (stop info and completed<br>
-//  plan stack) to restore it after completing function call.<br>
-//<br>
 //  Over the lifetime of the plan, various methods of the ThreadPlan are then<br>
 //  called in response to changes of state in<br>
 //  the process we are debugging as follows:<br>
@@ -159,7 +149,7 @@ namespace lldb_private {<br>
 //  If the Current plan answers "true" then it is asked if the stop should<br>
 //  percolate all the way to the<br>
 //  user by calling the ShouldStop method.  If the current plan doesn't explain<br>
-//  the stop, then we query up<br>
+//  the stop, then we query down<br>
 //  the plan stack for a plan that does explain the stop.  The plan that does<br>
 //  explain the stop then needs to<br>
 //  figure out what to do about the plans below it in the stack.  If the stop is<br>
@@ -180,7 +170,7 @@ namespace lldb_private {<br>
 //  event it didn't directly handle<br>
 //  it can designate itself a "Master" plan by responding true to IsMasterPlan,<br>
 //  and then if it wants not to be<br>
-//  discarded, it can return false to OkayToDiscard, and it and all its dependent<br>
+//  discarded, it can return true to OkayToDiscard, and it and all its dependent<br>
 //  plans will be preserved when<br>
 //  we resume execution.<br>
 //<br>
@@ -217,7 +207,7 @@ namespace lldb_private {<br>
 //<br>
 //  If a plan says responds "true" to ShouldStop, then it is asked if it's job<br>
 //  is complete by calling<br>
-//  MischiefManaged.  If that returns true, the plan is popped from the plan<br>
+//  MischiefManaged.  If that returns true, the thread is popped from the plan<br>
 //  stack and added to the<br>
 //  Completed Plan Stack.  Then the next plan in the stack is asked if it<br>
 //  ShouldStop, and  it returns "true",<br>
@@ -251,9 +241,9 @@ namespace lldb_private {<br>
 //<br>
 //  When the process stops, the thread is given a StopReason, in the form of a<br>
 //  StopInfo object.  If there is a completed<br>
-//  plan corresponding to the stop, then the "actual" stop reason can be<br>
+//  plan corresponding to the stop, then the "actual" stop reason will be<br>
 //  suppressed, and instead a StopInfoThreadPlan<br>
-//  object will be cons'ed up from the top completed plan in the stack.<br>
+//  object will be cons'ed up from the highest completed plan in the stack.<br>
 //  However, if the plan doesn't want to be<br>
 //  the stop reason, then it can call SetPlanComplete and pass in "false" for<br>
 //  the "success" parameter.  In that case,<br>
<br>
Modified: lldb/trunk/source/Target/<wbr>StopInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Target/StopInfo.cpp?rev=<wbr>293269&r1=293268&r2=293269&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Target/<wbr>StopInfo.cpp (original)<br>
+++ lldb/trunk/source/Target/<wbr>StopInfo.cpp Fri Jan 27 01:51:43 2017<br>
@@ -269,7 +269,6 @@ protected:<br>
     if (!m_should_perform_action)<br>
       return;<br>
     m_should_perform_action = false;<br>
-    bool internal_breakpoint = true;<br>
<br>
     ThreadSP thread_sp(m_thread_wp.lock());<br>
<br>
@@ -496,9 +495,6 @@ protected:<br>
             if (callback_says_stop)<br>
               m_should_stop = true;<br>
<br>
-            if (m_should_stop && !bp_loc_sp->GetBreakpoint().<wbr>IsInternal())<br>
-              internal_breakpoint = false;<br>
-<br>
             // If we are going to stop for this breakpoint, then remove the<br>
             // breakpoint.<br>
             if (callback_says_stop && bp_loc_sp &&<br>
@@ -530,20 +526,6 @@ protected:<br>
               "Process::%s could not find breakpoint site id: %" PRId64 "...",<br>
               __FUNCTION__, m_value);<br>
       }<br>
-<br>
-      if ((m_should_stop == false || internal_breakpoint)<br>
-          && thread_sp-><wbr>CompletedPlanOverridesBreakpoi<wbr>nt()) {<br>
-<br>
-        // Override should_stop decision when we have<br>
-        // completed step plan additionally to the breakpoint<br>
-        m_should_stop = true;<br>
-<br>
-        // Here we clean the preset stop info so the next<br>
-        // GetStopInfo call will find the appropriate stop info,<br>
-        // which should be the stop info related to the completed plan<br>
-        thread_sp->ResetStopInfo();<br>
-      }<br>
-<br>
       if (log)<br>
         log->Printf("Process::%s returning from action with m_should_stop: %d.",<br>
                     __FUNCTION__, m_should_stop);<br>
<br>
Modified: lldb/trunk/source/Target/<wbr>Thread.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Target/Thread.cpp?rev=293269&<wbr>r1=293268&r2=293269&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Target/<wbr>Thread.cpp (original)<br>
+++ lldb/trunk/source/Target/<wbr>Thread.cpp Fri Jan 27 01:51:43 2017<br>
@@ -380,32 +380,24 @@ lldb::StopInfoSP Thread::GetStopInfo() {<br>
   if (m_destroy_called)<br>
     return m_stop_info_sp;<br>
<br>
-  ThreadPlanSP completed_plan_sp(<wbr>GetCompletedPlan());<br>
+  ThreadPlanSP plan_sp(GetCompletedPlan());<br>
   ProcessSP process_sp(GetProcess());<br>
   const uint32_t stop_id = process_sp ? process_sp->GetStopID() : UINT32_MAX;<br>
-<br>
-  // Here we select the stop info according to priorirty:<br>
-  // - m_stop_info_sp (if not trace) - preset value<br>
-  // - completed plan stop info - new value with plan from completed plan stack<br>
-  // - m_stop_info_sp (trace stop reason is OK now)<br>
-  // - ask GetPrivateStopInfo to set stop info<br>
-<br>
-  bool have_valid_stop_info = m_stop_info_sp &&<br>
-      m_stop_info_sp ->IsValid() &&<br>
-      m_stop_info_stop_id == stop_id;<br>
-  bool have_valid_completed_plan = completed_plan_sp && completed_plan_sp-><wbr>PlanSucceeded();<br>
-  bool plan_overrides_trace =<br>
-    have_valid_stop_info && have_valid_completed_plan<br>
-    && (m_stop_info_sp-><wbr>GetStopReason() == eStopReasonTrace);<br>
-<br>
-  if (have_valid_stop_info && !plan_overrides_trace) {<br>
-    return m_stop_info_sp;<br>
-  } else if (have_valid_completed_plan) {<br>
-    return StopInfo::<wbr>CreateStopReasonWithPlan(<br>
-        completed_plan_sp, GetReturnValueObject(), GetExpressionVariable());<br>
+  if (plan_sp && plan_sp->PlanSucceeded()) {<br>
+    return StopInfo::<wbr>CreateStopReasonWithPlan(plan_<wbr>sp, GetReturnValueObject(),<br>
+                                              GetExpressionVariable());<br>
   } else {<br>
-    GetPrivateStopInfo();<br>
-    return m_stop_info_sp;<br>
+    if ((m_stop_info_stop_id == stop_id) || // Stop info is valid, just return<br>
+                                            // what we have (even if empty)<br>
+        (m_stop_info_sp &&<br>
+         m_stop_info_sp<br>
+             ->IsValid())) // Stop info is valid, just return what we have<br>
+    {<br>
+      return m_stop_info_sp;<br>
+    } else {<br>
+      GetPrivateStopInfo();<br>
+      return m_stop_info_sp;<br>
+    }<br>
   }<br>
 }<br>
<br>
@@ -467,12 +459,6 @@ bool Thread::StopInfoIsUpToDate() const<br>
                  // date...<br>
 }<br>
<br>
-void Thread::ResetStopInfo() {<br>
-  if (m_stop_info_sp) {<br>
-    m_stop_info_sp.reset();<br>
-  }<br>
-}<br>
-<br>
 void Thread::SetStopInfo(const lldb::StopInfoSP &stop_info_sp) {<br>
   m_stop_info_sp = stop_info_sp;<br>
   if (m_stop_info_sp) {<br>
@@ -540,8 +526,7 @@ bool Thread::CheckpointThreadState(<wbr>Threa<br>
   if (process_sp)<br>
     saved_state.orig_stop_id = process_sp->GetStopID();<br>
   saved_state.current_inlined_<wbr>depth = GetCurrentInlinedDepth();<br>
-  saved_state.m_completed_plan_<wbr>stack = m_completed_plan_stack;<br>
-<br>
+<br>
   return true;<br>
 }<br>
<br>
@@ -574,7 +559,6 @@ bool Thread::<wbr>RestoreThreadStateFromCheck<br>
   SetStopInfo(saved_state.stop_<wbr>info_sp);<br>
   GetStackFrameList()-><wbr>SetCurrentInlinedDepth(<br>
       saved_state.current_inlined_<wbr>depth);<br>
-  m_completed_plan_stack = saved_state.m_completed_plan_<wbr>stack;<br>
   return true;<br>
 }<br>
<br>
@@ -911,9 +895,6 @@ bool Thread::ShouldStop(Event *event_ptr<br>
<br>
   if (should_stop) {<br>
     ThreadPlan *plan_ptr = GetCurrentPlan();<br>
-<br>
-    // Discard the stale plans and all plans below them in the stack,<br>
-    // plus move the completed plans to the completed plan stack<br>
     while (!PlanIsBasePlan(plan_ptr)) {<br>
       bool stale = plan_ptr->IsPlanStale();<br>
       ThreadPlan *examined_plan = plan_ptr;<br>
@@ -924,15 +905,7 @@ bool Thread::ShouldStop(Event *event_ptr<br>
           log->Printf(<br>
               "Plan %s being discarded in cleanup, it says it is already done.",<br>
               examined_plan->GetName());<br>
-        while (GetCurrentPlan() != examined_plan) {<br>
-          DiscardPlan();<br>
-        }<br>
-        if (examined_plan-><wbr>IsPlanComplete()) {<br>
-          // plan is complete but does not explain the stop (example: step to a line<br>
-          // with breakpoint), let us move the plan to completed_plan_stack anyway<br>
-          PopPlan();<br>
-        } else<br>
-          DiscardPlan();<br>
+        DiscardThreadPlansUpToPlan(<wbr>examined_plan);<br>
       }<br>
     }<br>
   }<br>
@@ -1160,10 +1133,6 @@ bool Thread::<wbr>WasThreadPlanDiscarded(Thre<br>
   return false;<br>
 }<br>
<br>
-bool Thread::<wbr>CompletedPlanOverridesBreakpoi<wbr>nt() {<br>
-  return (!m_completed_plan_stack.<wbr>empty()) ;<br>
-}<br>
-<br>
 ThreadPlan *Thread::GetPreviousPlan(<wbr>ThreadPlan *current_plan) {<br>
   if (current_plan == nullptr)<br>
     return nullptr;<br>
<br>
Modified: lldb/trunk/source/Target/<wbr>ThreadPlanStepInstruction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Target/<wbr>ThreadPlanStepInstruction.cpp?<wbr>rev=293269&r1=293268&r2=<wbr>293269&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Target/<wbr>ThreadPlanStepInstruction.cpp (original)<br>
+++ lldb/trunk/source/Target/<wbr>ThreadPlanStepInstruction.cpp Fri Jan 27 01:51:43 2017<br>
@@ -94,15 +94,6 @@ bool ThreadPlanStepInstruction::<wbr>IsPlanSt<br>
   Log *log(lldb_private::<wbr>GetLogIfAllCategoriesSet(<wbr>LIBLLDB_LOG_STEP));<br>
   StackID cur_frame_id = m_thread.GetStackFrameAtIndex(<wbr>0)->GetStackID();<br>
   if (cur_frame_id == m_stack_id) {<br>
-    // Set plan Complete when we reach next instruction<br>
-    uint64_t pc = m_thread.GetRegisterContext()-<wbr>>GetPC(0);<br>
-    uint32_t max_opcode_size = m_thread.CalculateTarget()<br>
-        ->GetArchitecture().<wbr>GetMaximumOpcodeByteSize();<br>
-    bool next_instruction_reached = (pc > m_instruction_addr) &&<br>
-        (pc <= m_instruction_addr + max_opcode_size);<br>
-    if (next_instruction_reached) {<br>
-      SetPlanComplete();<br>
-    }<br>
     return (m_thread.GetRegisterContext()<wbr>->GetPC(0) != m_instruction_addr);<br>
   } else if (cur_frame_id < m_stack_id) {<br>
     // If the current frame is younger than the start frame and we are stepping<br>
<br>
Modified: lldb/trunk/source/Target/<wbr>ThreadPlanStepRange.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=293269&r1=293268&r2=293269&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/source/<wbr>Target/ThreadPlanStepRange.<wbr>cpp?rev=293269&r1=293268&r2=<wbr>293269&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/source/Target/<wbr>ThreadPlanStepRange.cpp (original)<br>
+++ lldb/trunk/source/Target/<wbr>ThreadPlanStepRange.cpp Fri Jan 27 01:51:43 2017<br>
@@ -461,16 +461,6 @@ bool ThreadPlanStepRange::<wbr>IsPlanStale()<br>
     // One tricky bit here is that some stubs don't push a frame, so we should.<br>
     // check that we are in the same symbol.<br>
     if (!InRange()) {<br>
-      // Set plan Complete when we reach next instruction just after the range<br>
-      lldb::addr_t addr = m_thread.GetRegisterContext()-<wbr>>GetPC() - 1;<br>
-      size_t num_ranges = m_address_ranges.size();<br>
-      for (size_t i = 0; i < num_ranges; i++) {<br>
-        bool in_range = m_address_ranges[i].<wbr>ContainsLoadAddress(<br>
-            addr, m_thread.CalculateTarget().<wbr>get());<br>
-        if (in_range) {<br>
-          SetPlanComplete();<br>
-        }<br>
-      }<br>
       return true;<br>
     }<br>
   }<br>
<br>
<br>
______________________________<wbr>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Tim <<a href="mailto:penryu@gmail.com" target="_blank">penryu@gmail.com</a>></div>
</div>