当我在vsCode(Linux上)中调试时,我想看看我的Eigen::VectorXd实际上在Store中有什么,所以我用这个Eigen.natvis https://github.com/cdcseacave/Visual-Studio-Visualizers/blob/master/Eigen.natvis进行了尝试
launch.json文件如下所示
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++-9 - Build and debug active file",
"visualizerFile": "${workspaceFolder}/natvis/Eigen.natvis",
"showDisplayString": true,
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/bin/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++-9 build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
但是调试窗口仍然只显示Run and Debug Variables
调试控制台也不是很有用
简而言之,我希望有一种简单的方法在“运行和调试窗口”中查看Eigen::VectorXd的所有变量
1条答案
按热度按时间pvcm50d11#
如在Developer's Corner和Visual-Studio-Visualizers at github中所编写的,Eigen调试可视化工具适用于Visual Studio,而不适用于VS代码。
若要从Visual Studio可视化工具中获益,必须使用Visual Studio(例如版本2022)。有关Visual Studio可视化工具的详细帮助,请参见learn.microsoft