According to this link, .natvis files can be used to visualise native objects. Specifically, I would like to be able to inspect Eigen::Matrix
objects using this .natvis file.
However, the link above does not contain any information on how to actually use a .natvis file in VS Code. Is it possible using a custom .natvis file?
Here is my launch.json file for reference:
{
// 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"
}
]
}
The launch.json file has has a visualizerFile option:
{
"name": "g++-8 build and debug active file",
"visualizerFile": "${workspaceFolder}/path/to/file.natvis",
"showDisplayString": true,
...
},
Some more documentation here (see the visualizerFile and showDisplayString table entries): https://docs.microsoft.com/en-us/cpp/build/launch-vs-schema-reference-cpp?view=vs-2019#c-linux-properties
You might also be interested in this issue: https://github.com/Microsoft/vscode-cpptools/issues/925
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With