Struct gimli::read::UnitHeader

source ·
pub struct UnitHeader<R, Offset = <R as Reader>::Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,
{ /* private fields */ }
Expand description

The common fields for the headers of compilation units and type units.

Implementations§

source§

impl<R, Offset> UnitHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

Static methods.

source

pub fn new( encoding: Encoding, unit_length: Offset, unit_type: UnitType<Offset>, debug_abbrev_offset: DebugAbbrevOffset<Offset>, unit_offset: UnitSectionOffset<Offset>, entries_buf: R, ) -> Self

Construct a new UnitHeader.

source§

impl<R, Offset> UnitHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

Instance methods.

source

pub fn offset(&self) -> UnitSectionOffset<Offset>

Get the offset of this unit within its section.

source

pub fn size_of_header(&self) -> usize

Return the serialized size of the common unit header for the given DWARF format.

source

pub fn unit_length(&self) -> Offset

Get the length of the debugging info for this compilation unit, not including the byte length of the encoded length itself.

source

pub fn length_including_self(&self) -> Offset

Get the length of the debugging info for this compilation unit, including the byte length of the encoded length itself.

source

pub fn encoding(&self) -> Encoding

Return the encoding parameters for this unit.

source

pub fn version(&self) -> u16

Get the DWARF version of the debugging info for this compilation unit.

source

pub fn type_(&self) -> UnitType<Offset>

Get the UnitType of this unit.

source

pub fn debug_abbrev_offset(&self) -> DebugAbbrevOffset<Offset>

The offset into the .debug_abbrev section for this compilation unit’s debugging information entries’ abbreviations.

source

pub fn address_size(&self) -> u8

The size of addresses (in bytes) in this compilation unit.

source

pub fn format(&self) -> Format

Whether this compilation unit is encoded in 64- or 32-bit DWARF.

source

pub fn header_size(&self) -> Offset

The serialized size of the header for this compilation unit.

source

pub fn range(&self, idx: Range<UnitOffset<Offset>>) -> Result<R>

Get the underlying bytes for the supplied range.

source

pub fn range_from(&self, idx: RangeFrom<UnitOffset<Offset>>) -> Result<R>

Get the underlying bytes for the supplied range.

source

pub fn range_to(&self, idx: RangeTo<UnitOffset<Offset>>) -> Result<R>

Get the underlying bytes for the supplied range.

source

pub fn entry<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, offset: UnitOffset<Offset>, ) -> Result<DebuggingInformationEntry<'abbrev, 'me, R>>

Read the DebuggingInformationEntry at the given offset.

source

pub fn entries<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, ) -> EntriesCursor<'abbrev, 'me, R>

Navigate this unit’s DebuggingInformationEntrys.

source

pub fn entries_at_offset<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, offset: UnitOffset<Offset>, ) -> Result<EntriesCursor<'abbrev, 'me, R>>

Navigate this compilation unit’s DebuggingInformationEntrys starting at the given offset.

source

pub fn entries_tree<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, offset: Option<UnitOffset<Offset>>, ) -> Result<EntriesTree<'abbrev, 'me, R>>

Navigate this unit’s DebuggingInformationEntrys as a tree starting at the given offset.

source

pub fn entries_raw<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, offset: Option<UnitOffset<Offset>>, ) -> Result<EntriesRaw<'abbrev, 'me, R>>

Read the raw data that defines the Debugging Information Entries.

source

pub fn abbreviations( &self, debug_abbrev: &DebugAbbrev<R>, ) -> Result<Abbreviations>

Parse this unit’s abbreviations.

Trait Implementations§

source§

impl<R, Offset> Clone for UnitHeader<R, Offset>
where R: Reader<Offset = Offset> + Clone, Offset: ReaderOffset + Clone,

source§

fn clone(&self) -> UnitHeader<R, Offset>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<R, Offset> Debug for UnitHeader<R, Offset>
where R: Reader<Offset = Offset> + Debug, Offset: ReaderOffset + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<R, Offset> PartialEq for UnitHeader<R, Offset>
where R: Reader<Offset = Offset> + PartialEq, Offset: ReaderOffset + PartialEq,

source§

fn eq(&self, other: &UnitHeader<R, Offset>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<R, Offset> Copy for UnitHeader<R, Offset>
where R: Reader<Offset = Offset> + Copy, Offset: ReaderOffset + Copy,

source§

impl<R, Offset> Eq for UnitHeader<R, Offset>
where R: Reader<Offset = Offset> + Eq, Offset: ReaderOffset + Eq,

source§

impl<R, Offset> StructuralPartialEq for UnitHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

Auto Trait Implementations§

§

impl<R, Offset> Freeze for UnitHeader<R, Offset>
where Offset: Freeze, R: Freeze,

§

impl<R, Offset> RefUnwindSafe for UnitHeader<R, Offset>
where Offset: RefUnwindSafe, R: RefUnwindSafe,

§

impl<R, Offset> Send for UnitHeader<R, Offset>
where Offset: Send, R: Send,

§

impl<R, Offset> Sync for UnitHeader<R, Offset>
where Offset: Sync, R: Sync,

§

impl<R, Offset> Unpin for UnitHeader<R, Offset>
where Offset: Unpin, R: Unpin,

§

impl<R, Offset> UnwindSafe for UnitHeader<R, Offset>
where Offset: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.