pub struct DebuggingInformationEntry<R, Offset = <R as Reader>::Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,{
pub tag: DwTag,
pub has_children: bool,
pub attrs: Vec<Attribute<R>>,
pub offset: UnitOffset<Offset>,
pub depth: isize,
}Expand description
A Debugging Information Entry (DIE).
DIEs have a set of attributes and optionally have children DIEs as well.
Creating a DebuggingInformationEntry requires an allocation, so frequent cloning of
this struct may be slow.
Fields§
§tag: DwTagThe DWARF tag for this entry.
has_children: boolWhether this entry has a null terminated list of children.
Note that this list may be empty.
attrs: Vec<Attribute<R>>This entry’s attributes.
offset: UnitOffset<Offset>The offset within the unit of this entry.
depth: isizeThe tree depth of this entry relative to the entry where reading started.
Implementations§
Source§impl<R, Offset> DebuggingInformationEntry<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> DebuggingInformationEntry<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
Sourcepub fn new(
tag: DwTag,
has_children: bool,
attrs: Vec<Attribute<R>>,
offset: UnitOffset<Offset>,
) -> Self
pub fn new( tag: DwTag, has_children: bool, attrs: Vec<Attribute<R>>, offset: UnitOffset<Offset>, ) -> Self
Construct a new DebuggingInformationEntry.
Sourcepub fn set_null(&mut self)
pub fn set_null(&mut self)
Set the entry to a null entry.
This sets the tag to DW_TAG_null, and resets the has_children and attrs fields.
Sourcepub fn depth(&self) -> isize
pub fn depth(&self) -> isize
Get the tree depth of this entry relative to the entry where reading started.
Sourcepub fn offset(&self) -> UnitOffset<Offset>
pub fn offset(&self) -> UnitOffset<Offset>
Get this entry’s offset.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Return true if this entry’s type can have children, false otherwise.
Sourcepub fn has_attr(&self, name: DwAt) -> bool
pub fn has_attr(&self, name: DwAt) -> bool
Return true if this entry has an attribute with the given name.
Sourcepub fn attr(&self, name: DwAt) -> Option<&Attribute<R>>
pub fn attr(&self, name: DwAt) -> Option<&Attribute<R>>
Find the first attribute in this entry which has the given name.
Returns None if no attribute is found.
Sourcepub fn attr_value_raw(&self, name: DwAt) -> Option<AttributeValue<R>>
pub fn attr_value_raw(&self, name: DwAt) -> Option<AttributeValue<R>>
Find the first attribute in this entry which has the given name, and return its raw value.
Returns None if no attribute is found.
Sourcepub fn attr_value(&self, name: DwAt) -> Option<AttributeValue<R>>
pub fn attr_value(&self, name: DwAt) -> Option<AttributeValue<R>>
Find the first attribute in this entry which has the given name, and return its normalized value.
Returns None if no attribute is found.
Trait Implementations§
Source§impl<R, Offset> Clone for DebuggingInformationEntry<R, Offset>
impl<R, Offset> Clone for DebuggingInformationEntry<R, Offset>
Source§fn clone(&self) -> DebuggingInformationEntry<R, Offset>
fn clone(&self) -> DebuggingInformationEntry<R, Offset>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more