Struct gimli::DebuggingInformationEntry
[−]
[src]
pub struct DebuggingInformationEntry<'input, 'abbrev, 'unit, Endian> where
'input: 'unit,
Endian: Endianity + 'unit, { /* fields omitted */ }
A Debugging Information Entry (DIE).
DIEs have a set of attributes and optionally have children DIEs as well.
Methods
impl<'input, 'abbrev, 'unit, Endian> DebuggingInformationEntry<'input, 'abbrev, 'unit, Endian> where
Endian: Endianity,
[src]
Endian: Endianity,
fn code(&self) -> u64
Get this entry's code.
fn offset(&self) -> UnitOffset
Get this entry's offset.
fn tag(&self) -> DwTag
Get this entry's DW_TAG_whatever
tag.
let entry = get_some_entry(); match entry.tag() { gimli::DW_TAG_subprogram => println!("this entry contains debug info about a function"), gimli::DW_TAG_inlined_subroutine => println!("this entry contains debug info about a particular instance of inlining"), gimli::DW_TAG_variable => println!("this entry contains debug info about a local variable"), gimli::DW_TAG_formal_parameter => println!("this entry contains debug info about a function parameter"), otherwise => println!("this entry is some other kind of data: {:?}", otherwise), };
fn has_children(&self) -> bool
Return true if this entry's type can have children, false otherwise.
fn attrs<'me>(&'me self) -> AttrsIter<'input, 'abbrev, 'me, 'unit, Endian>
Iterate over this entry's set of attributes.
use gimli::{DebugAbbrev, DebugInfo, LittleEndian}; // Read the `.debug_info` section. let debug_info = DebugInfo::<LittleEndian>::new(read_debug_info_section_somehow()); // Get the data about the first compilation unit out of the `.debug_info`. let unit = debug_info.units().next() .expect("Should have at least one compilation unit") .expect("and it should parse ok"); // Read the `.debug_abbrev` section and parse the // abbreviations for our compilation unit. let debug_abbrev = DebugAbbrev::<LittleEndian>::new(read_debug_abbrev_section_somehow()); let abbrevs = unit.abbreviations(debug_abbrev).unwrap(); // Get the first entry from that compilation unit. let mut cursor = unit.entries(&abbrevs); let (_, entry) = cursor.next_dfs() .expect("Should parse next entry") .expect("Should have at least one entry"); // Finally, print the first entry's attributes. let mut attrs = entry.attrs(); while let Some(attr) = attrs.next().unwrap() { println!("Attribute name = {:?}", attr.name()); println!("Attribute value = {:?}", attr.value()); }
Can be used with
FallibleIterator
.
fn attr(&self, name: DwAt) -> Result<Option<Attribute<'input, Endian>>>
Find the first attribute in this entry which has the given name,
and return it. Returns Ok(None)
if no attribute is found.
fn attr_value_raw(
&self,
name: DwAt
) -> Result<Option<AttributeValue<'input, Endian>>>
&self,
name: DwAt
) -> Result<Option<AttributeValue<'input, Endian>>>
Find the first attribute in this entry which has the given name,
and return its raw value. Returns Ok(None)
if no attribute is found.
fn attr_value(
&self,
name: DwAt
) -> Result<Option<AttributeValue<'input, Endian>>>
&self,
name: DwAt
) -> Result<Option<AttributeValue<'input, Endian>>>
Find the first attribute in this entry which has the given name,
and return its normalized value. Returns Ok(None)
if no
attribute is found.
Trait Implementations
impl<'input, 'abbrev, 'unit, Endian: Clone> Clone for DebuggingInformationEntry<'input, 'abbrev, 'unit, Endian> where
'input: 'unit,
Endian: Endianity + 'unit,
[src]
'input: 'unit,
Endian: Endianity + 'unit,
fn clone(&self) -> DebuggingInformationEntry<'input, 'abbrev, 'unit, Endian>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'input, 'abbrev, 'unit, Endian: Debug> Debug for DebuggingInformationEntry<'input, 'abbrev, 'unit, Endian> where
'input: 'unit,
Endian: Endianity + 'unit,
[src]
'input: 'unit,
Endian: Endianity + 'unit,