Support "program" for {"request": "attach"} instead of only "processId"
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.
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.
@Som1Lse i would like to fix this issue raising a pr regarding this.