Struct gimli::read::Attribute[][src]

pub struct Attribute<R: Reader> { /* fields omitted */ }

An attribute in a DebuggingInformationEntry, consisting of a name and associated value.

Implementations

impl<R: Reader> Attribute<R>[src]

pub fn name(&self) -> DwAt[src]

Get this attribute’s name.

pub fn raw_value(&self) -> AttributeValue<R>[src]

Get this attribute’s raw value.

pub fn value(&self) -> AttributeValue<R>[src]

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 “Table 7.5: Attribute encodings” and “Table 7.6: Attribute form encodings”.

pub fn u8_value(&self) -> Option<u8>[src]

Try to convert this attribute’s value to a u8.

pub fn u16_value(&self) -> Option<u16>[src]

Try to convert this attribute’s value to a u16.

pub fn udata_value(&self) -> Option<u64>[src]

Try to convert this attribute’s value to an unsigned integer.

pub fn sdata_value(&self) -> Option<i64>[src]

Try to convert this attribute’s value to a signed integer.

pub fn offset_value(&self) -> Option<R::Offset>[src]

Try to convert this attribute’s value to an offset.

pub fn exprloc_value(&self) -> Option<Expression<R>>[src]

Try to convert this attribute’s value to an expression or location buffer.

Expressions and locations may be DW_FORM_block* or DW_FORM_exprloc. The standard doesn’t mention DW_FORM_block* as a possible form, but it is encountered in practice.

pub fn string_value(&self, debug_str: &DebugStr<R>) -> Option<R>[src]

Try to return this attribute’s value as a string slice.

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.

Warning: this function does not handle all possible string forms. Use Dwarf::attr_string instead.

pub fn string_value_sup(
    &self,
    debug_str: &DebugStr<R>,
    debug_str_sup: Option<&DebugStr<R>>
) -> Option<R>
[src]

Try to return this attribute’s value as a string slice.

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, or a DW_FORM_strp_sup reference to an offset into a supplementary object file, return the attribute’s string value as Some. Other attribute value forms are returned as None.

Warning: this function does not handle all possible string forms. Use Dwarf::attr_string instead.

Trait Implementations

impl<R: Clone + Reader> Clone for Attribute<R>[src]

impl<R: Copy + Reader> Copy for Attribute<R>[src]

impl<R: Debug + Reader> Debug for Attribute<R>[src]

impl<R: Eq + Reader> Eq for Attribute<R>[src]

impl<R: PartialEq + Reader> PartialEq<Attribute<R>> for Attribute<R>[src]

impl<R: Reader> StructuralEq for Attribute<R>[src]

impl<R: Reader> StructuralPartialEq for Attribute<R>[src]

Auto Trait Implementations

impl<R> Send for Attribute<R> where
    R: Send,
    <R as Reader>::Offset: Send

impl<R> Sync for Attribute<R> where
    R: Sync,
    <R as Reader>::Offset: Sync

impl<R> Unpin for Attribute<R> where
    R: Unpin,
    <R as Reader>::Offset: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.