vscode-cmake-tools
vscode-cmake-tools copied to clipboard
Feature request, better debugger intergration with QT
Qt 6.0 are using cmake by default, and cmake have better support for qt now. For debugging with QString and other Qt object, we need visualizerFile for debugger, so we need automatically specify the visualizerFile automatically when the project are depends on Qt
Thank you for the feature idea. We will analyze and triage it. In the mean time, since I am not very familiar with this, just give a few more details about this visualizerFile, what should the extension do exactly.
Thank you for the feature idea. We will analyze and triage it. In the mean time, since I am not very familiar with this, just give a few more details about this visualizerFile, what should the extension do exactly.
when launch the debugger, specify the visualizerFile properly
@lygstate
Kindly bumping up this issue as I'm also willing to use vscode+cmake+msvc+Qt, and types visualizers (natvis files) are a must have. This is not specific to Qt or any other library btw.
I see that the configuration item cmake.debugConfig.visualizerFile already exists in your codebase but is not implemented anywhere. Also it appears as "unknown" when trying to add it to settings files:
I believe this value is meant to be forwarded to the visualizerFile attribute of the launch configuration as documented here. That's also something that the Qt tools extension addresses but this extension seems incompatible with a cmake flow as it taps into launch.js directly to set the visualizerFile attribute.
Please let me know if I can provide further information. Many thanks, Cyril
I think this feature could be done as a part of https://github.com/microsoft/vscode-cmake-tools/issues/1394
If this add-on would generate proper launch files, we could edit them in any way
@CComparon
I think you made mistake in your config.
"cmake.debugConfig": {
"visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml",
"showDisplayString": true,
},
in my case this snippet in settings.json works (showDisplayString is true bacause of this)
@CComparon I think you made mistake in your config.
"cmake.debugConfig": { "visualizerFile": "${workspaceFolder}/.vscode/qt5.natvis.xml", "showDisplayString": true, },in my case this snippet in
settings.jsonworks (showDisplayString is true bacause of this)
This approach will lead to serious performance losses. I have found a better solution.
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "$PATH:${command:cmake.launchTargetDirectory}"
}
],
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
}
]
}
setup the command enable pretty-printing for gdb, and set qt5printing, You can get the same result, and there is no longer a lag in the debug process.