vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Support "program" for {"request": "attach"} instead of only "processId"

Open Som1Lse opened this issue 2 months ago • 1 comments

Feature Request

Currently

{
    "name": "(Windows) Launch",
    "type": "cppvsdbg",
    "request": "launch",
    "program": "myprogram.exe",
},

is used to launch (and attach to) a new process for debugging, while

{
    "name": "(Windows) Attach",
    "type": "cppvsdbg",
    "request": "attach",
    "processId": "${command:pickProcess}",
},

is used to attach to a process that is already running.

The former is great, the latter is incredibly inconvenient, since you often know exactly which process to attach to, but have to type it every single time. LLDB (vadimcn.vscode-lldb) supports

{
    "name": "(LLDB) Attach",
    "type": "lldb",
    "request": "attach",
    "program": "myprogram.exe",
},

which will simply look for a running program called myprogram.exe, and attach to it.


A related issue is #1904, where they asked to add "processName" to the schema. I think they were under the impression that cpptools supported (they probably found the name in something like this Stack Overflow question).

Also perhaps relevant is #1272, though that applies to GDB and specifically asks to make "program" optional.

Som1Lse avatar Nov 14 '25 09:11 Som1Lse

Thank you for your feature request. While we may not be able to implement it immediately, we will monitor community reactions to see how it fits into our backlog. Additionally, if you're working with GDB/LLDB, please note that the code is open source at https://github.com/microsoft/MIEngine/wiki/Contributing-Code . Your contributions are always welcome and appreciated.

github-actions[bot] avatar Nov 15 '25 13:11 github-actions[bot]

@Som1Lse i would like to fix this issue raising a pr regarding this.

Subham-KRLX avatar Dec 14 '25 07:12 Subham-KRLX