Auto merge of #91779 - ridwanabdillahi:natvis, r=michaelwoerister
Add a new Rust attribute to support embedding debugger visualizers Implemented [this RFC](https://github.com/rust-lang/rfcs/pull/3191) to add support for embedding debugger visualizers into a PDB. Added a new attribute `#[debugger_visualizer]` and updated the `CrateMetadata` to store debugger visualizers for crate dependencies. RFC: https://github.com/rust-lang/rfcs/pull/3191
This commit is contained in:
commit
a7d6768e3b
29 changed files with 554 additions and 76 deletions
|
@ -70,6 +70,7 @@ use std::hash::Hash;
|
|||
use std::ops::{Add, Range, Sub};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
use md5::Digest;
|
||||
use md5::Md5;
|
||||
|
@ -1199,6 +1200,28 @@ impl SourceFileHash {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(HashStable_Generic)]
|
||||
#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash, Debug, Encodable, Decodable)]
|
||||
pub enum DebuggerVisualizerType {
|
||||
Natvis,
|
||||
}
|
||||
|
||||
/// A single debugger visualizer file.
|
||||
#[derive(HashStable_Generic)]
|
||||
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable)]
|
||||
pub struct DebuggerVisualizerFile {
|
||||
/// The complete debugger visualizer source.
|
||||
pub src: Arc<[u8]>,
|
||||
/// Indicates which visualizer type this targets.
|
||||
pub visualizer_type: DebuggerVisualizerType,
|
||||
}
|
||||
|
||||
impl DebuggerVisualizerFile {
|
||||
pub fn new(src: Arc<[u8]>, visualizer_type: DebuggerVisualizerType) -> Self {
|
||||
DebuggerVisualizerFile { src, visualizer_type }
|
||||
}
|
||||
}
|
||||
|
||||
/// A single source in the [`SourceMap`].
|
||||
#[derive(Clone)]
|
||||
pub struct SourceFile {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue