[Lldb-commits] [lldb] r238308 - Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal

Tamas Berghammer tberghammer at google.com
Wed May 27 02:46:47 PDT 2015


Author: tberghammer
Date: Wed May 27 04:46:47 2015
New Revision: 238308

URL: http://llvm.org/viewvc/llvm-project?rev=238308&view=rev
Log:
Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal

Differential revision: http://reviews.llvm.org/D9886

Modified:
    lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp

Modified: lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp?rev=238308&r1=238307&r2=238308&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp Wed May 27 04:46:47 2015
@@ -138,11 +138,17 @@ bool
 BreakpointLocationCollection::ShouldStop (StoppointCallbackContext *context)
 {
     bool shouldStop = false;
-    const size_t count = GetSize();
-    for (size_t i = 0; i < count; i++) 
+    size_t i = 0;
+    size_t prev_size = GetSize();
+    while (i < prev_size)
     {
+        // ShouldStop can remove the breakpoint from the list
         if (GetByIndex(i)->ShouldStop(context))
             shouldStop = true;
+
+        if (prev_size == GetSize())
+            i++;
+        prev_size = GetSize();
     }
     return shouldStop;
 }





More information about the lldb-commits mailing list