【发布时间】:2023-01-29 23:20:31
【问题描述】:
当我在 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
并且 DebugConsole 不是很有帮助 Debug Console
简而言之,我希望有一种简单的方法可以在“运行和调试窗口”中查看 Eigen::VectorXd 的所有变量
【问题讨论】:
标签: debugging visual-studio-code eigen3 natvis