diff options
author | Jim Ingham <jingham@apple.com> | 2010-10-20 00:39:53 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-10-20 00:39:53 +0000 |
commit | b15bfc753c67f7af5eee131da04f007fd5af91fb (patch) | |
tree | 033d69708f181695d5030ea293a62186510ec6fe /lldb/source/Target/ThreadPlanBase.cpp | |
parent | 20f7ab72b1043fa288c5471dc846581d3a33d9ea (diff) | |
download | bcm5719-llvm-b15bfc753c67f7af5eee131da04f007fd5af91fb.tar.gz bcm5719-llvm-b15bfc753c67f7af5eee131da04f007fd5af91fb.zip |
Don't cache the public stop reason, since it can change as plan completion gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do.
llvm-svn: 116892
Diffstat (limited to 'lldb/source/Target/ThreadPlanBase.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanBase.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Target/ThreadPlanBase.cpp b/lldb/source/Target/ThreadPlanBase.cpp index 81fe21550f2..393a3ddeda5 100644 --- a/lldb/source/Target/ThreadPlanBase.cpp +++ b/lldb/source/Target/ThreadPlanBase.cpp @@ -67,10 +67,10 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) m_stop_vote = eVoteYes; m_run_vote = eVoteYes; - StopInfo *stop_info = m_thread.GetStopInfo(); - if (stop_info) + StopInfoSP stop_info_sp = GetPrivateStopReason(); + if (stop_info_sp) { - StopReason reason = stop_info->GetStopReason(); + StopReason reason = stop_info_sp->GetStopReason(); switch (reason) { case eStopReasonInvalid: @@ -80,7 +80,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) return false; case eStopReasonBreakpoint: - if (stop_info->ShouldStop(event_ptr)) + if (stop_info_sp->ShouldStop(event_ptr)) { // If we are going to stop for a breakpoint, then unship the other plans // at this point. Don't force the discard, however, so Master plans can stay @@ -92,7 +92,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) // don't report this stop or the subsequent running event. // Otherwise we will post the stopped & running, but the stopped event will get marked // with "restarted" so the UI will know to wait and expect the consequent "running". - if (stop_info->ShouldNotify (event_ptr)) + if (stop_info_sp->ShouldNotify (event_ptr)) { m_stop_vote = eVoteYes; m_run_vote = eVoteYes; @@ -115,7 +115,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) return true; case eStopReasonSignal: - if (stop_info->ShouldStop(event_ptr)) + if (stop_info_sp->ShouldStop(event_ptr)) { m_thread.DiscardThreadPlans(false); return true; @@ -124,7 +124,7 @@ ThreadPlanBase::ShouldStop (Event *event_ptr) { // We're not going to stop, but while we are here, let's figure out // whether to report this. - if (stop_info->ShouldNotify(event_ptr)) + if (stop_info_sp->ShouldNotify(event_ptr)) m_stop_vote = eVoteYes; else m_stop_vote = eVoteNo; |