From 2f98353099bec662af4c085aabf8115e2cc15637 Mon Sep 17 00:00:00 2001 From: Matt Kopec Date: Fri, 20 Sep 2013 21:28:39 +0000 Subject: [PATCH] Change posix thread so that it creates a breakpoint stop reason if the breakpoint isn't valid for the current thread but specify should stop to false. Also remove selecting a thread on a breakpoint hit. llvm-svn: 191110 --- .../Plugins/Process/POSIX/POSIXThread.cpp | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp b/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp index 522501ffaed5..41e80b78ad5f 100644 --- a/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp +++ b/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp @@ -416,31 +416,22 @@ POSIXThread::BreakNotify(const ProcessMessage &message) lldb::BreakpointSiteSP bp_site(GetProcess()->GetBreakpointSiteList().FindByAddress(pc)); // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, - // we can just report no reason. We don't need to worry about stepping over the breakpoint here, that - // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc. - if (bp_site && bp_site->ValidForThisThread(this)) + // we create a stop reason with should_stop=false. If there is no breakpoint location, then report + // an invalid stop reason. We don't need to worry about stepping over the breakpoint here, that will + // be taken care of when the thread resumes and notices that there's a breakpoint under the pc. + if (bp_site) { lldb::break_id_t bp_id = bp_site->GetID(); - if (GetProcess()->GetThreadList().SetSelectedThreadByID(GetID())) + if (bp_site->ValidForThisThread(this)) SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id)); - else - assert(false && "Invalid thread ID during BreakNotify."); - } - else - { - const ThreadSpec *spec = bp_site ? - bp_site->GetOwnerAtIndex(0)->GetOptionsNoCreate()->GetThreadSpecNoCreate() : 0; - - if (spec && spec->TIDMatches(*this)) - assert(false && "BreakpointSite is invalid for the current ThreadSpec."); else { - if (!m_stop_info_sp) { - StopInfoSP invalid_stop_info_sp; - SetStopInfo (invalid_stop_info_sp); - } + const bool should_stop = false; + SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id, should_stop)); } } + else + SetStopInfo(StopInfoSP()); } void