delve icon indicating copy to clipboard operation
delve copied to clipboard

dap: how to treat terminateDebuggee==true with remote attach to multi-client dlv-attach

Open polinasok opened this issue 2 years ago • 2 comments

I have a draft of a fix, but would like to discuss first if the current behavior even needs fixing.

Current behavior:

  • local attach to pid or remote attach to headless dlv attach:
    • "Disconnect" => terminateDebuggee=false => kill debugger, leave process (running)
    • "Stop" => terminateDebuggee=true => kill debugger, kill process
  • remote attach to headless dlv attach with --accept-multiclient:
    • "Disconnect" => terminateDebuggee=false => leave debugger, leave process (halted or running)
    • "Stop" => terminateDebuggee=true => kill debugger, kill process

Question: should multi-client Stop leave the attached debuggee process running when the debugger stops?

  • Pro: Gives the user the most flexibility. It is trivial to kill a left-over process. It is not as easy to take down the debugger and leave the proccess running (need to use a terminal client).
  • Con: "Stop" and "terminateDebuggee" imply that the process will be terminated, so leaving it running might be unintuitive.

@suzmue @hyangah @briandealwis

polinasok avatar May 18 '22 01:05 polinasok

In the disconnect cases, does “leave process” mean that the process is left in a running state?

My $0.02: “Stop” means terminate the process, regardless of multiclient. The multiclient case is only interesting in that it allows for disconnect as an option.

briandealwis avatar May 18 '22 01:05 briandealwis

In multi-client case "leave process" can mean running or halted, but that's controlled by a separate flag.

polinasok avatar May 18 '22 16:05 polinasok