mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 03:42:59 +08:00
Detatch cleanly upon exit
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/derekparker/dbg/proctl"
|
"github.com/derekparker/dbg/proctl"
|
||||||
)
|
)
|
||||||
@ -66,6 +67,11 @@ func noCmdAvailable(p *proctl.DebuggedProcess, ars ...string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func exitFunc(p *proctl.DebuggedProcess, ars ...string) error {
|
func exitFunc(p *proctl.DebuggedProcess, ars ...string) error {
|
||||||
|
err := syscall.PtraceDetach(p.Pid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user