[Lldb-commits] [lldb] r191110 - 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.

Matt Kopec Matt.Kopec at intel.com
Fri Sep 20 14:28:39 PDT 2013


Author: mkopec
Date: Fri Sep 20 16:28:39 2013
New Revision: 191110

URL: http://llvm.org/viewvc/llvm-project?rev=191110&view=rev
Log:
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.

Modified:
    lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp

Modified: lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=191110&r1=191109&r2=191110&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp Fri Sep 20 16:28:39 2013
@@ -416,31 +416,22 @@ POSIXThread::BreakNotify(const ProcessMe
     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





More information about the lldb-commits mailing list