From 60312a3b04bfe41e76b8fb0ff6688fcdc83c7ecb Mon Sep 17 00:00:00 2001 From: Mark Polonsky <43895132+markelrep@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:50:28 +0200 Subject: [PATCH] Fix attach to process in Go debugger (#43898) Release Notes: - Fixed the behavior of the attach to process feature for the Golang debugger. **Step to reprorduce:** 1. Build and run golang binary 2. In Zed open debugger 3. Go to Attach tab 4. Select the binary you just built from the list **Actual result:** ``` Tried to launch debugger with: { "request": "attach", "mode": "debug", "processId": 74702, "stopOnEntry": false, "cwd": "/path/to/the/current/working/directory" } error: Failed to attach: invalid debug configuration - unsupported 'mode' attribute "debug" ``` **Expected result:** The debugger can attach to the process. According to the [Delve documentation](https://github.com/go-delve/delve/tree/master/Documentation/api/dap#launch-and-attach-configurations) `attach` request supports `local` and `remote` values only --- crates/dap_adapters/src/go.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/dap_adapters/src/go.rs b/crates/dap_adapters/src/go.rs index 323ca094934fc93466451246f4bc69f34ded4891..d3253d5fe250f7228ebddec15a691ac650a19c89 100644 --- a/crates/dap_adapters/src/go.rs +++ b/crates/dap_adapters/src/go.rs @@ -366,7 +366,7 @@ impl DebugAdapter for GoDebugAdapter { dap::DebugRequest::Attach(attach_config) => { json!({ "request": "attach", - "mode": "debug", + "mode": "local", "processId": attach_config.process_id, }) }