proc: fix fatal throw breakpoint on go1.19 (#3009)

Also set breakpoint on runtime.fatal, which didn't exist before go1.19.

Updates #2993
This commit is contained in:
Alessandro Arzilli 2022-05-18 18:16:26 +02:00 committed by GitHub
parent 705ab206cd
commit c31040ba9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -413,6 +413,13 @@ func (t *Target) createFatalThrowBreakpoint() {
bp.Name = FatalThrow bp.Name = FatalThrow
} }
} }
fatalpcs, err = FindFunctionLocation(t.Process, "runtime.fatal", 0)
if err == nil {
bp, err := t.SetBreakpoint(fatalThrowID, fatalpcs[0], UserBreakpoint, nil)
if err == nil {
bp.Name = FatalThrow
}
}
} }
// CurrentThread returns the currently selected thread which will be used // CurrentThread returns the currently selected thread which will be used