proc/windows: handle delayed events

Sometimes windows will send us events about breakpoints we have
already removed from the code despite the fact that we go to great
lengths to avoid this already.

Change waitForDebugEvent to check that when we receive a breakpoint
event the corresponding memory actually contains an INT 3
instruction, if it doesn't ignore the event and restart the thread.
This commit is contained in:
aarzilli
2017-02-14 15:17:00 +01:00
parent b9bdf597b0
commit 1a68f8d351
3 changed files with 75 additions and 8 deletions

View File

@ -46,9 +46,12 @@ func TestBuild(t *testing.T) {
assertNoError(err, t, "stdout pipe")
cmd.Start()
defer func() {
cmd.Process.Signal(os.Interrupt)
if runtime.GOOS != "windows" {
cmd.Process.Signal(os.Interrupt)
cmd.Wait()
} else {
// sending os.Interrupt on windows is not supported
cmd.Process.Kill()
}
}()