microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Debug Protocol: Need a way to control what happens to a process when DisconnectRequest is sent #111

Closed andrewcrawley closed 7 years ago

andrewcrawley commented 7 years ago

There's currently no way to control what happens to a process when a DisconnectRequest is sent. The current behavior is probably adapter-specific, but in general it seems that if the process was launched by the debugger, it is terminated, and if the process was attached, it is left running.

I propose:

export interface DisconnectArguments {
    /** Indicates whether the debugged process should be terminated when the debugger is disconnected. */
    terminateProcess?: boolean;
}

If unspecified, the debug adapter would do whatever it thinks is best. Otherwise, the value of the parameter would determine whether or not the process would be terminated.

Namedrops: @weinand @richardstanton @gregg-miskelly

gregg-miskelly commented 7 years ago

Sounds good to me.

weinand commented 7 years ago

request makes sense.

Since we are not using the term "processes" anywhere in the debug protocol, I'll name the attribute terminateDebuggee.

To avoid breaking the protocol, I'll add a new capability supportTerminateDebuggee. A client should only use the terminateDebuggee attribute if the debug adapter has opted into this feature and implements it properly.