mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +08:00
Launch prog from cli, also exit cleanly
This commit is contained in:
@ -5,11 +5,9 @@ package command
|
||||
import (
|
||||
"debug/gosym"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/derekparker/dbg/proctl"
|
||||
)
|
||||
@ -23,7 +21,6 @@ type Commands struct {
|
||||
// Returns a Commands struct with default commands defined.
|
||||
func DebugCommands() *Commands {
|
||||
cmds := map[string]cmdfunc{
|
||||
"exit": exitFunc,
|
||||
"continue": cont,
|
||||
"next": next,
|
||||
"break": breakpoint,
|
||||
@ -66,16 +63,6 @@ func noCmdAvailable(p *proctl.DebuggedProcess, ars ...string) error {
|
||||
return fmt.Errorf("command not available")
|
||||
}
|
||||
|
||||
func exitFunc(p *proctl.DebuggedProcess, ars ...string) error {
|
||||
err := syscall.PtraceDetach(p.Pid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
return nil
|
||||
}
|
||||
|
||||
func nullCommand(p *proctl.DebuggedProcess, ars ...string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user