vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Suggestion: add debugger "Compound" support
Hello everyone!
Brief Issue Summary
I want to cover compound system in vscode feature here.
To point to a binary generated by cmake, one can use
"program": "${command:cmake.launchTargetPath}",
as stated in the documentation.
However when debugging multiple binaries at the same time (e.g: client/server system), it is not possible to use cmake.launchTargetPath anymore because we need to select 2 targets to compile.
This is my current launch.json, with 2 cmake targets (respectively named client and server):
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch server",
"type": "cppdbg",
"request": "launch",
"program": "${config:cmake.buildDirectory}/server_debinfo",
.
.
.
]
},
{
"name": "(gdb) Launch client",
"type": "cppdbg",
"request": "launch",
"program": "${config:cmake.buildDirectory}/client_debinfo",
.
.
.
}
],
"compounds": [
{
"name": "Server/Client",
"configurations": ["(gdb) Launch client", "(gdb) Launch server"],
}
]
}
The problem is when the configuration is changed (for example, go for release) and the binaries names change, we have to go in launch.json and modify the paths to the binaries by hand each time.
Suggestion:
A nice addition to this plugin would be to have a special variable allowing to point to the binary of a given target, e.g:
"program": "${command:cmake.launchTargetPath(client)}",
and
"program": "${command:cmake.launchTargetPath(server)}",
so compound can be used very easily.
Other Notes/Information
Thank you so much for this wonderful plugin, it is really a daily pleasure to use it!