These are chat archives for derekparker/delve

2nd
May 2016
Brad Danofsky
@bdanofsky
May 02 2016 15:38

I'm having several issues with delve, some seem pretty simple. If I create a simple go program made up of two files in the same package then delve debug cannot find the file that does not contain main(). If I do go build;dlv ./<program> then things work. Here is the output of dlv debug: irbuild01:~/bug$ dlv debug main.go

command-line-arguments

./main.go:7: undefined: Hello
exit status 2

this was done with pull of delve this morning, go 1.5.3 on linux
Florin Pățan
@dlsniper
May 02 2016 15:40
you can use dlv debug in the directory and it should work
Brad Danofsky
@bdanofsky
May 02 2016 15:40
when I collapse this into a single file (all it does is call a func to print hello world) sometimes I see the errors:

(dlv) c
Hello world

Command failed: could not continue existing thread 31961 could not get registers: no such process

or
irbuild01:~/bug$ dlv exec ./bug
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 set at 0x40110f for main.main() ./main.go:7
(dlv) n
Command failed: input/output error
(dlv)
Command failed: input/output error
(dlv) exit
I also see that if I try to step into a function call delve nothing happens delve is just stuck
Florin Pățan
@dlsniper
May 02 2016 15:43
btw, you might want to upgrade to go 1.6 I can't replicate any of your issues
and which version of delve are you using? I'm fairly close to master and I can't replicate any of those (again with go 1.6 not 1.5)
Brad Danofsky
@bdanofsky
May 02 2016 15:44
is go 1.6 needed for OS X also? I originally wanted to run on my mac but I could never get it to work
irbuild01:~/bug$ dlv version
Delve Debugger
Version: 0.11.0-alpha
Build: 82ece54737fb247eb71c71a2658b68123b4fd1a7
Florin Pățan
@dlsniper
May 02 2016 15:45
what do you mean? Go 1.6 shouldn't have any issues on Mac afaik (unless you have some super corner case)
also you said linux not mac initially so I'm confused :d
Brad Danofsky
@bdanofsky
May 02 2016 15:48
all of the above is on Linux (ubuntu 14.04)
Prior to giving in and moving to ubuntu I was trying to get delve working on my mac.
Florin Pățan
@dlsniper
May 02 2016 15:49
ah, delve on mac needs a bit more setup, be sure to read the docs for it: https://github.com/derekparker/delve/blob/master/Documentation/installation/osx/install.md
Brad Danofsky
@bdanofsky
May 02 2016 15:51
I did read the docs
I get this error
ello v825672$ dlv debug hello.go
could not launch process: could not fork/exec
Florin Pățan
@dlsniper
May 02 2016 15:51
as for Go requirements, I'm on 1.6.2 and I can't replicate the above issues and, afair, 1.6 included a bit better support for debugging tools like delve
Brad Danofsky
@bdanofsky
May 02 2016 15:52
ok I will upgrade to 1.6.2 and see if I can get it to work
Florin Pățan
@dlsniper
May 02 2016 15:53
also you might want to read this: derekparker/delve#509 but like I've said, if you want to debug something with two or more files, just run dlv debug in the directory the files are
Brad Danofsky
@bdanofsky
May 02 2016 16:00
irbuild01:~/bug$ go version
go version go1.6.2 linux/amd64

irbuild01:~/bug$ cat hello.go
package main

import (
"fmt"
)

func Hello() {
fmt.Println("Hello world\n")
}

irbuild01:~/bug$ cat main.go
package main

import (
)

func main() {
Hello()
}

irbuild01:~/bug$ dlv debug main.go
./main.go:7: undefined: Hello
exit status 2
Florin Pățan
@dlsniper
May 02 2016 16:02
if you want to debug something with two or more files, just run dlv debug in the directory the files are
Brad Danofsky
@bdanofsky
May 02 2016 16:03
apologies my mistake
I still dont seem to be able to step into the Hello function
by the way thanks for your help
Florin Pățan
@dlsniper
May 02 2016 16:10
yw. I'm not sure why you can't that but I suggest trying more advanced things to debug them
from my tests with it, it works really good with servers and such