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

Add the ability to link Natvis files into PDBs #19646

Open
The-King-of-Toasters opened this issue Apr 14, 2024 · 0 comments · May be fixed by #19873
Open

Add the ability to link Natvis files into PDBs #19646

The-King-of-Toasters opened this issue Apr 14, 2024 · 0 comments · May be fixed by #19873

Comments

@The-King-of-Toasters
Copy link
Contributor

Natvis1 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).

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 link and clang-cl).
  • The type names may shift around due to Zig using one compilation unit. It seems the stdlib types stick to std..

Footnotes

  1. Create custom views of C++ objects in the debugger using the Natvis framework

The-King-of-Toasters added a commit to The-King-of-Toasters/zig that referenced this issue May 6, 2024
Adds the ability to include Natvis[1] files into a module's PDB using
`Compile.addObjectFile`. This is eventually passed to the linker via the
`-NATVIS:[file]` flag.

Fixes: ziglang#19646
@The-King-of-Toasters The-King-of-Toasters linked a pull request May 6, 2024 that will close this issue
3 tasks
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.

1 participant