根据this link的说法,.natvis文件可以用来可视化原生对象。具体地说,我希望能够使用this .natvis file检查Eigen::Matrix对象。
但是,上面的链接并不包含任何关于如何在VS代码中实际使用.natvis文件的信息。是否可以使用自定义的.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"
}
]
}发布于 2020-03-03 06:37:24
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-properties
您可能还会对这个问题感兴趣:https://github.com/Microsoft/vscode-cpptools/issues/925
https://stackoverflow.com/questions/58624914
复制相似问题