Skip to content

Commit

Permalink
workaround for OS X proc.Launch race
Browse files Browse the repository at this point in the history
  • Loading branch information
aarzilli committed Nov 18, 2015
1 parent 77f3985 commit 032945b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions proc/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ func (dbp *Process) getGoInformation() (ver GoVersion, isextld bool, err error)
err = fmt.Errorf("Could not determine version number: %v\n", err)
return
}
if vv.Unreadable != nil {
err = fmt.Errorf("Unreadable version number: %v\n", vv.Unreadable)
return
}

ver, ok := parseVersionString(constant.StringVal(vv.Value))
if !ok {
Expand Down
4 changes: 3 additions & 1 deletion proc/proc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os/exec"
"path/filepath"
"sync"
"time"
"unsafe"

"github.com/derekparker/delve/dwarf/frame"
Expand Down Expand Up @@ -73,12 +74,13 @@ func Launch(cmd []string) (*Process, error) {
for i := range argvSlice {
C.free(unsafe.Pointer(argvSlice[i]))
}
time.Sleep(250 * time.Millisecond) // ( ͡° ͜ʖ ͡°)

dbp, err = initializeDebugProcess(dbp, argv0Go, false)
if err != nil {
return nil, err
}
err = dbp.Continue()
err = dbp.continueOnce()
return dbp, err
}

Expand Down

0 comments on commit 032945b

Please sign in to comment.