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,
impl<R, Offset> UnitHeader<R, Offset>where R: Reader<Offset = Offset>, Offset: ReaderOffset,
Static methods.
sourcepub fn new(
encoding: Encoding,
unit_length: Offset,
unit_type: UnitType<Offset>,
debug_abbrev_offset: DebugAbbrevOffset<Offset>,
unit_offset: UnitSectionOffset<Offset>,
entries_buf: R
) -> Self
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,
impl<R, Offset> UnitHeader<R, Offset>where R: Reader<Offset = Offset>, Offset: ReaderOffset,
Instance methods.
sourcepub fn offset(&self) -> UnitSectionOffset<Offset>
pub fn offset(&self) -> UnitSectionOffset<Offset>
Get the offset of this unit within its section.
sourcepub fn size_of_header(&self) -> usize
pub fn size_of_header(&self) -> usize
Return the serialized size of the common unit header for the given DWARF format.
sourcepub fn unit_length(&self) -> Offset
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.
sourcepub fn length_including_self(&self) -> Offset
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.
sourcepub fn version(&self) -> u16
pub fn version(&self) -> u16
Get the DWARF version of the debugging info for this compilation unit.
sourcepub fn debug_abbrev_offset(&self) -> DebugAbbrevOffset<Offset>
pub fn debug_abbrev_offset(&self) -> DebugAbbrevOffset<Offset>
The offset into the .debug_abbrev
section for this compilation unit’s
debugging information entries’ abbreviations.
sourcepub fn address_size(&self) -> u8
pub fn address_size(&self) -> u8
The size of addresses (in bytes) in this compilation unit.
sourcepub fn format(&self) -> Format
pub fn format(&self) -> Format
Whether this compilation unit is encoded in 64- or 32-bit DWARF.
sourcepub fn header_size(&self) -> Offset
pub fn header_size(&self) -> Offset
The serialized size of the header for this compilation unit.
sourcepub fn range(&self, idx: Range<UnitOffset<Offset>>) -> Result<R>
pub fn range(&self, idx: Range<UnitOffset<Offset>>) -> Result<R>
Get the underlying bytes for the supplied range.
sourcepub fn range_from(&self, idx: RangeFrom<UnitOffset<Offset>>) -> Result<R>
pub fn range_from(&self, idx: RangeFrom<UnitOffset<Offset>>) -> Result<R>
Get the underlying bytes for the supplied range.
sourcepub fn range_to(&self, idx: RangeTo<UnitOffset<Offset>>) -> Result<R>
pub fn range_to(&self, idx: RangeTo<UnitOffset<Offset>>) -> Result<R>
Get the underlying bytes for the supplied range.
sourcepub fn entry<'me, 'abbrev>(
&'me self,
abbreviations: &'abbrev Abbreviations,
offset: UnitOffset<Offset>
) -> Result<DebuggingInformationEntry<'abbrev, 'me, R>>
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.
sourcepub fn entries<'me, 'abbrev>(
&'me self,
abbreviations: &'abbrev Abbreviations
) -> EntriesCursor<'abbrev, 'me, R>
pub fn entries<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations ) -> EntriesCursor<'abbrev, 'me, R>
Navigate this unit’s DebuggingInformationEntry
s.
sourcepub fn entries_at_offset<'me, 'abbrev>(
&'me self,
abbreviations: &'abbrev Abbreviations,
offset: UnitOffset<Offset>
) -> Result<EntriesCursor<'abbrev, 'me, R>>
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 DebuggingInformationEntry
s
starting at the given offset.
sourcepub fn entries_tree<'me, 'abbrev>(
&'me self,
abbreviations: &'abbrev Abbreviations,
offset: Option<UnitOffset<Offset>>
) -> Result<EntriesTree<'abbrev, 'me, R>>
pub fn entries_tree<'me, 'abbrev>( &'me self, abbreviations: &'abbrev Abbreviations, offset: Option<UnitOffset<Offset>> ) -> Result<EntriesTree<'abbrev, 'me, R>>
Navigate this unit’s DebuggingInformationEntry
s as a tree
starting at the given offset.
sourcepub fn entries_raw<'me, 'abbrev>(
&'me self,
abbreviations: &'abbrev Abbreviations,
offset: Option<UnitOffset<Offset>>
) -> Result<EntriesRaw<'abbrev, 'me, R>>
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.
sourcepub fn abbreviations(
&self,
debug_abbrev: &DebugAbbrev<R>
) -> Result<Abbreviations>
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,
impl<R, Offset> Clone for UnitHeader<R, Offset>where R: Reader<Offset = Offset> + Clone, Offset: ReaderOffset + Clone,
source§fn clone(&self) -> UnitHeader<R, Offset>
fn clone(&self) -> UnitHeader<R, Offset>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<R, Offset> Debug for UnitHeader<R, Offset>where
R: Reader<Offset = Offset> + Debug,
Offset: ReaderOffset + Debug,
impl<R, Offset> Debug for UnitHeader<R, Offset>where R: Reader<Offset = Offset> + Debug, Offset: ReaderOffset + Debug,
source§impl<R, Offset> PartialEq<UnitHeader<R, Offset>> for UnitHeader<R, Offset>where
R: Reader<Offset = Offset> + PartialEq,
Offset: ReaderOffset + PartialEq,
impl<R, Offset> PartialEq<UnitHeader<R, Offset>> for UnitHeader<R, Offset>where R: Reader<Offset = Offset> + PartialEq, Offset: ReaderOffset + PartialEq,
source§fn eq(&self, other: &UnitHeader<R, Offset>) -> bool
fn eq(&self, other: &UnitHeader<R, Offset>) -> bool
self
and other
values to be equal, and is used
by ==
.