Xcode needs to support natvis files

Visual Studio, Stadia, and JetBrains are supporting natvis files, where Xcode is still stuck on lldb python files that even Xcode no longer uses to debug data structures. Apple has converted all of their scripts to native code, so there are no samples of how to write complex lldb visualizer rules.

There is already an lldb-eval that can bring in natvis files, so something like this should be brought to Xcode. C++ packages like EASTL only ship with a natvis file, and it's far simpler to edit and write than the lldb rules and python scripting.

Replies

Choose Help > Report an Issue in Xcode to file feedback for this request. Posting about it on these forums isn't going to do anything.

Hi, we do try to see forum posts too, but yes filing feedback is the best way to be seen, and also to know when your requests have been addressed in an Xcode release.

We are aware of lldb-eval. There has been a proposal to incorporate its functionality into lldb. See https://discourse.llvm.org/t/rfc-data-inspection-language/69893

As mentioned in that forum post, lldb-eval itself doesn't support Natvis. The post mentions that some Natvis tooling exists which makes use of lldb-eval, for performance.

it's far simpler to edit and write than the lldb rules and python scripting.

Do you edit and write the Natvis directly with XML? Or are there high level tools for writing Natvis that hide the XML syntax? I have looked at Natvis, and found myself thinking the opposite, that it must be difficult to get over the learning curve of writing debug formatters in XML.

If you send a feedback, please share its URL here.

-- Dave

I'm not writing Natvis presently, but I have written some in the past. It was EASTL that has the natvis file for all of it's STL data structures. And Xcode has hidden away all of their STL visualizers in fast C++ land, and stripped all the python. And I've also had to write lldb python to fix debugging some of my C++ structs. Both are painful, so no one writes them or puts them out on GitHub. But I feel like the more options that Xcode can import the better, and natvis seems to have won. If you can point me to anyone doing lldbinit files for their projects then I'd be surprised. Will write this up as an FA post.