diff options
Diffstat (limited to 'lldb/source/Target/Thread.cpp')
-rw-r--r-- | lldb/source/Target/Thread.cpp | 64 |
1 files changed, 40 insertions, 24 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index de108acf708..af2de6beb72 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -259,38 +259,56 @@ Thread::ShouldStop (Event* event_ptr) if (current_plan->PlanExplainsStop()) { bool over_ride_stop = current_plan->ShouldAutoContinue(event_ptr); - while (1) + + // We're starting from the base plan, so just let it decide; + if (PlanIsBasePlan(current_plan)) + { + should_stop = current_plan->ShouldStop (event_ptr); + if (log) + log->Printf("Base plan says should stop: %d.", current_plan->GetName(), should_stop); + } + else { - should_stop = current_plan->ShouldStop(event_ptr); - if (current_plan->MischiefManaged()) + // Otherwise, don't let the base plan override what the other plans say to do, since + // presumably if there were other plans they would know what to do... + while (1) { - if (should_stop) - current_plan->WillStop(); - - // If a Master Plan wants to stop, and wants to stick on the stack, we let it. - // Otherwise, see if the plan's parent wants to stop. - - if (should_stop && current_plan->IsMasterPlan() && !current_plan->OkayToDiscard()) - { - PopPlan(); + if (PlanIsBasePlan(current_plan)) break; - } - else + + should_stop = current_plan->ShouldStop(event_ptr); + if (log) + log->Printf("Plan %s should stop: %d.", current_plan->GetName(), should_stop); + if (current_plan->MischiefManaged()) { + if (should_stop) + current_plan->WillStop(); - PopPlan(); + // If a Master Plan wants to stop, and wants to stick on the stack, we let it. + // Otherwise, see if the plan's parent wants to stop. - current_plan = GetCurrentPlan(); - if (current_plan == NULL) + if (should_stop && current_plan->IsMasterPlan() && !current_plan->OkayToDiscard()) { + PopPlan(); break; } - } + else + { - } - else - { - break; + PopPlan(); + + current_plan = GetCurrentPlan(); + if (current_plan == NULL) + { + break; + } + } + + } + else + { + break; + } } } if (over_ride_stop) @@ -476,7 +494,6 @@ Thread::GetCompletedPlan () bool Thread::IsThreadPlanDone (ThreadPlan *plan) { - ThreadPlanSP empty_plan_sp; if (!m_completed_plan_stack.empty()) { for (int i = m_completed_plan_stack.size() - 1; i >= 0; i--) @@ -491,7 +508,6 @@ Thread::IsThreadPlanDone (ThreadPlan *plan) bool Thread::WasThreadPlanDiscarded (ThreadPlan *plan) { - ThreadPlanSP empty_plan_sp; if (!m_discarded_plan_stack.empty()) { for (int i = m_discarded_plan_stack.size() - 1; i >= 0; i--) |