When stack watchpoints go out of scope simultaneously they can hide (or
duplicate the effect) of other breakpoints (including other watchpoints
going out of scope) that are placed on the same physical memory
location.
This happens because we delete the watchpoint-out-of-scope breakpoint
while we are evaluating hit breakpoints, mangling the breaklets list.
This commit moves breakpoint deletion out of the
watchpoint-out-of-scope condition, delaying it until all hit
breakpoints have been evaluated.
Also fix a bug where on amd64 if all four watchpoints are in use the last one is not checked.
When stack watchpoints go out of scope simultaneously they can hide (or duplicate the effect) of other breakpoints (including other watchpoints going out of scope) that are placed on the same physical memory location.
This happens because we delete the watchpoint-out-of-scope breakpoint while we are evaluating hit breakpoints, mangling the breaklets list.
This commit moves breakpoint deletion out of the watchpoint-out-of-scope condition, delaying it until all hit breakpoints have been evaluated.
Also fix a bug where on amd64 if all four watchpoints are in use the last one is not checked.
Fixes #3739