Vim-go: Attach :GoDebugStart to a running dlv process

Created on 5 Apr 2018  路  5Comments  路  Source: fatih/vim-go

Hello!

This is probably a big request but I started to investigate and hack around it so, I am opening this issue with my considerations.

:GoDebugStart builds and start a new dlv process by default on port 8181, in one of my project I am using docker because I have dependencies and it was the current flow for me and my team.

So, we start the dlv process inside a Docker container, with @fntlnz we spent half an hour hacking a bit the debug.vim code to joke vim-go in order to allow :GoDebugStart to connect to the port :8181 without rebuilding the dlv process.

It didn't end up well, I think we need more than 30 minutes, this issue is just to start a discussion because I think other people have the same workflow.

debugger feature

Most helpful comment

+1 would really love to have this as a feature

All 5 comments

It didn't end up well

What problems did you face specifically? I think it shouldn't be too hard to do?

But yeah, this is a reasonable feature to add support for.

@Carpetsmoker We didn't try that hard, we only spent a bunch of minutes and tried to replace the dlv command with another command that started dlv in a container.
After we saw that vim did not attach to it while giving no errors and we opened this issue to see if there was interest in adding remote debugging to this.

I don't think that the start a container or any script with vim-go is a good approach, I think the way to go is to be able to connect to a remote delve server.

I think that the main things to figure out while doing this are:

  • Path rewriting
  • Workdir / should be doable with the --wd parameter

To be clear, I'll be happy to review/test any patch, but this is not something I'll be working on any time soon.

I don't think that the start a container or any script with vim-go is a good approach, I think the way to go is to be able to connect to a remote delve server.

Doing remote debugging is not something I ever thought about while writing this. I'm a simple guy, and just write/compile Go code from ~/go/src/...

Hello @Carpetsmoker don't worry. I am not asking you to write anything obviously. This issue is just to track a feature request to see if we are the unique 2 developers that are doing this kind of flow :) Or maybe somebody has an easy way to achieve the same behavior with the current implementation.

+1 would really love to have this as a feature

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mnarrell picture mnarrell  路  3Comments

korjavin picture korjavin  路  4Comments

derekchiang picture derekchiang  路  3Comments

orlangure picture orlangure  路  3Comments

Michael-F-Ellis picture Michael-F-Ellis  路  3Comments