Comments (3)
@Zingam Am I correct in understanding that the Feature Request you propose is that the following two fields are automatically (semi) auto-populated when the user adds the launch.json file? Can you tell me what functionality I can achieve after adding these two fields?
First field:
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
Second field:
"environment": [
{
// add the directory where our target was built to the PATHs
// it gets resolved by CMake Tools:
"name": "PATH",
"value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}"
},
from vscode-cmake-tools.
Yes, then you don't need to manually fill out these fields with the compiled executable. Let's say:
"program": "C:\Projects\HelloWorld\out\my_build\HelloWorld.exe"
You need to fill the above to run your "HelloWorld.exe". If you use "program": "${command:cmake.launchTargetPath}",
, this executable path will be resolved automatically for you. Please check the docs:
https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/debug-launch.md
As is now you need to replace the default string in launch.json
with either option above.
Currently if you add a new configuration you'll get this:
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "enter program name, for example ${workspaceFolder}/a.out",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
I propose if the user is using this CMake extension the following to be generated instead:
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
It's a small QoL feature.
from vscode-cmake-tools.
@gcampbell-msft
An improvement suggested by users is that the following two fields are automatically (semi-automatically) populated when adding a launch.json file, which automatically finds the compiled executable. Can you give some suggestions?
First field:
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
Second field:
"environment": [
{
// add the directory where our target was built to the PATHs
// it gets resolved by CMake Tools:
"name": "PATH",
"value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}"
},
from vscode-cmake-tools.
Related Issues (20)
- CMakePresets.json misbehaves, always wants to build a debug build HOT 3
- Add Project Outline Filtering + Searching
- cmakeuserpresets.json not read by vscode-cmake-tools? HOT 5
- There was an error running ctest to determine available test executables
- YAMLException on configure HOT 7
- sysroot arg isn't being passed properly
- usepresets context is not set after using quickstart HOT 4
- Investigate passing multiple workspace browse configurations (1 for each target+fileGroup combo) to C/C++ extension HOT 4
- After clicking Run Tests an error is reported HOT 1
- Configure raises an error if CTest scripts print to stdout HOT 6
- presets: setting cmake.buildToolArgs in configuration leads to build failures HOT 3
- FR: support the terminal.integrated.automationProfile.* when launch target without debug
- The test process will remain loaded after clicking “Debug Tests” HOT 3
- Annoying unnecessary logging related to expanding strings that don't require expansion
- Doubling of cpack arguments via package preset
- Need to clean-configure when running workflow with workflow-configure-preset different than project-configure-preset
- Fix UI issues in the CMake left panel related to package preset override of settings
- Improve CMakeLists.txt support - auto formatting and auto add to CMakeLists.txt when adding files HOT 1
- Selecting CMake Tools as configuration provider has error squiggles for all standard library includes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cmake-tools.