Struct gimli::read::LocationLists
source · [−]pub struct LocationLists<R> { /* private fields */ }
Expand description
The DWARF data found in .debug_loc
and .debug_loclists
sections.
Implementations
sourceimpl<R> LocationLists<R>
impl<R> LocationLists<R>
sourcepub fn new(
debug_loc: DebugLoc<R>,
debug_loclists: DebugLocLists<R>
) -> LocationLists<R>
pub fn new(
debug_loc: DebugLoc<R>,
debug_loclists: DebugLocLists<R>
) -> LocationLists<R>
Construct a new LocationLists
instance from the data in the .debug_loc
and
.debug_loclists
sections.
sourceimpl<T> LocationLists<T>
impl<T> LocationLists<T>
sourcepub fn borrow<'a, F, R>(&'a self, borrow: F) -> LocationLists<R> where
F: FnMut(&'a T) -> R,
pub fn borrow<'a, F, R>(&'a self, borrow: F) -> LocationLists<R> where
F: FnMut(&'a T) -> R,
Create a LocationLists
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::LocationLists<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> LocationLists<R>
impl<R: Reader> LocationLists<R>
sourcepub fn locations(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<LocListIter<R>>
pub fn locations(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<LocListIter<R>>
Iterate over the LocationListEntry
s starting at the given offset.
The unit_encoding
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 location
list.
Can be used with
FallibleIterator
.
sourcepub fn locations_dwo(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<LocListIter<R>>
pub fn locations_dwo(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<R::Offset>
) -> Result<LocListIter<R>>
Similar to locations
, but with special handling for .dwo files.
This should only been used when this LocationLists
was loaded from a
.dwo file.
sourcepub fn raw_locations(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawLocListIter<R>>
pub fn raw_locations(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawLocListIter<R>>
Iterate over the raw LocationListEntry
s 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 location entries, such as handling base addresses.
Can be used with
FallibleIterator
.
sourcepub fn raw_locations_dwo(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawLocListIter<R>>
pub fn raw_locations_dwo(
&self,
offset: LocationListsOffset<R::Offset>,
unit_encoding: Encoding
) -> Result<RawLocListIter<R>>
Similar to raw_locations
, but with special handling for .dwo files.
This should only been used when this LocationLists
was loaded from a
.dwo file.
sourcepub fn get_offset(
&self,
unit_encoding: Encoding,
base: DebugLocListsBase<R::Offset>,
index: DebugLocListsIndex<R::Offset>
) -> Result<LocationListsOffset<R::Offset>>
pub fn get_offset(
&self,
unit_encoding: Encoding,
base: DebugLocListsBase<R::Offset>,
index: DebugLocListsIndex<R::Offset>
) -> Result<LocationListsOffset<R::Offset>>
Returns the .debug_loclists
offset at the given base
and index
.
The base
must be the DW_AT_loclists_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_loclistx
attribute.
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 LocationLists<R>
impl<R: Clone> Clone for LocationLists<R>
sourcefn clone(&self) -> LocationLists<R>
fn clone(&self) -> LocationLists<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 LocationLists<R>
impl<R: Debug> Debug for LocationLists<R>
sourceimpl<R: Default> Default for LocationLists<R>
impl<R: Default> Default for LocationLists<R>
sourcefn default() -> LocationLists<R>
fn default() -> LocationLists<R>
Returns the “default value” for a type. Read more
impl<R: Copy> Copy for LocationLists<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for LocationLists<R> where
R: RefUnwindSafe,
impl<R> Send for LocationLists<R> where
R: Send,
impl<R> Sync for LocationLists<R> where
R: Sync,
impl<R> Unpin for LocationLists<R> where
R: Unpin,
impl<R> UnwindSafe for LocationLists<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