diff options
Diffstat (limited to 'lldb/source/Target')
-rw-r--r-- | lldb/source/Target/Process.cpp | 42 | ||||
-rw-r--r-- | lldb/source/Target/StopInfo.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Target/Thread.cpp | 23 | ||||
-rw-r--r-- | lldb/source/Target/ThreadList.cpp | 13 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlan.cpp | 20 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanBase.cpp | 20 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanCallFunction.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanRunToAddress.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInRange.cpp | 69 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepInstruction.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOut.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverRange.cpp | 23 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepThrough.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepUntil.cpp | 5 |
15 files changed, 169 insertions, 80 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index fda71060d47..e5a92c615ac 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1643,11 +1643,11 @@ Process::GetState() } void -Process::SetPublicState (StateType new_state) +Process::SetPublicState (StateType new_state, bool restarted) { Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STATE | LIBLLDB_LOG_PROCESS)); if (log) - log->Printf("Process::SetPublicState (%s)", StateAsCString(new_state)); + log->Printf("Process::SetPublicState (state = %s, restarted = %i)", StateAsCString(new_state), restarted); const StateType old_state = m_public_state.GetValue(); m_public_state.SetValue (new_state); @@ -1666,9 +1666,9 @@ Process::SetPublicState (StateType new_state) { const bool old_state_is_stopped = StateIsStoppedState(old_state, false); const bool new_state_is_stopped = StateIsStoppedState(new_state, false); - if (old_state_is_stopped != new_state_is_stopped) + if ((old_state_is_stopped != new_state_is_stopped)) { - if (new_state_is_stopped) + if (new_state_is_stopped && !restarted) { if (log) log->Printf("Process::SetPublicState (%s) -- unlocking run lock", StateAsCString(new_state)); @@ -2866,7 +2866,8 @@ Process::Launch (const ProcessLaunchInfo &launch_info) error = WillLaunch (exe_module); if (error.Success()) { - SetPublicState (eStateLaunching); + const bool restarted = false; + SetPublicState (eStateLaunching, restarted); m_should_detach = false; if (m_public_run_lock.WriteTryLock()) @@ -2993,11 +2994,13 @@ Process::AttachCompletionHandler::PerformAction (lldb::EventSP &event_sp) // During attach, prior to sending the eStateStopped event, // lldb_private::Process subclasses must set the new process ID. assert (m_process->GetID() != LLDB_INVALID_PROCESS_ID); + // We don't want these events to be reported, so go set the ShouldReportStop here: + m_process->GetThreadList().SetShouldReportStop (eVoteNo); + if (m_exec_count > 0) { --m_exec_count; - m_process->PrivateResume (); - Process::ProcessEventData::SetRestartedInEvent (event_sp.get(), true); + RequestResume(); return eEventActionRetry; } else @@ -3056,7 +3059,8 @@ Process::Attach (ProcessAttachInfo &attach_info) if (m_public_run_lock.WriteTryLock()) { m_should_detach = true; - SetPublicState (eStateAttaching); + const bool restarted = false; + SetPublicState (eStateAttaching, restarted); // Now attach using these arguments. error = DoAttachToProcessWithName (process_name, wait_for_launch, attach_info); } @@ -3134,7 +3138,8 @@ Process::Attach (ProcessAttachInfo &attach_info) { // Now attach using these arguments. m_should_detach = true; - SetPublicState (eStateAttaching); + const bool restarted = false; + SetPublicState (eStateAttaching, restarted); error = DoAttachToProcessWithID (attach_pid, attach_info); } else @@ -3287,7 +3292,7 @@ Process::PrivateResume () // that they are supposed to have when the process is resumed // (suspended/running/stepping). Threads should also check // their resume signal in lldb::Thread::GetResumeSignal() - // to see if they are suppoed to start back up with a signal. + // to see if they are supposed to start back up with a signal. if (m_thread_list.WillResume()) { // Last thing, do the PreResumeActions. @@ -3677,6 +3682,7 @@ Process::ShouldBroadcastEvent (Event *event_ptr) // If we are going to stop, then we always broadcast the event. // If we aren't going to stop, let the thread plans decide if we're going to report this event. // If no thread has an opinion, we don't report it. + RefreshStateAfterStop (); if (ProcessEventData::GetInterruptedFromEvent (event_ptr)) { @@ -3688,15 +3694,17 @@ Process::ShouldBroadcastEvent (Event *event_ptr) } else { + bool was_restarted = ProcessEventData::GetRestartedFromEvent (event_ptr); + bool should_resume = false; + // It makes no sense to ask "ShouldStop" if we've already been restarted... // Asking the thread list is also not likely to go well, since we are running again. // So in that case just report the event. - bool was_restarted = ProcessEventData::GetRestartedFromEvent (event_ptr); - bool should_resume = false; if (!was_restarted) should_resume = m_thread_list.ShouldStop (event_ptr) == false; - if (was_restarted || should_resume) + + if (was_restarted || should_resume || m_resume_requested) { Vote stop_vote = m_thread_list.ShouldReportStop (event_ptr); if (log) @@ -3883,6 +3891,8 @@ void Process::HandlePrivateEvent (EventSP &event_sp) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); + m_resume_requested = false; + m_currently_handling_event.SetValue(true, eBroadcastNever); const StateType new_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get()); @@ -3911,6 +3921,7 @@ Process::HandlePrivateEvent (EventSP &event_sp) { // FIXME: should cons up an exited event, and discard this one. SetExitStatus(0, m_next_event_action_ap->GetExitString()); + m_currently_handling_event.SetValue(false, eBroadcastAlways); SetNextEventAction(NULL); return; } @@ -4095,12 +4106,11 @@ Process::ProcessEventData::DoOnRemoval (Event *event_ptr) // the public event queue, then other times when we're pretending that this is where we stopped at the // end of expression evaluation. m_update_state is used to distinguish these // three cases; it is 0 when we're just pulling it off for private handling, - // and > 1 for expression evaluation, and we don't want to do the breakpoint command handling then. - + // and > 1 for expression evaluation, and we don't want to do the breakpoint command handling then. if (m_update_state != 1) return; - m_process_sp->SetPublicState (m_state); + m_process_sp->SetPublicState (m_state, Process::ProcessEventData::GetRestartedFromEvent(event_ptr)); // If we're stopped and haven't restarted, then do the breakpoint commands here: if (m_state == eStateStopped && ! m_restarted) diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp index e4bcb95f274..3be1f9301d8 100644 --- a/lldb/source/Target/StopInfo.cpp +++ b/lldb/source/Target/StopInfo.cpp @@ -39,8 +39,8 @@ StopInfo::StopInfo (Thread &thread, uint64_t value) : m_stop_id (thread.GetProcess()->GetStopID()), m_resume_id (thread.GetProcess()->GetResumeID()), m_value (value), - m_override_set(false), - m_override_value(true) + m_override_should_notify (eLazyBoolCalculate), + m_override_should_stop (eLazyBoolCalculate) { } @@ -201,7 +201,7 @@ public: } virtual bool - ShouldNotify (Event *event_ptr) + DoShouldNotify (Event *event_ptr) { ThreadSP thread_sp (m_thread_wp.lock()); if (thread_sp) @@ -849,7 +849,7 @@ public: // If should stop returns false, check if we should notify of this event virtual bool - ShouldNotify (Event *event_ptr) + DoShouldNotify (Event *event_ptr) { ThreadSP thread_sp (m_thread_wp.lock()); if (thread_sp) diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 5096a91cf1f..23c75e3e9ac 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -259,7 +259,8 @@ Thread::Thread (Process &process, lldb::tid_t tid) : m_temporary_resume_state (eStateRunning), m_unwinder_ap (), m_destroy_called (false), - m_thread_stop_reason_stop_id (0) + m_thread_stop_reason_stop_id (0), + m_override_should_notify (eLazyBoolCalculate) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) @@ -394,7 +395,13 @@ Thread::SetStopInfo (const lldb::StopInfoSP &stop_info_sp) { m_actual_stop_info_sp = stop_info_sp; if (m_actual_stop_info_sp) + { m_actual_stop_info_sp->MakeStopInfoValid(); + // If we are overriding the ShouldReportStop, do that here: + if (m_override_should_notify != eLazyBoolCalculate) + m_actual_stop_info_sp->OverrideShouldNotify (m_override_should_notify == eLazyBoolYes); + } + ProcessSP process_sp (GetProcess()); if (process_sp) m_thread_stop_reason_stop_id = process_sp->GetStopID(); @@ -403,6 +410,19 @@ Thread::SetStopInfo (const lldb::StopInfoSP &stop_info_sp) } void +Thread::SetShouldReportStop (Vote vote) +{ + if (vote == eVoteNoOpinion) + return; + else + { + m_override_should_notify = (vote == eVoteYes ? eLazyBoolYes : eLazyBoolNo); + if (m_actual_stop_info_sp) + m_actual_stop_info_sp->OverrideShouldNotify (m_override_should_notify == eLazyBoolYes); + } +} + +void Thread::SetStopInfoToNothing() { // Note, we can't just NULL out the private reason, or the native thread implementation will try to @@ -530,6 +550,7 @@ Thread::ShouldResume (StateType resume_state) // At this point clear the completed plan stack. m_completed_plan_stack.clear(); m_discarded_plan_stack.clear(); + m_override_should_notify = eLazyBoolCalculate; m_temporary_resume_state = resume_state; diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index 80df5957c3f..4971d6c963f 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -376,6 +376,19 @@ ThreadList::ShouldReportStop (Event *event_ptr) return result; } +void +ThreadList::SetShouldReportStop (Vote vote) +{ + Mutex::Locker locker(GetMutex()); + m_process->UpdateThreadListIfNeeded(); + collection::iterator pos, end = m_threads.end(); + for (pos = m_threads.begin(); pos != end; ++pos) + { + ThreadSP thread_sp(*pos); + thread_sp->SetShouldReportStop (vote); + } +} + Vote ThreadList::ShouldReportRun (Event *event_ptr) { diff --git a/lldb/source/Target/ThreadPlan.cpp b/lldb/source/Target/ThreadPlan.cpp index d740879ae1d..bc0ce57f9fc 100644 --- a/lldb/source/Target/ThreadPlan.cpp +++ b/lldb/source/Target/ThreadPlan.cpp @@ -36,6 +36,7 @@ ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, Vo m_kind (kind), m_name (name), m_plan_complete_mutex (Mutex::eMutexTypeRecursive), + m_cached_plan_explains_stop (eLazyBoolCalculate), m_plan_complete (false), m_plan_private (false), m_okay_to_discard (true), @@ -53,6 +54,21 @@ ThreadPlan::~ThreadPlan() } bool +ThreadPlan::PlanExplainsStop (Event *event_ptr) +{ + if (m_cached_plan_explains_stop == eLazyBoolCalculate) + { + bool actual_value = DoPlanExplainsStop(event_ptr); + m_cached_plan_explains_stop = actual_value ? eLazyBoolYes : eLazyBoolNo; + return actual_value; + } + else + { + return m_cached_plan_explains_stop == eLazyBoolYes; + } +} + +bool ThreadPlan::IsPlanComplete () { Mutex::Locker locker(m_plan_complete_mutex); @@ -131,6 +147,8 @@ ThreadPlan::SetStopOthers (bool new_value) bool ThreadPlan::WillResume (StateType resume_state, bool current_plan) { + m_cached_plan_explains_stop = eLazyBoolCalculate; + if (current_plan) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); @@ -154,7 +172,7 @@ ThreadPlan::WillResume (StateType resume_state, bool current_plan) StopOthers()); } } - return true; + return DoWillResume (resume_state, current_plan); } lldb::user_id_t diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index 817393924d1..998cc08f286 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -68,7 +68,7 @@ ThreadPlanBase::ValidatePlan (Stream *error) } bool -ThreadPlanBase::PlanExplainsStop (Event *event_ptr) +ThreadPlanBase::DoPlanExplainsStop (Event *event_ptr) { // The base plan should defer to its tracer, since by default it // always handles the stop. @@ -78,6 +78,22 @@ ThreadPlanBase::PlanExplainsStop (Event *event_ptr) return true; } +Vote +ThreadPlanBase::ShouldReportStop(Event *event_ptr) +{ + StopInfoSP stop_info_sp = m_thread.GetStopInfo (); + if (stop_info_sp) + { + bool should_notify = stop_info_sp->ShouldNotify(event_ptr); + if (should_notify) + return eVoteYes; + else + return eVoteNoOpinion; + } + else + return eVoteNoOpinion; +} + bool ThreadPlanBase::ShouldStop (Event *event_ptr) { @@ -201,7 +217,7 @@ ThreadPlanBase::WillStop () } bool -ThreadPlanBase::WillResume (lldb::StateType resume_state, bool current_plan) +ThreadPlanBase::DoWillResume (lldb::StateType resume_state, bool current_plan) { // Reset these to the default values so we don't set them wrong, then not get asked // for a while, then return the wrong answer. diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 9f7bd8a0c24..0a77d0d1537 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -362,7 +362,7 @@ ThreadPlanCallFunction::ShouldReportStop(Event *event_ptr) } bool -ThreadPlanCallFunction::PlanExplainsStop (Event *event_ptr) +ThreadPlanCallFunction::DoPlanExplainsStop (Event *event_ptr) { Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP|LIBLLDB_LOG_PROCESS)); m_real_stop_info_sp = GetPrivateStopReason(); @@ -475,9 +475,9 @@ ThreadPlanCallFunction::PlanExplainsStop (Event *event_ptr) bool ThreadPlanCallFunction::ShouldStop (Event *event_ptr) { - // We do some computation in PlanExplainsStop that may or may not set the plan as complete. + // We do some computation in DoPlanExplainsStop that may or may not set the plan as complete. // We need to do that here to make sure our state is correct. - PlanExplainsStop(event_ptr); + DoPlanExplainsStop(event_ptr); if (IsPlanComplete()) { diff --git a/lldb/source/Target/ThreadPlanRunToAddress.cpp b/lldb/source/Target/ThreadPlanRunToAddress.cpp index 56c16542967..86825d2eb26 100644 --- a/lldb/source/Target/ThreadPlanRunToAddress.cpp +++ b/lldb/source/Target/ThreadPlanRunToAddress.cpp @@ -188,7 +188,7 @@ ThreadPlanRunToAddress::ValidatePlan (Stream *error) } bool -ThreadPlanRunToAddress::PlanExplainsStop (Event *event_ptr) +ThreadPlanRunToAddress::DoPlanExplainsStop (Event *event_ptr) { return AtOurAddress(); } diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index e6da7a037c0..d5a6b10858f 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -379,7 +379,7 @@ ThreadPlanStepInRange::DefaultShouldStopHereCallback (ThreadPlan *current_plan, } bool -ThreadPlanStepInRange::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepInRange::DoPlanExplainsStop (Event *event_ptr) { // We always explain a stop. Either we've just done a single step, in which // case we'll do our ordinary processing, or we stopped for some @@ -394,41 +394,54 @@ ThreadPlanStepInRange::PlanExplainsStop (Event *event_ptr) // // The only variation is that if we are doing "step by running to next branch" in which case // if we hit our branch breakpoint we don't set the plan to complete. + + bool return_value; if (m_virtual_step) - return true; - - StopInfoSP stop_info_sp = GetPrivateStopReason(); - if (stop_info_sp) { - StopReason reason = stop_info_sp->GetStopReason(); - - switch (reason) + return_value = true; + } + else + { + StopInfoSP stop_info_sp = GetPrivateStopReason(); + if (stop_info_sp) { - case eStopReasonBreakpoint: - if (NextRangeBreakpointExplainsStop(stop_info_sp)) - return true; - case eStopReasonWatchpoint: - case eStopReasonSignal: - case eStopReasonException: - case eStopReasonExec: - case eStopReasonThreadExiting: + StopReason reason = stop_info_sp->GetStopReason(); + + switch (reason) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); - if (log) - log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step."); + case eStopReasonBreakpoint: + if (NextRangeBreakpointExplainsStop(stop_info_sp)) + { + return_value = true; + break; + } + case eStopReasonWatchpoint: + case eStopReasonSignal: + case eStopReasonException: + case eStopReasonExec: + case eStopReasonThreadExiting: + { + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log) + log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step."); + } + return_value = false; + break; + default: + return_value = true; + break; } - return false; - break; - default: - break; } + else + return_value = true; } - return true; + + return return_value; } bool -ThreadPlanStepInRange::WillResume (lldb::StateType resume_state, bool current_plan) +ThreadPlanStepInRange::DoWillResume (lldb::StateType resume_state, bool current_plan) { if (resume_state == eStateStepping && current_plan) { @@ -438,7 +451,7 @@ ThreadPlanStepInRange::WillResume (lldb::StateType resume_state, bool current_pl { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log) - log->Printf ("ThreadPlanStepInRange::WillResume: returning false, inline_depth: %d", + log->Printf ("ThreadPlanStepInRange::DoWillResume: returning false, inline_depth: %d", m_thread.GetCurrentInlinedDepth()); SetStopInfo(StopInfo::CreateStopReasonToTrace(m_thread)); @@ -448,7 +461,5 @@ ThreadPlanStepInRange::WillResume (lldb::StateType resume_state, bool current_pl } return !step_without_resume; } - else - return ThreadPlan::WillResume(resume_state, current_plan); - + return true; } diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp index 32b9897bcec..fa45b2b8cf6 100644 --- a/lldb/source/Target/ThreadPlanStepInstruction.cpp +++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp @@ -81,7 +81,7 @@ ThreadPlanStepInstruction::ValidatePlan (Stream *error) } bool -ThreadPlanStepInstruction::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepInstruction::DoPlanExplainsStop (Event *event_ptr) { StopInfoSP stop_info_sp = GetPrivateStopReason(); if (stop_info_sp) diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp index 46b011cdb40..86f99b250b2 100644 --- a/lldb/source/Target/ThreadPlanStepOut.cpp +++ b/lldb/source/Target/ThreadPlanStepOut.cpp @@ -174,7 +174,7 @@ ThreadPlanStepOut::ValidatePlan (Stream *error) } bool -ThreadPlanStepOut::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepOut::DoPlanExplainsStop (Event *event_ptr) { // If one of our child plans just finished, then we do explain the stop. if (m_step_out_plan_sp) @@ -336,9 +336,8 @@ ThreadPlanStepOut::GetPlanRunState () } bool -ThreadPlanStepOut::WillResume (StateType resume_state, bool current_plan) +ThreadPlanStepOut::DoWillResume (StateType resume_state, bool current_plan) { - ThreadPlan::WillResume (resume_state, current_plan); if (m_step_out_plan_sp || m_step_through_inline_plan_sp) return true; diff --git a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp index 9f3c4b04fa3..00a19804b2c 100644 --- a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -58,7 +58,7 @@ ThreadPlanStepOverBreakpoint::ValidatePlan (Stream *error) } bool -ThreadPlanStepOverBreakpoint::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepOverBreakpoint::DoPlanExplainsStop (Event *event_ptr) { StopInfoSP stop_info_sp = GetPrivateStopReason(); if (stop_info_sp) @@ -91,10 +91,8 @@ ThreadPlanStepOverBreakpoint::GetPlanRunState () } bool -ThreadPlanStepOverBreakpoint::WillResume (StateType resume_state, bool current_plan) +ThreadPlanStepOverBreakpoint::DoWillResume (StateType resume_state, bool current_plan) { - ThreadPlan::WillResume (resume_state, current_plan); - if (current_plan) { BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByAddress (m_breakpoint_addr)); diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index 85642ad508e..33812925baf 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -290,7 +290,7 @@ ThreadPlanStepOverRange::ShouldStop (Event *event_ptr) } bool -ThreadPlanStepOverRange::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepOverRange::DoPlanExplainsStop (Event *event_ptr) { // For crashes, breakpoint hits, signals, etc, let the base plan (or some plan above us) // handle the stop. That way the user can see the stop, step around, and then when they @@ -301,6 +301,8 @@ ThreadPlanStepOverRange::PlanExplainsStop (Event *event_ptr) Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); StopInfoSP stop_info_sp = GetPrivateStopReason(); + bool return_value; + if (stop_info_sp) { StopReason reason = stop_info_sp->GetStopReason(); @@ -308,13 +310,13 @@ ThreadPlanStepOverRange::PlanExplainsStop (Event *event_ptr) switch (reason) { case eStopReasonTrace: - return true; + return_value = true; break; case eStopReasonBreakpoint: if (NextRangeBreakpointExplainsStop(stop_info_sp)) - return true; + return_value = true; else - return false; + return_value = false; break; case eStopReasonWatchpoint: case eStopReasonSignal: @@ -324,15 +326,18 @@ ThreadPlanStepOverRange::PlanExplainsStop (Event *event_ptr) default: if (log) log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step."); - return false; + return_value = false; break; } } - return true; + else + return_value = true; + + return return_value; } bool -ThreadPlanStepOverRange::WillResume (lldb::StateType resume_state, bool current_plan) +ThreadPlanStepOverRange::DoWillResume (lldb::StateType resume_state, bool current_plan) { if (resume_state != eStateSuspended && m_first_resume) { @@ -346,7 +351,7 @@ ThreadPlanStepOverRange::WillResume (lldb::StateType resume_state, bool current_ { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log) - log->Printf ("ThreadPlanStepInRange::WillResume: adjusting range to the frame at inlined depth %d.", + log->Printf ("ThreadPlanStepInRange::DoWillResume: adjusting range to the frame at inlined depth %d.", m_thread.GetCurrentInlinedDepth()); StackFrameSP stack_sp = m_thread.GetStackFrameAtIndex(0); if (stack_sp) @@ -379,5 +384,5 @@ ThreadPlanStepOverRange::WillResume (lldb::StateType resume_state, bool current_ } } - return ThreadPlan::WillResume(resume_state, current_plan); + return true; } diff --git a/lldb/source/Target/ThreadPlanStepThrough.cpp b/lldb/source/Target/ThreadPlanStepThrough.cpp index d6dab171037..92d1fcd850d 100644 --- a/lldb/source/Target/ThreadPlanStepThrough.cpp +++ b/lldb/source/Target/ThreadPlanStepThrough.cpp @@ -139,7 +139,7 @@ ThreadPlanStepThrough::ValidatePlan (Stream *error) } bool -ThreadPlanStepThrough::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepThrough::DoPlanExplainsStop (Event *event_ptr) { // If we have a sub-plan, it will have been asked first if we explain the stop, and // we won't get asked. The only time we would be the one directly asked this question @@ -223,9 +223,8 @@ ThreadPlanStepThrough::GetPlanRunState () } bool -ThreadPlanStepThrough::WillResume (StateType resume_state, bool current_plan) +ThreadPlanStepThrough::DoWillResume (StateType resume_state, bool current_plan) { - ThreadPlan::WillResume(resume_state, current_plan); return true; } diff --git a/lldb/source/Target/ThreadPlanStepUntil.cpp b/lldb/source/Target/ThreadPlanStepUntil.cpp index f6e958a88a6..ca3d30d6f86 100644 --- a/lldb/source/Target/ThreadPlanStepUntil.cpp +++ b/lldb/source/Target/ThreadPlanStepUntil.cpp @@ -305,7 +305,7 @@ ThreadPlanStepUntil::AnalyzeStop() } bool -ThreadPlanStepUntil::PlanExplainsStop (Event *event_ptr) +ThreadPlanStepUntil::DoPlanExplainsStop (Event *event_ptr) { // We don't explain signals or breakpoints (breakpoints that handle stepping in or // out will be handled by a child plan. @@ -341,9 +341,8 @@ ThreadPlanStepUntil::GetPlanRunState () } bool -ThreadPlanStepUntil::WillResume (StateType resume_state, bool current_plan) +ThreadPlanStepUntil::DoWillResume (StateType resume_state, bool current_plan) { - ThreadPlan::WillResume (resume_state, current_plan); if (current_plan) { TargetSP target_sp (m_thread.CalculateTarget()); |