go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
22.37k stars 2.13k forks source link

proc: fix bug with stack watchpoints going out of scope #3742

Closed aarzilli closed 3 weeks ago

aarzilli commented 3 weeks ago

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