diff options
author | Jim Ingham <jingham@apple.com> | 2014-08-06 01:49:59 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-08-06 01:49:59 +0000 |
commit | 862d1bbdf6f763b93e42ac1419f58e01f02be37f (patch) | |
tree | 3e24ec7df73f2ceb6de3b63cf94c5efd4b4f4f80 /lldb/source/Target | |
parent | 515c24b7e05c68fe71db4783e1398357ea6fc7a4 (diff) | |
download | bcm5719-llvm-862d1bbdf6f763b93e42ac1419f58e01f02be37f.tar.gz bcm5719-llvm-862d1bbdf6f763b93e42ac1419f58e01f02be37f.zip |
When stepping, handle the case where the step leaves us with
the same parent frame, but different current frame - e.g. when
you step past a tail call exit from a function. Apply the same
"avoid-no-debug" rules to this case as for a "step-in".
<rdar://problem/16189225>
llvm-svn: 214946
Diffstat (limited to 'lldb/source/Target')
-rw-r--r-- | lldb/source/Target/ThreadPlanShouldStopHere.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInRange.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverRange.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepRange.cpp | 10 |
4 files changed, 18 insertions, 4 deletions
diff --git a/lldb/source/Target/ThreadPlanShouldStopHere.cpp b/lldb/source/Target/ThreadPlanShouldStopHere.cpp index 5314b5d9b5f..e89f5d2bde1 100644 --- a/lldb/source/Target/ThreadPlanShouldStopHere.cpp +++ b/lldb/source/Target/ThreadPlanShouldStopHere.cpp @@ -82,7 +82,8 @@ ThreadPlanShouldStopHere::DefaultShouldStopHereCallback (ThreadPlan *current_pla Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if ((operation == eFrameCompareOlder && flags.Test(eStepOutAvoidNoDebug)) - || (operation == eFrameCompareYounger && flags.Test(eStepInAvoidNoDebug))) + || (operation == eFrameCompareYounger && flags.Test(eStepInAvoidNoDebug)) + || (operation == eFrameCompareSameParent && flags.Test(eStepInAvoidNoDebug))) { if (!frame->HasDebugInformation()) { diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index c149c34fbaf..35826ec16d0 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -190,7 +190,7 @@ ThreadPlanStepInRange::ShouldStop (Event *event_ptr) FrameComparison frame_order = CompareCurrentFrameToStartFrame(); - if (frame_order == eFrameCompareOlder) + if (frame_order == eFrameCompareOlder || frame_order == eFrameCompareSameParent) { // If we're in an older frame then we should stop. // @@ -201,7 +201,7 @@ ThreadPlanStepInRange::ShouldStop (Event *event_ptr) if (!m_sub_plan_sp) { // Otherwise check the ShouldStopHere for step out: - m_sub_plan_sp = CheckShouldStopHereAndQueueStepOut(eFrameCompareOlder); + m_sub_plan_sp = CheckShouldStopHereAndQueueStepOut(frame_order); if (log) log->Printf ("ShouldStopHere says we should step out of this frame."); } @@ -402,6 +402,7 @@ ThreadPlanStepInRange::DefaultShouldStopHereCallback (ThreadPlan *current_plan, Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if ((operation == eFrameCompareYounger && flags.Test(eStepInAvoidNoDebug)) + || (operation == eFrameCompareSameParent && flags.Test(eStepOutAvoidNoDebug)) || (operation == eFrameCompareOlder && flags.Test(eStepOutAvoidNoDebug))) { if (!frame->HasDebugInformation()) diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index 8363183a420..a4f3743346e 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -90,6 +90,10 @@ ThreadPlanStepOverRange::SetupAvoidNoDebug(LazyBool step_out_avoids_code_without GetFlags().Set (ThreadPlanShouldStopHere::eStepOutAvoidNoDebug); else GetFlags().Clear (ThreadPlanShouldStopHere::eStepOutAvoidNoDebug); + // Step Over plans should always avoid no-debug on step in. Seems like you shouldn't + // have to say this, but a tail call looks more like a step in that a step out, so + // we want to catch this case. + GetFlags().Set (ThreadPlanShouldStopHere::eStepInAvoidNoDebug); } bool diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp index 66b6953c61a..35562723960 100644 --- a/lldb/source/Target/ThreadPlanStepRange.cpp +++ b/lldb/source/Target/ThreadPlanStepRange.cpp @@ -50,6 +50,7 @@ ThreadPlanStepRange::ThreadPlanStepRange (ThreadPlanKind kind, m_address_ranges (), m_stop_others (stop_others), m_stack_id (), + m_parent_stack_id(), m_no_more_plans (false), m_first_run_event (true), m_use_fast_step(false) @@ -57,6 +58,7 @@ ThreadPlanStepRange::ThreadPlanStepRange (ThreadPlanKind kind, m_use_fast_step = GetTarget().GetUseFastStepping(); AddRange(range); m_stack_id = m_thread.GetStackFrameAtIndex(0)->GetStackID(); + m_parent_stack_id = m_thread.GetStackFrameAtIndex(1)->GetStackID(); } ThreadPlanStepRange::~ThreadPlanStepRange () @@ -270,7 +272,13 @@ ThreadPlanStepRange::CompareCurrentFrameToStartFrame() } else { - frame_order = eFrameCompareOlder; + StackID cur_parent_id = m_thread.GetStackFrameAtIndex(1)->GetStackID(); + if (m_parent_stack_id.IsValid() + && cur_parent_id.IsValid() + && m_parent_stack_id == cur_parent_id) + frame_order = eFrameCompareSameParent; + else + frame_order = eFrameCompareOlder; } return frame_order; } |