Natvis settings not working?
-
Im trying to get the natvis files to work, and I added the settings from the documentation.
However this does not seem to do anything. Is there something im missing?AdditionalSolutionFiles=\ ..\..\frameworks\core.framework\project\typeviewer\msvc\maxon.natvis;\ ..\..\frameworks\cinema.framework\project\typeviewer\msvc\c4dapi.natvis
I have gotten it to work by manually adding the natvis to the visual studio document folder, but i would like to automate it.
-
Hey @ECHekman,
Thank you for reaching out to us. Your question is a bit ambiguous since you neither tell us where you put the snippet you show us and what your project structure is, nor what constitutes for you as 'does not seem to do anything'.
AdditionalSolutionFiles
is a command that only works in solution definitions (the docs could admittedly be a bit more verbose about this) or in non-public project types such asapp
. E.g., forsdk\plugins\project\projectdefinition.txt
, the solution definition of the C++ SDK, the following definition:// The platforms this solution is targeting - can be [Win64;OSX;Linux]. Platform=Win64;OSX;Linux // The type of this definition. Type=Solution // The /projects/plugins/ projects that are part of this solution. Each of them will be compiled into its own // binary and corresponds to a folder in /plugins/, each with its own projectdefinition.txt file. Solution=\ plugins/example.main;\ plugins/example.migration_2024;\ plugins/example.assets;\ plugins/example.nodes;\ plugins/example.image // The files we want to add to the solution, there is AFAIK no way to do this on a project level for things // that are neither binary nor source code libraries. AdditionalSolutionFiles=\ ..\..\frameworks\core.framework\project\typeviewer\msvc\maxon.natvis;\ ..\..\frameworks\cinema.framework\project\typeviewer\msvc\c4dapi.natvis;
Will result in this:
Which I would consider working just fine, or does this not do what you want? I would want to also point out here out that the project tool is deprecated tech. We will move away from it quite soon, so we will not be adding new features to it anymore.
Cheers,
Ferdinand -
Is maxon.natvis supposed to work for Node types e.g maxon::GraphNode, maxon::nodes::Node or did we miss something obvious? It seems they use some internal types which are not available and I ended up writing something similar to the pointer arithmetic in the python lldb script.
-
Thanks Ferdinand. Putting those lines in the projectdefinitions.txt of the solution was the... solution
-
Hey @bojidar,
well, we do not write these object views (the natvis for MSVC and the Python scripts for Xcode) for public usage but for internal usage. That we hand them out to third parties is just a courtesy. When we are looking at
maxon::GraphNode
,<Type Name="maxon::GraphNode"> <DisplayString Condition="_mem[0] != 0">{((maxon::NodePath*)&_mem[0]),na}</DisplayString> <!-- Root will have empty path and valid graph --> <DisplayString Condition="_mem[0] == 0 && _graph._object != 0">Root</DisplayString> <DisplayString Condition="_mem[0] == 0">nullptr</DisplayString> <Expand> <Item Name="Path">(((maxon::NodePath*)&_mem[0])),na</Item> <Item Name="Kind" Condition="_mem[0] != 0 && _graph._object != 0">(maxon::NODE_KIND)((((nodes.module.xdl64!maxon::nodes::NodePathImpl::CountAndKind*) & (*(nodes.module.xdl64!maxon::nodes::NodePathImpl**) & _mem[0])->_path))->kind & 0xFF)</Item> <Item Name="Kind" Condition="_mem[0] == 0 && _graph._object != 0">maxon::NODE_KIND::NONE</Item> <Item Name="Info">((nodes.module.xdl64!maxon::nodes::NodesGraphModelImpl::Info*)this->_mem),na</Item> <Item Name="Graph">(this->_graph)</Item> <Item Name="Graph Storage">(this->_mem)</Item> </Expand> </Type>
then there are indeed quite a few references to the implementation (which means that this cannot work in the public API). You could rip these out to make it work, but would then be left with only a small subset of the debug attributes. But that would be up to you.
In general, you can expect the Cinema API to be more conservative and almost all object views working there, while the Maxon API is generally more internal in nature.
Cheers,
Ferdinand