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
sourceimpl<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
.
sourceimpl<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
sourceimpl<R: Clone, Offset: Clone> Clone for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R: Clone, Offset: Clone> Clone for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
sourcefn clone(&self) -> UnitHeader<R, Offset>
fn clone(&self) -> UnitHeader<R, Offset>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<R: Debug, Offset: Debug> Debug for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R: Debug, Offset: Debug> Debug for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
sourceimpl<R: PartialEq, Offset: PartialEq> PartialEq<UnitHeader<R, Offset>> for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R: PartialEq, Offset: PartialEq> PartialEq<UnitHeader<R, Offset>> for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
sourcefn eq(&self, other: &UnitHeader<R, Offset>) -> bool
fn eq(&self, other: &UnitHeader<R, Offset>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UnitHeader<R, Offset>) -> bool
fn ne(&self, other: &UnitHeader<R, Offset>) -> bool
This method tests for !=
.
impl<R: Copy, Offset: Copy> Copy for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R: Eq, Offset: Eq> Eq for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralEq for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for UnitHeader<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more