D103172 has a couple of mistakes when modifying a variable outside the for loop. I really don't know how to make a test for this, so feel free to commandeer this diff and finish it.
With this patch I was able to set breakpoints on a complex binary I have.