提交 9040ec1a 编写于 作者: D Derek Parker

Only detach if not killing process

上级 c414c72e
......@@ -135,22 +135,22 @@ func (d *Debugger) Run() error {
}
}
// Detach
if !d.process.Exited() {
if err := sys.PtraceDetach(d.process.Pid); err == nil {
log.Print("detached from process")
} else {
log.Printf("couldn't detach from process: %s", err)
}
}
// Kill the process if requested
if s.KillProcess {
if err := d.process.Process.Kill(); err == nil {
if err := proctl.PtraceCont(d.process.Pid, int(sys.SIGINT)); err == nil {
log.Print("killed process")
} else {
log.Printf("couldn't kill process: %s", err)
}
} else {
// Detach
if !d.process.Exited() {
if err := sys.PtraceDetach(d.process.Pid); err == nil {
log.Print("detached from process")
} else {
log.Printf("couldn't detach from process: %s", err)
}
}
}
return nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册