Clean up the usage of "MasterPlan" status in ThreadPlans. Only user-initiated plans

should be MasterPlans that want to stay on the plan stack.  So make all plans NOT
MasterPlans by default and then have the SB API's and the CommandObjectThread step
commands set this explicitly.

Also added a "clean up" phase to the Thread::ShouldStop so that if plans get stranded
on the stack, we can remove them.  This is done by adding an IsPlanStale method to the
thread plans, and if the plan can know that it is no longer relevant, it returns true,
and the plan and its sub-plans will get discarded.

llvm-svn: 156101
This commit is contained in:
Jim Ingham
2012-05-03 21:19:36 +00:00
parent 60d835fa59
commit 64e7ead1d8
17 changed files with 280 additions and 183 deletions

View File

@@ -81,7 +81,6 @@ ThreadPlanStepOut::ThreadPlanStepOut
eVoteNoOpinion,
eVoteNoOpinion,
frame_idx - 1));
m_step_out_plan_sp->SetOkayToDiscard(true);
}
else
{
@@ -468,3 +467,17 @@ ThreadPlanStepOut::CalculateReturnValue ()
}
}
}
bool
ThreadPlanStepOut::IsPlanStale()
{
// If we are still lower on the stack than the frame we are returning to, then
// there's something for us to do. Otherwise, we're stale.
StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
if (frame_zero_id < m_step_out_to_id)
return false;
else
return true;
}