#[non_exhaustive]pub struct DebugInfo {
pub instructions: HashMap<usize, DebugInst>,
pub functions: HashMap<Hash, DebugSignature>,
pub functions_rev: HashMap<usize, Hash>,
pub hash_to_ident: HashMap<Hash, Box<str>>,
pub globals: Vec<DebugGlobal>,
}Expand description
Debug information about a unit.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.instructions: HashMap<usize, DebugInst>Debug information on each instruction.
functions: HashMap<Hash, DebugSignature>Function signatures.
functions_rev: HashMap<usize, Hash>Reverse lookup of a function.
hash_to_ident: HashMap<Hash, Box<str>>Hash to identifier.
globals: Vec<DebugGlobal>Static slots, indexed by slot.
This is empty if debug information has been disabled, in which case diagnostics have to refer to a static by its slot index.
Implementations§
Source§impl DebugInfo
impl DebugInfo
Sourcepub fn instruction_at(&self, ip: usize) -> Option<&DebugInst>
pub fn instruction_at(&self, ip: usize) -> Option<&DebugInst>
Get debug instruction at the given instruction pointer.
Sourcepub fn function_at(&self, ip: usize) -> Option<(Hash, &DebugSignature)>
pub fn function_at(&self, ip: usize) -> Option<(Hash, &DebugSignature)>
Get the function corresponding to the given instruction pointer.
Sourcepub fn ident_for_hash(&self, hash: Hash) -> Option<&str>
pub fn ident_for_hash(&self, hash: Hash) -> Option<&str>
Access an identifier for the given hash - if it exists.
Sourcepub fn global(&self, slot: usize) -> Option<&DebugGlobal>
pub fn global(&self, slot: usize) -> Option<&DebugGlobal>
Access debug information for the given static slot - if it exists.
Trait Implementations§
Source§impl<'__de, __A> Decode<'__de, Binary, __A> for DebugInfowhere
__A: Allocator,
Available on crate feature musli only.
impl<'__de, __A> Decode<'__de, Binary, __A> for DebugInfowhere
__A: Allocator,
Available on crate feature
musli only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'__de, __A> Decode<'__de, Text, __A> for DebugInfowhere
__A: Allocator,
Available on crate feature musli only.
impl<'__de, __A> Decode<'__de, Text, __A> for DebugInfowhere
__A: Allocator,
Available on crate feature
musli only.Source§const IS_BITWISE_DECODE: bool = false
const IS_BITWISE_DECODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl<'de> Deserialize<'de> for DebugInfo
Available on crate feature serde only.
impl<'de> Deserialize<'de> for DebugInfo
Available on crate feature
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Encode<Binary> for DebugInfo
Available on crate feature musli only.
impl Encode<Binary> for DebugInfo
Available on crate feature
musli only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Source§impl Encode<Text> for DebugInfo
Available on crate feature musli only.
impl Encode<Text> for DebugInfo
Available on crate feature
musli only.Source§const IS_BITWISE_ENCODE: bool = false
const IS_BITWISE_ENCODE: bool = false
Whether the type is packed. Packed types can be bitwise copied if the
representation of the serialization format is identical to the memory
layout of the type. Read more
Auto Trait Implementations§
impl Freeze for DebugInfo
impl RefUnwindSafe for DebugInfo
impl Send for DebugInfo
impl Sync for DebugInfo
impl Unpin for DebugInfo
impl UnsafeUnpin for DebugInfo
impl UnwindSafe for DebugInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more