Skip to content

Commit 5f8d7b2

Browse files
committed
Verify that the ShouldStopHere callback actually can produce a step out plan.
I have two reports of lldb crashing because the callback said it had a way to get out from here, but then failed to produce a plan to do so. I don't know why this happens, but in any case, we should stop in response to the failure, not crash. <rdar://problem/60642337>
1 parent ef37f13 commit 5f8d7b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lldb/source/Target/ThreadPlanStepOut.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,14 @@ bool ThreadPlanStepOut::ShouldStop(Event *event_ptr) {
407407
} else {
408408
m_step_out_further_plan_sp =
409409
QueueStepOutFromHerePlan(m_flags, eFrameCompareOlder, m_status);
410+
// I have a few reports of getting here and not being able to
411+
// actually generate a step out from here plan. That shouldn't happen
412+
// because the ShouldStopHere callback shouldn't return true if it
413+
// can't make a step out plan. So far I don't know how that can
414+
// happen, but it's better to just stop here than to crash.
415+
if (!m_step_out_further_plan_sp)
416+
return true;
417+
410418
if (m_step_out_further_plan_sp->GetKind() == eKindStepOut)
411419
{
412420
// If we are planning to step out further, then the frame we are going

0 commit comments

Comments
 (0)