Skip to content

Commit

Permalink
service/dap: fix race in no debug test (go-delve#2766)
Browse files Browse the repository at this point in the history
Check for a possible output event when disconnecting from a
process that has already exited.

Fixes go-delve#2763
  • Loading branch information
suzmue authored Jan 4, 2022
1 parent fcc9561 commit 5842c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/dap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,9 @@ func (s *Session) onLaunchRequest(request *dap.LaunchRequest) {
if err := cmd.Wait(); err != nil {
s.config.log.Debugf("program exited with error: %v", err)
}
close(s.noDebugProcess.exited)
s.logToConsole(proc.ErrProcessExited{Pid: cmd.ProcessState.Pid(), Status: cmd.ProcessState.ExitCode()}.Error())
s.send(&dap.TerminatedEvent{Event: *newEvent("terminated")})
close(s.noDebugProcess.exited)
}()
return
}
Expand Down

0 comments on commit 5842c1f

Please sign in to comment.