Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.
dlv version)?go version)?What did you do?
root@cloudcome:/home/cloudcome/go_projects/src/k8s.io/kubernetes/_output/bin# dlv exec ./openapi-gen
What did you expect to see?
Type 'help' for list of commands.
(dlv)
// ErrNoDebugInfoFound is returned when Delve cannot find the external debug information file.
var ErrNoDebugInfoFound = errors.New("could not find external debug info file")
It means there is not any debug symbols.
The binary is probably built with the -w flag which strips out the DWARF information from it. Try to build the binary using Delve itself, delve debug k8s.io/kubernetes/<path to openapi-gen command> or something similar
What @chainhelen and @dlsniper said.
Hello! I am building my executable without the -w flag, like this:
go build -ldflags="-s -compressdwarf=false" -gcflags="all=-N -l" ./mypackage
and I still get the error
Then you are not stripping the DWARF info, you are stripping all debug info as well, see: https://golang.org/cmd/link/
-s Omit the symbol table and debug information.
I am getting the error "Could not open debug info", when I attach a process in DLV, this is how I am building - go build -gcflags=all="-N -l" -v -o file.go.
Can someone give some insight into this?
root@jj:~/bin# ./dlv version
Delve Debugger
Version: 1.2.0
Build: $Id: 068e2451004e95d0b042e5257e34f0f08ce01466 $
root@jj:/usr/local/go/bin# ./go version
go version go1.12.7 linux/amd64
Most helpful comment
Then you are not stripping the DWARF info, you are stripping all debug info as well, see: https://golang.org/cmd/link/