| Crates.io | natvis-pdbs |
| lib.rs | natvis-pdbs |
| version | 1.0.3 |
| created_at | 2019-11-28 02:33:43.758139+00 |
| updated_at | 2022-09-07 00:13:50.996167+00 |
| description | A metabuild/build.rs compatible crate to embed .natvis debug visualizer files into your executable's .pdbs, for ease of debugging. |
| homepage | |
| repository | https://github.com/MaulingMonkey/natvis-pdbs |
| max_upload_size | |
| id | 185007 |
| size | 29,475 |
A metabuild / build.rs compatible crate to embed .natvis debug visualizer files into your executable's .pdbs, for ease of debugging.
Natvis and PDBs being Microsoft technologies, this won't have any effect unless using MSVC-based build toolchains.
While crate-type=rlib crates can contain .natvis files, they should not directly rely on natvis-pdbs.
(Due to the way crates are isolated for build, natvis-pdbs will only work when used for the final .exe, .lib,
or .dll crate at this time.)
This abuses the %LINK% environment variable since there's currently no stable build.rs-friendly arbitrary link-args.
Place one or more natvis files inside any of:
{root}\src folder.{root}\debug_metadata folder.Any other locations (including subdirectories of the above) will not (currently) be searched. See Recommended Reading bellow for more information about the .natvis format.
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="example_crate_with_natvis::Flags">
<Expand>
<Item Name="bits" ExcludeView="sparse">bits,bb</Item>
<Item Name="A (1)" ExcludeView="sparse">(bits & (1 << 0)) != 0</Item>
<Item Name="B (2)" ExcludeView="sparse">(bits & (1 << 1)) != 0</Item>
<Item Name="C (4)" ExcludeView="sparse">(bits & (1 << 2)) != 0</Item>
</Expand>
</Type>
</AutoVisualizer>
Add the following to your executable's Cargo.toml:
[build-dependencies]
natvis-pdbs = "1"
And the following to your build.rs:
fn main() {
natvis_pdbs::metabuild();
}
Add the following to your executable's Cargo.toml:
cargo-features = ["metabuild"]
[package]
metabuild = ["natvis-pdbs"]
[build-dependencies]
natvis-pdbs = "1"
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.