vim-go icon indicating copy to clipboard operation
vim-go copied to clipboard

Unable to start debugger, getting exit code 1

Open amanusk opened this issue 8 years ago • 12 comments

What did you do? (required. The issue will be closed when not provided.)

Run GoDebugStart

What did you expect to happen?

A debug session to start

What happened instead?

I got a message vim-go: exit status 1. No further information is provided and I don not know how can I investigate the problem

Configuration (MUST fill this out):

  • vim-go version: Pulled from master 1.17 + changes Updated to latest version of Delve with go get -u github.com/derekparker/delve/cmd/dlv Then ran GoUpdateBinaries Delve works fine from the command line

  • vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc): Basic pathogen + vim-go (My regular vimrc also does not work)

  • Vim version (first three lines from :version): VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 19 2018 17:02:58) Included patches: 1-1735

  • Go version (go version): go version go1.10.1 linux/amd64 (1.9 also tested)

  • Go environment (go env): GOARCH="amd64" GOBIN="" GOCACHE="/home/amanusk/.cache/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/amanusk/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build881546833=/tmp/go-build"

amanusk avatar Apr 19 '18 14:04 amanusk

Does :messages give you more information?

arp242 avatar Apr 19 '18 14:04 arp242

Yes! Getting

vim-go: can't load package: package 127.0.0.1:8181: cannot find package "127.0.0.1:8181" in an
y of:
vim-go:         /usr/local/go/src/127.0.0.1:8181 (from $GOROOT)
vim-go:         /home/amanusk/go/src/127.0.0.1:8181 (from $GOPATH)

amanusk avatar Apr 19 '18 17:04 amanusk

What command did you type exactly? It looks like there is some confusion between the package name and program arguments? The first argument for :GoDebugStart needs to be the package name (see :help :GoDebugStart)

arp242 avatar Apr 19 '18 17:04 arp242

I am trying to run this in a simple hello.go file, the package name is main and it is the only file in the directory. Running :GoDebugStart :GoDebugStart main :GoDebugStart . All yield the same result

amanusk avatar Apr 19 '18 17:04 amanusk

Changing the port in .vimrc with let g:go_debug_address = 127.0.0.1:8182 Changes the error message to:

vim-go: can't load package: package 127.0.0.1:8182: cannot find package "127.0.0.1:8182" in an
y of:...

amanusk avatar Apr 19 '18 19:04 amanusk

Great! Thanks for the info

arp242 avatar Apr 20 '18 01:04 arp242

I'm having the same issue. LMK if I can provide any more information. So far everything is the same as @amanusk reported.

blockloop avatar Apr 20 '18 15:04 blockloop

me too

casatwy avatar Apr 23 '18 09:04 casatwy

I can't start the debugger with a custom package name as well.

I started vim at $GOPATH/src then open a go file inside for example github.com/hdnha11/example.

When I use this command :GoDebugStart I got this message vim-go: exit status 1. :messages show me: vim-go: can't load package: package .: no Go files in /Users/nhahoang/sources/go/src.

Obviously, that the wrong package so that I changed my command to :GoDebugStart github.com/hdnha11/example I got the same above message.

I did debug further and found that in source code file autoload/go/debug.vim#538 defined l:pkgname variable and it's value was set correctly (from my args), but it's not used anywhere in l:cmd. Is it intentional or a bug here?

hdnha11 avatar Apr 30 '18 11:04 hdnha11

Please checkout latest master for the fix (#1809). Re-open if the issue still persists.

fatih avatar May 08 '18 16:05 fatih

got this error message when ran :GoDebugStart.

vim version: 8.1 vim-go: through vundle os: debian 9.5

vim-go: Error: unknown shorthand flag: '1' in -1 vim-go: Usage: vim-go: dlv debug [package] [flags] vim-go: Flags: vim-go: --output string Output path for the binary. (default "debug") vim-go: Global Flags: vim-go: --accept-multiclient Allows a headless server to accept multiple client connections. Note that the server API is n ot reentrant and clients will have to coordinate. vim-go: --api-version int Selects API version when headless. (default 1) vim-go: --backend string Backend selection: vim-go: default^I^IUses lldb on macOS, native everywhere else. vim-go: native^I^INative backend. vim-go: lldb^I^IUses lldb-server or debugserver. vim-go: rr^I^IUses mozilla rr (https://github.com/mozilla/rr). vim-go: (default "default") vim-go: --build-flags string Build flags, to be passed to the compiler. vim-go: --headless Run debug server only, in headless mode. vim-go: --init string Init file, executed by the terminal client. vim-go: -l, --listen string Debugging server listen address. (default "localhost:0") vim-go: --log Enable debugging server logging. vim-go: --log-output string Comma separated list of components that should produce debug output, possible values: vim-go: debugger^ILog debugger commands vim-go: gdbwire^I^ILog connection to gdbserial backend vim-go: lldbout^I^ICopy output from debugserver/lldb to standard output vim-go: debuglineerr^ILog recoverable errors reading .debug_line vim-go: rpc^I^ILog all RPC messages vim-go: fncall^I^ILog function call protocol vim-go: Defaults to "debugger" when logging is enabled with --log. vim-go: --wd string Working directory for running the program. (default ".")

binaryoak avatar Sep 04 '18 13:09 binaryoak

I'm using latest master of vim-go (commit: 53d36f46d9701f3ac421a6ec13ff66be83b156ad) and I'm seeing this issue when running :GoDebugTest. My output is the same, I'm also using Debian.

vim-go: [debug] dispatched
vim-go: Error: unknown shorthand flag: '1' in -1
vim-go: Usage:                                                                                                                                 
vim-go:   dlv test [package] [flags]                                                                                                           
vim-go: Flags:                                                                                                                                 
vim-go:   -h, --help            help for test                                                                                                  
vim-go:       --output string   Output path for the binary. (default "debug.test")                                                             
vim-go: Global Flags:                                                                                                                          
vim-go:       --accept-multiclient   Allows a headless server to accept multiple client connections. Note that the server API is not reentrant 
and clients will have to coordinate.                                                                                                           
vim-go:       --api-version int      Selects API version when headless. (default 1)                                                            
vim-go:       --backend string       Backend selection:                                                                                        
...

vim version:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)                                  
Included patches: 1-197, 322, 377-378, 550, 703, 706-707

leighmcculloch avatar Sep 19 '18 05:09 leighmcculloch