microsoft / microsoft/vscode-cpptools
[Feature Request] Change Attach to Process to not require a program name by inferring it.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Currently, in order to attach to a process, I need to provide the following fields in my launch.json:
{
"name" : "Attach (gdb)",
"type" : "cppdbg",
"request" : "attach"
"program" : "${workspaceFolder}/path/to/program",
"processId" : "${command:pickProcess}",
"MIMode" : "gdb"
}
In my tests, it seems that the program field is validated (i.e. the executable exists, it is a valid executable), but it is completely ignored when debugging. I can set "program" = "/bin/bash" and attach to any process I want. But if I set "program" = "non existent file", I get a launch error that the program doesn't exist.
So why do I need to provide a path to the executable, when it is not needed?
Of course, it would be nice if ${command:pickProcess} would use this field to filter the processes, but it doesn't. Even then, it should be optional.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the cppdbg attach configuration and the launch.json validation path, then trace how processId ${command:pickProcess} and the program field are handled. Confirm whether attach can infer the executable without program, preserve validation for configurations that provide it, and verify that attaching works with only the process picker and MIMode settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100