mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 03:56:24 +08:00
service: remember that we attached in WaitFor attach mode (#4120)
Save the attached to PID to the configuration when WaitFor is used so that we later know that we attached and behave identically to when the normal attach command is used, particularly with respect to killing the process on exit. Fixes #4119
This commit is contained in:
committed by
GitHub
parent
e46c82b9bd
commit
3bd31d1534
@ -192,6 +192,7 @@ func New(config *Config, processArgs []string) (*Debugger, error) {
|
||||
err = noDebugErrorWarning(err)
|
||||
return nil, attachErrorMessage(d.config.AttachPid, err)
|
||||
}
|
||||
d.config.AttachPid = d.target.Selected.Pid()
|
||||
|
||||
case d.config.CoreFile != "":
|
||||
var err error
|
||||
|
||||
@ -731,9 +731,7 @@ type AttachedToExistingProcessOut struct {
|
||||
|
||||
// AttachedToExistingProcess returns whether we attached to a running process or not
|
||||
func (s *RPCServer) AttachedToExistingProcess(arg AttachedToExistingProcessIn, out *AttachedToExistingProcessOut) error {
|
||||
if s.config.Debugger.AttachPid != 0 {
|
||||
out.Answer = true
|
||||
}
|
||||
out.Answer = s.debugger.AttachPid() != 0
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user