summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-05-27 09:46:47 +0000
committerTamas Berghammer <tberghammer@google.com>2015-05-27 09:46:47 +0000
commit729dcfb7eeb01021a7510ca9f7342ad53f0bd518 (patch)
treec94dbdd7647c2a10aaea980bbd5afe92f9badd15 /lldb/source/Breakpoint/BreakpointLocationCollection.cpp
parent3afb2527cedec73809ed082706ebb6f733479bdd (diff)
downloadbcm5719-llvm-729dcfb7eeb01021a7510ca9f7342ad53f0bd518.tar.gz
bcm5719-llvm-729dcfb7eeb01021a7510ca9f7342ad53f0bd518.zip
Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal
Differential revision: http://reviews.llvm.org/D9886 llvm-svn: 238308
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointLocationCollection.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointLocationCollection.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
index 5756ccedfaa..5b6e746f911 100644
--- a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
@@ -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;
}
OpenPOWER on IntegriCloud