Vscode-cmake-tools: Pass command line arguments for "Run Without Debugging"

Created on 16 Nov 2019  路  11Comments  路  Source: microsoft/vscode-cmake-tools

I'm so sorry to bother you with this little question ...

I know how to pass command line arguments to a debug target, but when I executed CMake: run without debugging, I found no argument was passed to the target. Did I miss any steps?

I will be very grateful to you if this problem was solved. Thank you.

Feature Request debulaunch fixed (release pending)

Most helpful comment

A good workaround is to use launch.json which can define program launch args and you can invoke the run without debugger via the command "Debug: Start without Debugging" in the pallette (as opposed to CMake: Run without debugging").
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": ["arg1", "arg2", "arg3"],
"stopAtEntry": false,
"cwd": "${command:cmake.launchTargetDirectory}",
"environment": [],
"console": "externalTerminal"
}
]
}

Regarding opened PRs, we are catching up on them this week. Thank you for your patience.

All 11 comments

You did not miss any steps. This functionality has not been implemented. I will mark as a feature request.

Thank you for your reply!

Should I close this issue now, or should I keep it open until this new feature is implemented? (Sorry, I'm not familiar with the process of open source software maintenance)

Please leave it open. We will close it when the feature is implemented or if we don't think we can get to it in a reasonable time frame.

Thanks! :thumbsup:

still not implemented today?

Not yet. If you want to take a look at the code, we'd accept a PR.

I am new using github. I need this feature too. would someone please accept this PR. It would great help
https://github.com/microsoft/vscode-cmake-tools/pull/1201

Is this feature still in scope?

This is a bummer! Running without a debugger is not that uncommon, isn't it?
Especially, since the ssh-remote debugger has still issues, running without it is common practice for me. Having no way to pass arguments on startup is a show stopper for this the cmake tools.

Any workaround for this?

A good workaround is to use launch.json which can define program launch args and you can invoke the run without debugger via the command "Debug: Start without Debugging" in the pallette (as opposed to CMake: Run without debugging").
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": ["arg1", "arg2", "arg3"],
"stopAtEntry": false,
"cwd": "${command:cmake.launchTargetDirectory}",
"environment": [],
"console": "externalTerminal"
}
]
}

Regarding opened PRs, we are catching up on them this week. Thank you for your patience.

CMake Tools 1.7.0 was released today and it contains a fix for this issue. Upgrade the extension in VSCode and let us know if you encounter any other problems.

Was this page helpful?
0 / 5 - 0 ratings