Struct gimli::Attribute
[−]
[src]
pub struct Attribute<'input, Endian> where Endian: Endianity { /* fields omitted */ }
An attribute in a DebuggingInformationEntry
, consisting of a name and
associated value.
Methods
impl<'input, Endian> Attribute<'input, Endian> where Endian: Endianity
[src]
fn name(&self) -> DwAt
Get this attribute's name.
fn raw_value(&self) -> AttributeValue<'input, Endian>
Get this attribute's raw value.
fn value(&self) -> AttributeValue<'input, Endian>
Get this attribute's normalized value.
Attribute values can potentially be encoded in multiple equivalent forms, and may have special meaning depending on the attribute name. This method converts the attribute value to a normalized form based on the attribute name.
See "Figure 20. Attribute encodings" and "Figure 21. Attribute form encodings".
fn u8_value(&self) -> Option<u8>
Try to convert this attribute's value to a u8.
fn u16_value(&self) -> Option<u16>
Try to convert this attribute's value to a u16.
fn udata_value(&self) -> Option<u64>
Try to convert this attribute's value to an unsigned integer.
fn sdata_value(&self) -> Option<i64>
Try to convert this attribute's value to a signed integer.
fn offset_value(&self) -> Option<usize>
Try to convert this attribute's value to an offset.
Offsets will be Data
in DWARF version 2/3, and SecOffset
otherwise.
fn string_value(&self,
debug_str: &DebugStr<'input, Endian>)
-> Option<&'input CStr>
debug_str: &DebugStr<'input, Endian>)
-> Option<&'input CStr>
Try to return this attribute's value as a string reference.
If this attribute's value is either an inline DW_FORM_string
string,
or a DW_FORM_strp
reference to an offset into the .debug_str
section, return the attribute's string value as Some
. Other attribute
value forms are returned as None
.
Trait Implementations
impl<'input, Endian: Copy> Copy for Attribute<'input, Endian> where Endian: Endianity
[src]
impl<'input, Endian: Clone> Clone for Attribute<'input, Endian> where Endian: Endianity
[src]
fn clone(&self) -> Attribute<'input, 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