microsoft / microsoft/vscode-cmake-tools

[Bug] Remote debugging not possible

Open
#4,652 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

With VS Code, I want to debug my application running on a remote target.

For this, on the target I'm running gdbserver :1234 --attach $(pidof myapp).

I have created a launch.json script for code:

```{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Debug: Start gdbserver",
"program": "/home/developer/src/build/Debug/myapp_unstripped",
"cwd": "/home/developer/src",
"MIMode": "gdb",
"miDebuggerPath": "aarch64-linux-gnu-gdb",
"miDebuggerServerAddress": "IP:1234",
"stopAtEntry": false,
"logging": {"engineLogging": false},
}
]
}
```

`launch` here is problematic: on stop debugging it will kill my target process.

I can't use "attach": it shows a local PID selector. I tried EVERYTHING. But I still can't understand why something is that hard in 2026 whereas Eclipse has this for decades (at least 2 = 20years). Can anyone please help?

I just want to attach to my remote target, and leave it alone after finish.

### CMake Tools Diagnostics

```shell
No log output.
```

### Debug Log

```shell
No output
```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the launch.json configuration and the CMake Tools debugging path, comparing the existing launch behavior with the attach flow that presents a local PID selector. Done means a remote target can be attached through the CMake Tools workflow and remains running when debugging stops.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.