Closed stephane-archer closed 1 year ago
I'm having the same issue.
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.0/share/nvim"
Run :checkhealth for more info
dlv version
Delve Debugger
Version: 1.20.2
Build: $Id: e0c278ad8e0126a312b553b8e171e81bcbd37f60 $
What version of vim-go are you using? I'm unable to duplicate the problem you're describing using Neovim 0.9.0 and latest master of vim-go.
I just updated vim-go using Plug, I was able to set a breakpoint, start and continue, but when I wanted to step I got the following error:
Error detected while processing function <SNR>102_on_data[27]..<SNR>102_handleRPCResult[14]..function <SNR>102_on_data[27]..<SNR>102_handleRPCResult:
line 9:
E608: Cannot :throw exceptions with 'Vim' prefix
Press ENTER or type command to continue
Error detected while processing function <SNR>102_on_data:
line 27:
E170: Missing :endfor
Press ENTER or type command to continue
my version of NVIM v0.8.3 and vim-go should be the latest version I imagine (I ask Plug to update my plugins see my vim config)
Can you start delve with logging turned on and then connect? I'd like to know what it think it's sending to vim-go. I'd also like to know the complete contents of your __GODEBUG_OUTPUT__
window after this happens.
Would you explain how to do what you are proposing?
You can use something like dlv debug --headless --continue --accept-multiclient --listen=:8181 --api-version=2 main.go
at the command line and then execute :GoDebugConnect 8181
in Vim.
term1:
dlv debug --headless --continue --accept-multiclient --listen=:8181 --api-version=2 main.go
API server listening at: [::]:8181
2023-05-04T15:08:11-03:00 warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-1400.0.38.17
for x86_64.
Got a connection, launched process /Users/fractale/photoProxy/__debug_bin (pid = 8739).
Error: not enough args
Exiting.
2023-05-04T15:08:11-03:00 error layer=rpc writing response:write tcp [::1]:8181->[::1]:50260: use of closed network connection
$ echo $__GODEBUG_OUTPUT__
#empty
nvim:
:GoDebugConnect localhost:8181
vim-go: failed to sync breakpoints (function go#debug#Start[32]..<SNR>93_connect[42]..<SNR>93_sync_breakpoints[51]..<SNR>93_call_jsonrpc, line 32): (let):E716: Key not present in Dictionary: "ch"
Press ENTER or type command to continue
It looks like your application wasn't started by dlv. You'll have to adjust the arguments to make sure your application actually starts.
The __GODEBUG_OUTPUT__
window will be in Vim.
I'm getting the same errors when I try to start debugging from vim-go, and I'm pretty sure the application is started just fine by dlv, since I can debug with dlv alone and I can initiate the debugging session by directly calling dlv and connect to it through vim-go. But when I try to initiate the session from vim-go, I get the same errors as OP.
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az183-550
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
$ dlv version
Delve Debugger
Version: 1.20.2
Build: $Id: e0c278ad8e0126a312b553b8e171e81bcbd37f60 $
I ran a succesful :PlugUpdate
and :GoUpdateBinaries
just before, so I expect everything to be the latest (and greatest) version.
This dlv command line (without the --continue
flag):
$ dlv debug --log --accept-multiclient --listen=:8181 --api-version=2 . -- url https://google.com
Followed by :GoDebugConnect localhost:8181
in Nvim.
Adding --continue
to the dlv command line, results in this:
$ dlv debug --log --continue --accept-multiclient --listen=:8181 --api-version=2 . -- url https://google.com
API server listening at: [::]:8181
2023-05-11T14:11:12+02:00 warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2023-05-11T14:11:12+02:00 info layer=debugger launching process with args: [/home/madsen/code/vtcli/__debug_bin url https://google.com]
2023-05-11T14:11:12+02:00 debug layer=debugger continuing
&{data:{ID:u-9d116b1b0c1200ca75016e4c010bc94836366881b021a658ea7f8548b6543c1e-1683807070 Type:analysis Attributes:map[] ContextAttributes:map[] Relationships:map[] Links:0xc0001aa200} jsonq:<nil> modifiedAttributes:[] modifiedData:map[]}
2023-05-11T14:11:13+02:00 error layer=rpc writing response:write tcp [::1]:8181->[::1]:56350: use of closed network connection
###!!! THIS IS WHERE I SWITCH TO NVIM AND RUN ":GoDebugConnect localhost:8181" !!!###
2023-05-11T14:11:58+02:00 debug layer=debugger halting
2023-05-11T14:11:58+02:00 debug layer=debugger detaching
2023-05-11T14:11:58+02:00 debug layer=debugger detaching
Meanwhile in Nvim:
__GODEBUG_OUTPUT__
is completely empty after running :GoDebugConnect localhost:8181
, but the Nvim command line says:
vim-go: failed to sync breakpoints (function go#debug#Start[32]..<SNR>83_connect[42]..<SNR>83_sync_breakpoints[51]..<SNR>83_call_jsonrpc, line 32): (let):E716: Key not present in Dictionary: "ch"
Hi,
After running :
dlv debug --headless --continue --accept-multiclient --listen=:4242 --api-version=2 main.go
I got the following output :
API server listening at: [::]:4242
2023-05-21T15:44:22-04:00 warning layer=rpc Listening for remote
connections (connections are not authenticated nor encrypted)
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-1400.0.38.17
for x86_64.
Got a connection, launched process /Users/fractale/photoProxy/__debug_bin
(pid = 963).
2023-05-21T15:44:53-04:00 error layer=rpc writing response:write tcp
[::1]:4242->[::1]:49523: use of closed network connection
And in nvim after :GoDebugConnect localhost:4242
An orange message appeared but I was not able to read it quickly enough.
Then all the debug windows opened and `__GODEBUG_OUTPUT__ˋ was totally
empty
--
Best Regards,
Stephane Archer
Can you give latest master a try? I don't expect it to fully resolve the problem, but I think it may help us understand what's going on better.
after adding a breakpoint in the main function with
:GoDebugBreakpoint
then starting a debug session with:GoDebugStart
I have no idea why,
dlv debug
works on my system and the rest of vim-go plugging work as expected