Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlv throws "could not launch process: could not find external debug info file" #1485

Closed
openstacks opened this issue Feb 20, 2019 · 6 comments

Comments

@openstacks
Copy link

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?
    Delve Debugger
    Version: 1.2.0

  2. What version of Go are you using? (go version)?
    go version go1.11.5

  3. What operating system and processor architecture are you using?
    linux/amd64

  4. What did you do?
    root@cloudcome:/home/cloudcome/go_projects/src/k8s.io/kubernetes/_output/bin# dlv exec ./openapi-gen

  5. What did you expect to see?
    Type 'help' for list of commands.
    (dlv)

  6. What did you see instead?
    could not launch process: could not find external debug info file

@chainhelen
Copy link
Contributor

// 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.

@dlsniper
Copy link
Contributor

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

@aarzilli
Copy link
Member

What @chainhelen and @dlsniper said.

@barbu110
Copy link

barbu110 commented Mar 1, 2019

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

@dlsniper
Copy link
Contributor

dlsniper commented Mar 2, 2019

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.

@justinejose91
Copy link

justinejose91 commented Aug 14, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants