To would be nice to have an option to pass command line arguments to a debug target which is selected in CMakeTools and launched on Ctrl+F5
It seems like the cmake.debugConfig setting entry is broken, as VSCode offers no help regarding its existence. I've noticed this in the past few days, but options _should_ be settable using that config option. I'll have to play around and see why it isn't working. Until then, you can try setting cmake.debugConfig without any VSCode help. See this doc.
Are you unable to see cmake.debugConfig in the latest release?
Also, see the release notes regarding cmake.debugTargetProgramPath, which may be better suited for what you need.
Were you able to find a workable solution?
JFTR: I was able to pass arguments to a debug target using cmake.debugConfig adding a settings.json file inside .vscode folder with this content:
{
"cmake.debugConfig": {
"args": [
"myFirstArgument"
]
}
}
Closed.
If this issues still persists in the current _0.11.0-beta4_, feel free to reopen this one or create a new one.
JFTR: I was able to pass arguments to a debug target using
cmake.debugConfigadding asettings.jsonfile inside.vscodefolder with this content:{ "cmake.debugConfig": { "args": [ "myFirstArgument" ] } }
Thx, That's work for me.
JFTR: I was able to pass arguments to a debug target using
cmake.debugConfigadding asettings.jsonfile inside.vscodefolder with this content:{ "cmake.debugConfig": { "args": [ "myFirstArgument" ] } }
it works for me. but how do this when run without debugger ? I read cmake-tools , but it doesn't works for me, pass of args fails.
hello, why setting "args" in launch.json not working?
@liwei46, launch.json is not consumed by the CMake Tools debugging or running feature, but by F5. Are you F5-ing and your binary is not receiving the args defined in launch.json?
To use arguments via the cmake.Debug command (same as status bar debug icon), define in settings cmake.debugConfig.args as 2 comments above.
Most helpful comment
JFTR: I was able to pass arguments to a debug target using
cmake.debugConfigadding asettings.jsonfile inside.vscodefolder with this content: