mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	Detatch cleanly upon exit
This commit is contained in:
		| @ -9,6 +9,7 @@ import ( | ||||
| 	"path/filepath" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| 	"syscall" | ||||
|  | ||||
| 	"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 { | ||||
| 	err := syscall.PtraceDetach(p.Pid) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	os.Exit(0) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Derek Parker
					Derek Parker