#[non_exhaustive]pub struct ConvertUnitEntry<'a, R: Reader<Offset = usize>> {
pub read_unit: UnitRef<'a, R>,
pub read_entry: DebuggingInformationEntry<R>,
pub sibling: bool,
pub parent: Option<UnitEntryId>,
}Expand description
A DIE read by ConvertUnit::read_entry.
This is a simple wrapper that adds some extra information to
read::DebuggingInformationEntry. The inner Self::read_entry is accessible
via Deref.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read_unit: UnitRef<'a, R>The unit that this DIE was read from.
This may be a skeleton unit.
read_entry: DebuggingInformationEntry<R>The DIE that was read.
sibling: boolTrue if the DW_AT_sibling attribute was present.
parent: Option<UnitEntryId>The id of the entry that was reserved for this DIE’s parent, if any.
You may ignore this value if you wish to use a different parent.
This is set to None if the parent is unknown or is the root DIE.
Implementations§
Source§impl<'a, R: Reader<Offset = usize>> ConvertUnitEntry<'a, R>
impl<'a, R: Reader<Offset = usize>> ConvertUnitEntry<'a, R>
Sourcepub fn null(read_unit: UnitRef<'a, R>) -> Self
pub fn null(read_unit: UnitRef<'a, R>) -> Self
Return a null entry.
This can be used with ConvertUnit::read_entry,
Sourcepub fn read(
read_unit: UnitRef<'a, R>,
offset: UnitOffset,
) -> ConvertResult<ConvertUnitEntry<'a, R>>
pub fn read( read_unit: UnitRef<'a, R>, offset: UnitOffset, ) -> ConvertResult<ConvertUnitEntry<'a, R>>
Read the DIE at the given offset.
This does not affect the state of the reader.
The returned entry will not have a valid depth or parent.
This may be used for entries that were not filtered or reserved.
Returns an error if there is no entry at the given offset.
Methods from Deref<Target = DebuggingInformationEntry<R>>§
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.