Struct gimli::read::RangeLists
source · [−]pub struct RangeLists<R> { /* private fields */ }
Expand description
The DWARF data found in .debug_ranges
and .debug_rnglists
sections.
Implementations
sourceimpl<R> RangeLists<R>
impl<R> RangeLists<R>
sourcepub fn new(
debug_ranges: DebugRanges<R>,
debug_rnglists: DebugRngLists<R>
) -> RangeLists<R>
pub fn new(
debug_ranges: DebugRanges<R>,
debug_rnglists: DebugRngLists<R>
) -> RangeLists<R>
Construct a new RangeLists
instance from the data in the .debug_ranges
and
.debug_rnglists
sections.
sourcepub fn debug_ranges(&self) -> &DebugRanges<R>
pub fn debug_ranges(&self) -> &DebugRanges<R>
Return the .debug_ranges
section.
sourcepub fn set_debug_ranges(&mut self, debug_ranges: DebugRanges<R>)
pub fn set_debug_ranges(&mut self, debug_ranges: DebugRanges<R>)
Replace the .debug_ranges
section.
This is useful for .dwo
files when using the GNU split-dwarf extension to DWARF 4.
sourcepub fn debug_rnglists(&self) -> &DebugRngLists<R>
pub fn debug_rnglists(&self) -> &DebugRngLists<R>
Return the .debug_rnglists
section.
sourceimpl<T> RangeLists<T>
impl<T> RangeLists<T>
sourcepub fn borrow<'a, F, R>(&'a self, borrow: F) -> RangeLists<R> where
F: FnMut(&'a T) -> R,
pub fn borrow<'a, F, R>(&'a self, borrow: F) -> RangeLists<R> where
F: FnMut(&'a T) -> R,
Create a RangeLists
that references the data in self
.
This is useful when R
implements Reader
but T
does not.
Example Usage
// Read the DWARF section into a `Vec` with whatever object loader you're using.
let owned_section: gimli::RangeLists<Vec<u8>> = load_section();
// Create a reference to the DWARF section.
let section = owned_section.borrow(|section| {
gimli::EndianSlice::new(§ion, gimli::LittleEndian)
});
sourceimpl<R: Reader> RangeLists<R>
impl<R: Reader> RangeLists<R>
sourcepub fn ranges(
&self,
offset: RangeListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<RngListIter<R>>
pub fn ranges(
&self,
offset: RangeListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<RngListIter<R>>
Iterate over the Range
list entries starting at the given offset.
The unit_version
and address_size
must match the compilation unit that the
offset was contained in.
The base_address
should be obtained from the DW_AT_low_pc
attribute in the
DW_TAG_compile_unit
entry for the compilation unit that contains this range list.
Can be used with
FallibleIterator
.
sourcepub fn raw_ranges(
&self,
offset: RangeListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawRngListIter<R>>
pub fn raw_ranges(
&self,
offset: RangeListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawRngListIter<R>>
Iterate over the RawRngListEntry
ies starting at the given offset.
The unit_encoding
must match the compilation unit that the
offset was contained in.
This iterator does not perform any processing of the range entries, such as handling base addresses.
Can be used with
FallibleIterator
.
sourcepub fn get_offset(
&self,
unit_encoding: Encoding,
base: DebugRngListsBase<R::Offset>,
index: DebugRngListsIndex<R::Offset>
) -> Result<RangeListsOffset<R::Offset>>
pub fn get_offset(
&self,
unit_encoding: Encoding,
base: DebugRngListsBase<R::Offset>,
index: DebugRngListsIndex<R::Offset>
) -> Result<RangeListsOffset<R::Offset>>
Returns the .debug_rnglists
offset at the given base
and index
.
The base
must be the DW_AT_rnglists_base
value from the compilation unit DIE.
This is an offset that points to the first entry following the header.
The index
is the value of a DW_FORM_rnglistx
attribute.
The unit_encoding
must match the compilation unit that the
index was contained in.
sourcepub fn lookup_offset_id(
&self,
id: ReaderOffsetId
) -> Option<(SectionId, R::Offset)>
pub fn lookup_offset_id(
&self,
id: ReaderOffsetId
) -> Option<(SectionId, R::Offset)>
Call Reader::lookup_offset_id
for each section, and return the first match.
Trait Implementations
sourceimpl<R: Clone> Clone for RangeLists<R>
impl<R: Clone> Clone for RangeLists<R>
sourcefn clone(&self) -> RangeLists<R>
fn clone(&self) -> RangeLists<R>
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> Debug for RangeLists<R>
impl<R: Debug> Debug for RangeLists<R>
sourceimpl<R: Default> Default for RangeLists<R>
impl<R: Default> Default for RangeLists<R>
sourcefn default() -> RangeLists<R>
fn default() -> RangeLists<R>
Returns the “default value” for a type. Read more
impl<R: Copy> Copy for RangeLists<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for RangeLists<R> where
R: RefUnwindSafe,
impl<R> Send for RangeLists<R> where
R: Send,
impl<R> Sync for RangeLists<R> where
R: Sync,
impl<R> Unpin for RangeLists<R> where
R: Unpin,
impl<R> UnwindSafe for RangeLists<R> where
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<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