diff options
author | emaste <emaste@FreeBSD.org> | 2014-11-25 21:00:58 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-11-25 21:00:58 +0000 |
commit | 01ee1789d6aa7294e5966a97f8d29387f6f81699 (patch) | |
tree | c94307da318be46e5aeea1a325c1e91749506e4f /source/Target/ThreadPlanStepOverRange.cpp | |
parent | 788502c6f6261e2d84ef85d1052b41a6c5be31b3 (diff) | |
download | FreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.zip FreeBSD-src-01ee1789d6aa7294e5966a97f8d29387f6f81699.tar.gz |
Import LLDB as of upstream SVN r216948 (git 50f7fe44)
This corresponds with the branchpoint for the 3.5 release.
A number of files not required for the FreeBSD build have been removed.
Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Target/ThreadPlanStepOverRange.cpp')
-rw-r--r-- | source/Target/ThreadPlanStepOverRange.cpp | 58 |
1 files changed, 50 insertions, 8 deletions
diff --git a/source/Target/ThreadPlanStepOverRange.cpp b/source/Target/ThreadPlanStepOverRange.cpp index 2d8108b..a4f3743 100644 --- a/source/Target/ThreadPlanStepOverRange.cpp +++ b/source/Target/ThreadPlanStepOverRange.cpp @@ -31,6 +31,7 @@ using namespace lldb_private; using namespace lldb; +uint32_t ThreadPlanStepOverRange::s_default_flag_values = 0; //---------------------------------------------------------------------- // ThreadPlanStepOverRange: Step through a stack range, either stepping over or into @@ -42,11 +43,15 @@ ThreadPlanStepOverRange::ThreadPlanStepOverRange Thread &thread, const AddressRange &range, const SymbolContext &addr_context, - lldb::RunMode stop_others + lldb::RunMode stop_others, + LazyBool step_out_avoids_code_without_debug_info ) : ThreadPlanStepRange (ThreadPlan::eKindStepOverRange, "Step range stepping over", thread, range, addr_context, stop_others), + ThreadPlanShouldStopHere (this), m_first_resume(true) { + SetFlagsToDefault(); + SetupAvoidNoDebug(step_out_avoids_code_without_debug_info); } ThreadPlanStepOverRange::~ThreadPlanStepOverRange () @@ -65,6 +70,32 @@ ThreadPlanStepOverRange::GetDescription (Stream *s, lldb::DescriptionLevel level } } +void +ThreadPlanStepOverRange::SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info) +{ + bool avoid_nodebug = true; + switch (step_out_avoids_code_without_debug_info) + { + case eLazyBoolYes: + avoid_nodebug = true; + break; + case eLazyBoolNo: + avoid_nodebug = false; + break; + case eLazyBoolCalculate: + avoid_nodebug = m_thread.GetStepOutAvoidsNoDebug(); + break; + } + if (avoid_nodebug) + 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 ThreadPlanStepOverRange::IsEquivalentContext(const SymbolContext &context) { @@ -146,18 +177,21 @@ ThreadPlanStepOverRange::ShouldStop (Event *event_ptr) const SymbolContext &older_context = older_frame_sp->GetSymbolContext(eSymbolContextEverything); if (IsEquivalentContext(older_context)) { - new_plan_sp = m_thread.QueueThreadPlanForStepOut (false, - NULL, - true, - stop_others, - eVoteNo, - eVoteNoOpinion, - 0); + new_plan_sp = m_thread.QueueThreadPlanForStepOutNoShouldStop (false, + NULL, + true, + stop_others, + eVoteNo, + eVoteNoOpinion, + 0); break; } else { new_plan_sp = m_thread.QueueThreadPlanForStepThrough (m_stack_id, false, stop_others); + // If we found a way through, then we should stop recursing. + if (new_plan_sp) + break; } } } @@ -277,6 +311,13 @@ ThreadPlanStepOverRange::ShouldStop (Event *event_ptr) // If we get to this point, we're not going to use a previously set "next branch" breakpoint, so delete it: ClearNextBranchBreakpoint(); + + // If we haven't figured out something to do yet, then ask the ShouldStopHere callback: + if (!new_plan_sp) + { + new_plan_sp = CheckShouldStopHereAndQueueStepOut (frame_order); + } + if (!new_plan_sp) m_no_more_plans = true; else @@ -390,3 +431,4 @@ ThreadPlanStepOverRange::DoWillResume (lldb::StateType resume_state, bool curren return true; } + |