Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Natvis support is missing some ryml types #380

Closed
dmachaj opened this issue Jun 19, 2023 · 5 comments · Fixed by #383
Closed

Natvis support is missing some ryml types #380

dmachaj opened this issue Jun 19, 2023 · 5 comments · Fixed by #383

Comments

@dmachaj
Copy link
Contributor

dmachaj commented Jun 19, 2023

Natvis is an XML-based description format for types in the debugger. It is supported by windbg.exe and the Visual Studio debugger, at the very least. Visualizations in the debugger are especially helpful for things that are difficult to decode in the debugger (e.g. indexes into a big block of memory are difficult whereas a simple integer is easy). The documentation on natvis is here: https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2022.

I have been trying to add new usage of rapidyaml to a project that I'm working on and even in debug mode I have not been able to make sense of the ryml types in the debugger.

I had the same problem with rapidjson. However, I just looked and they support natvis. Applying their natvis file to my system was a night and day difference. Their natvis file lives here: https://github.com/Tencent/rapidjson/blob/master/contrib/natvis/rapidjson.natvis.

@dmachaj
Copy link
Contributor Author

dmachaj commented Jun 19, 2023

Nevermind, I now see that there is natvis support. I just didn't see an issue for it so I assumed it was missing. It is here:

@see http://blogs.msdn.com/b/vcblog/archive/2013/06/28/using-visual-studio-2013-to-write-maintainable-native-visualizations-natvis.aspx?PageIndex=2
.

@dmachaj dmachaj closed this as completed Jun 19, 2023
@dmachaj
Copy link
Contributor Author

dmachaj commented Jun 19, 2023

I got the natvis wired up in my project. Unfortuantely the support seems incomplete. For example, I am using ryml::ConstNodeRef for a readonly YML file. The existing natvis has ryml::NodeRef but not ConstNodeRef. The result is that this object is not visualized and is still indecipherable.

@dmachaj dmachaj reopened this Jun 19, 2023
@dmachaj dmachaj changed the title Natvis support would be extremely helpful when debugging on Windows Natvis support is missing some ryml types Jun 19, 2023
@biojppm
Copy link
Owner

biojppm commented Jul 4, 2023

Thanks for reporting. At the moment I am limited in time, and it will take some weeks before I can look at this. PR for this would be welcome.

@dmachaj
Copy link
Contributor Author

dmachaj commented Jul 7, 2023

That's fair.

If I do decide to take this on it would be very helpful if there is some sort of overview of the primary ryml types (perhaps a comment in a header file somewhere?). I have only begun to use this library so I don't have any deep understanding of the primary types or how best to visualize them. If there is some preexisting documentation that would help speed things along considerably.

Thanks.

@dmachaj
Copy link
Contributor Author

dmachaj commented Jul 15, 2023

I tried poking at this a bit today. The existing natvis provides partial coverage. There is a missing set of parenthesis that is preventing [children] from working on NodeRef. Also, copying/modifying NodeRef to cover ConstNodeRef helps my usage quite a bit.

I'd like to get [KEYMAP] and friends to be able to dump their child keys. However, I'm not sure if this can be done because the NodeData does not have a reference to the tree and can therefore not look up the underlying buffer to find the pointers to the children based on their index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants