From cf274f910e3885035c278c4ea9df770678d3a8dd Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 9 Apr 2012 22:37:39 +0000 Subject: Rework how master plans declare themselves. Also make "PlanIsBasePlan" not rely only on this being the bottom plan in the stack, but allow the plan to declare itself as such. llvm-svn: 154351 --- lldb/source/Target/Thread.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lldb/source/Target/Thread.cpp') diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 6a86a3b435b..fe5c4295443 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -349,7 +349,7 @@ Thread::ShouldStop (Event* event_ptr) } else { - // If the current plan doesn't explain the stop, then, find one that + // If the current plan doesn't explain the stop, then find one that // does and let it handle the situation. ThreadPlan *plan_ptr = current_plan; while ((plan_ptr = GetPreviousPlan(plan_ptr)) != NULL) @@ -839,6 +839,17 @@ Thread::DiscardThreadPlans(bool force) } } +bool +Thread::PlanIsBasePlan (ThreadPlan *plan_ptr) +{ + if (plan_ptr->IsBasePlan()) + return true; + else if (m_plan_stack.size() == 0) + return false; + else + return m_plan_stack[0].get() == plan_ptr; +} + ThreadPlan * Thread::QueueFundamentalPlan (bool abort_other_plans) { -- cgit v1.2.3