Add pid flag to trace subcommand

This commit is contained in:
Derek Parker
2015-07-13 16:34:51 -05:00
parent 3cee10d8bc
commit c96d0a5ab2
2 changed files with 26 additions and 15 deletions

View File

@ -90,6 +90,11 @@ func Attach(pid int) (*Process, error) {
// Detach from the process being debugged, optionally killing it.
func (dbp *Process) Detach(kill bool) (err error) {
if dbp.Running() {
if err = dbp.Halt(); err != nil {
return
}
}
if !kill {
// Clean up any breakpoints we've set.
for _, bp := range dbp.Breakpoints {