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

Created on 20 Feb 2019  路  6Comments  路  Source: go-delve/delve

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

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/

-s Omit the symbol table and debug information.

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saleemjaffer picture saleemjaffer  路  4Comments

wxqzhy picture wxqzhy  路  4Comments

ankur0101 picture ankur0101  路  4Comments

luminacious picture luminacious  路  5Comments

runningbar picture runningbar  路  4Comments