Fix detach (#32506)

Release Notes:

- debugger: Fix detach to not terminate debuggee (and only be available
when detaching makes sense)
This commit is contained in:
Conrad Irwin 2025-06-10 20:20:28 -06:00 committed by GitHub
parent 84eca53319
commit 1e1bc7c373
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 53 additions and 22 deletions

View file

@ -26,6 +26,7 @@ use dap::{
use dap::{
ExceptionBreakpointsFilter, ExceptionFilterOptions, OutputEvent, OutputEventCategory,
RunInTerminalRequestArguments, StackFramePresentationHint, StartDebuggingRequestArguments,
StartDebuggingRequestArgumentsRequest,
};
use futures::SinkExt;
use futures::channel::{mpsc, oneshot};
@ -2217,10 +2218,17 @@ impl Session {
self.locations.get(&reference).cloned()
}
pub fn is_attached(&self) -> bool {
let Mode::Running(local_mode) = &self.mode else {
return false;
};
local_mode.binary.request_args.request == StartDebuggingRequestArgumentsRequest::Attach
}
pub fn disconnect_client(&mut self, cx: &mut Context<Self>) {
let command = DisconnectCommand {
restart: Some(false),
terminate_debuggee: Some(true),
terminate_debuggee: Some(false),
suspend_debuggee: Some(false),
};