[英]Using .natvis file to visualise C++ objects in VS Code
根据此链接,.natvis 文件可用于可视化本机对象。 具体来说,我希望能够使用this.natvis file检查Eigen::Matrix
对象。
但是,上面的链接不包含有关如何在 VS Code 中实际使用 a.natvis 文件的任何信息。 是否可以使用 custom.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++-8 build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++-8 build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
launch.json 文件有一个 VisualizerFile 选项:
{
"name": "g++-8 build and debug active file",
"visualizerFile": "${workspaceFolder}/path/to/file.natvis",
"showDisplayString": true,
...
},
此处提供更多文档(请参阅 VisualizerFile 和 showDisplayString 表条目): https://docs.microsoft.com/en-us/cpp/build/launch-vs-schema-reference-cpp?view=vs-2019#c- linux-属性
您可能也对此问题感兴趣: https://github.com/Microsoft/vscode-cpptools/issues/925
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.