Skip to content

Attach :GoDebugStart to a running dlv process #1758

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

Closed
gianarb opened this issue Apr 5, 2018 · 5 comments · Fixed by #2989
Closed

Attach :GoDebugStart to a running dlv process #1758

gianarb opened this issue Apr 5, 2018 · 5 comments · Fixed by #2989

Comments

@gianarb
Copy link

gianarb commented Apr 5, 2018

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.

@arp242 arp242 changed the title [FEATURE REQUEST] Attach :GoDebugStart to a running dlv process Attach :GoDebugStart to a running dlv process Apr 5, 2018
@arp242
Copy link
Contributor

arp242 commented Apr 5, 2018

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.

@fntlnz
Copy link

fntlnz commented Apr 6, 2018

@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

@arp242
Copy link
Contributor

arp242 commented Apr 7, 2018

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

@gianarb
Copy link
Author

gianarb commented Apr 9, 2018

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.

@dcartertwo
Copy link

+1 would really love to have this as a feature

@bhcleek bhcleek added this to the vim-go 1.24 milestone Jun 14, 2020
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

Closes fatih#1758
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 29, 2020
Add :GoDebugAttach to be able to attach to a running process.

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

Successfully merging a pull request may close this issue.

5 participants