vscode is meant to be able to pretty print custom objects if given a natvis file. I'm running linux and debugging with gdb.
The docs say:
For gdb/lldb debugging ("type": "cppdbg"), a subset of the Natvis framework has been ported to the Visual Studio Code C/C++ extension and the code resides in the MIEngine shared component. If additional features that are not implemented are requested, please file an issue on the MIEngine GitHub page with details of what is missing.
I've created a simple natvis file based on the natvis page here:
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="MyArray">
<DisplayString>{{size={size}}}</DisplayString>
<Expand>
<Item Name="[size]">size</Item>
<ArrayItems>
<Size>size</Size>
<ValuePointer>ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
</AutoVisualizer>
I've included a reference to this file in my launch.json:
"visualizerFile": "${workspaceFolder}/file.natvis",
After launching the debugger and hovering over a variable I see "Explicit refresh required for visualized expressions". This was promising because it shows vscode has found the file, but it still isn't able to apply it for some reason. There are no natvis logs/errors in any of the vscode OUTPUT/DEBUG CONSOLE tabs.
Is there something I'm missing? How can I get vscode+gdb to use my .natvis file?

The solution for me came from here:
Adding the following line in addition to
visualizerFilesuddenly made the .natvis definitions work.FYI, I also noticed that vscode passes
--interpreter=mitogdb, so there is some explicitgdbsupport for interacting with the MIEngine referenced by the docs.