Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Support attaching and detaching from remote debug server without killing the process #1609

Closed
radu-matei opened this issue Apr 6, 2018 · 5 comments
Assignees
Labels

Comments

@radu-matei
Copy link

Related: #1599 (comment)

If you have a long running process and start a dlv attach --headless session, then you point VS Code to that host and have a debug session, after you stop debugging from VS Code you would expect the remote process to continue running - but the extension actually sends a Halt request to the debug server.

It would be extremely helpful (for this and for other extensions using this Go debugger) to support gracefully detaching from remote processes without killing them.

@lggomez
Copy link
Contributor

lggomez commented Jun 7, 2018

A similar issue: if you launch a remote debug session and the headless server isn't up it seems that the debug task hangs forever waiting to connect

I thought that the client connection had a defined timeout, although it may be missing something

@ramya-rao-a
Copy link
Contributor

@radu-matei We do a halt + restart in that case and do not kill any process explicitly. I dont know why we went with halt + restart instead of detach without killing, as that was before my time.

Sending a detach command needs halting as well, so we can look into halt + detach instead of halt + restart

Thoughts?

@ob1dev
Copy link

ob1dev commented Jan 18, 2019

Hi @ramya-rao-a, is there any update on this issue?

It would be supper handy if I VS Code can accept input from fmt.Scan while debugging such a simple code as follows:

package main

import "fmt"

func main() {
	fmt.Println("What's your name?")

	var s string
	fmt.Scanln(&s)

	fmt.Printf("Hello, %s", s)
}

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Mar 13, 2019

@radu-matei

If you have a long running process and start a dlv attach --headless session, then you point VS Code to that host and have a debug session, after you stop debugging from VS Code you would expect the remote process to continue running - but the extension actually sends a Halt request to the debug server.
It would be extremely helpful (for this and for other extensions using this Go debugger) to support gracefully detaching from remote processes without killing them.

In order to send a Detach request, we need to first send a Halt request. See this note on gracefully ending the debug session in delve

@olegburov Your scenario is being tracked in #219. Please subscribe to that issue for further updates

@ramya-rao-a
Copy link
Contributor

Since we can't really send the detach request without halting the dlv process first, there is nothing much we can do for this issue. Therefore, I am closing it.

We will continue to work to on #1599

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants