Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal

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

llvm-svn: 238308
This commit is contained in:
Tamas Berghammer 2015-05-27 09:46:47 +00:00
parent 3afb2527ce
commit 729dcfb7ee
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}