proc/native: disable async preemption on freebsd

This commit is contained in:
aarzilli 2020-04-10 18:30:10 +02:00 committed by Derek Parker
parent ae846a51f2
commit c534677ece
2 changed files with 2 additions and 1 deletions

@ -306,7 +306,7 @@ func (dbp *nativeProcess) initialize(path string, debugInfoDirs []string) (*proc
Path: path,
DebugInfoDirs: debugInfoDirs,
WriteBreakpoint: dbp.writeBreakpoint,
DisableAsyncPreempt: runtime.GOOS == "windows",
DisableAsyncPreempt: runtime.GOOS == "windows" || runtime.GOOS == "freebsd",
StopReason: stopReason})
}

@ -62,6 +62,7 @@ func Launch(cmd []string, wd string, foreground bool, debugInfoDirs []string, tt
process.Stdout = os.Stdout
process.Stderr = os.Stderr
process.SysProcAttr = &syscall.SysProcAttr{Ptrace: true, Setpgid: true, Foreground: foreground}
process.Env = proc.DisableAsyncPreemptEnv()
if foreground {
signal.Ignore(syscall.SIGTTOU, syscall.SIGTTIN)
process.Stdin = os.Stdin