zig
zig copied to clipboard
Add the ability to link Natvis files into PDBs
Natvis[^1] is a framework to support programmer-defined type formatting when debugging. It's similar to the GDB/LLDB pretty printers in tools except that the files are embedded into PDBs as-is instead of relying on having the scripts available. Support is shared across all the Microsoft debugging tools (WinDbg, Visual Studio + Code).
[^1]: Create custom views of C++ objects in the debugger using the Natvis framework
For an example: Rust projects built in Debug mode contain these definitions in the resulting PDB.
Some things to consider:
- The files are XML, but they aren't validated at link time (tested using msvc
linkand clang-cl). - The type names may shift around due to Zig using one compilation unit. It seems the stdlib types stick to
std..