Fixed a problem where stepping out would turn into

a continue if the unwinder didn't unwind correctly.

<rdar://problem/11989668>

llvm-svn: 161086
This commit is contained in:
Sean Callanan
2012-07-31 22:19:25 +00:00
parent 204720bc71
commit 708709c015
2 changed files with 16 additions and 3 deletions

View File

@@ -975,8 +975,16 @@ Thread::QueueThreadPlanForStepOut
stop_vote,
run_vote,
frame_idx));
QueueThreadPlan (thread_plan_sp, abort_other_plans);
return thread_plan_sp.get();
if (thread_plan_sp->ValidatePlan(NULL))
{
QueueThreadPlan (thread_plan_sp, abort_other_plans);
return thread_plan_sp.get();
}
else
{
return NULL;
}
}
ThreadPlan *

View File

@@ -95,6 +95,10 @@ ThreadPlanStepOut::ThreadPlanStepOut
// FIXME - can we do this more securely if we know first_insn?
m_return_addr = return_frame_sp->GetFrameCodeAddress().GetLoadAddress(&m_thread.GetProcess()->GetTarget());
if (m_return_addr == LLDB_INVALID_ADDRESS)
return;
Breakpoint *return_bp = m_thread.CalculateTarget()->CreateBreakpoint (m_return_addr, true).get();
if (return_bp != NULL)
{
@@ -157,7 +161,8 @@ ThreadPlanStepOut::ValidatePlan (Stream *error)
return m_step_through_inline_plan_sp->ValidatePlan (error);
else if (m_return_bp_id == LLDB_INVALID_BREAK_ID)
{
error->PutCString("Could not create return address breakpoint.");
if (error)
error->PutCString("Could not create return address breakpoint.");
return false;
}
else