pub struct LocationLists<R> { /* private fields */ }
Expand description
The DWARF data found in .debug_loc
and .debug_loclists
sections.
Implementations§
source§impl<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.
source§impl<T> LocationLists<T>
impl<T> LocationLists<T>
sourcepub fn borrow<'a, F, R>(&'a self, borrow: F) -> LocationLists<R>
pub fn borrow<'a, F, R>(&'a self, borrow: F) -> LocationLists<R>
Create a LocationLists
that references the data in self
.
This is useful when R
implements Reader
but T
does not.
Used by Dwarf::borrow
.
source§impl<R> LocationLists<R>where
R: Reader,
impl<R> LocationLists<R>where
R: Reader,
sourcepub fn locations(
&self,
offset: LocationListsOffset<<R as Reader>::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<<R as Reader>::Offset>,
) -> Result<LocListIter<R>, Error>
pub fn locations( &self, offset: LocationListsOffset<<R as Reader>::Offset>, unit_encoding: Encoding, base_address: u64, debug_addr: &DebugAddr<R>, debug_addr_base: DebugAddrBase<<R as Reader>::Offset>, ) -> Result<LocListIter<R>, Error>
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 as Reader>::Offset>,
unit_encoding: Encoding,
base_address: u64,
debug_addr: &DebugAddr<R>,
debug_addr_base: DebugAddrBase<<R as Reader>::Offset>,
) -> Result<LocListIter<R>, Error>
pub fn locations_dwo( &self, offset: LocationListsOffset<<R as Reader>::Offset>, unit_encoding: Encoding, base_address: u64, debug_addr: &DebugAddr<R>, debug_addr_base: DebugAddrBase<<R as Reader>::Offset>, ) -> Result<LocListIter<R>, Error>
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 as Reader>::Offset>,
unit_encoding: Encoding,
) -> Result<RawLocListIter<R>, Error>
pub fn raw_locations( &self, offset: LocationListsOffset<<R as Reader>::Offset>, unit_encoding: Encoding, ) -> Result<RawLocListIter<R>, Error>
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 as Reader>::Offset>,
unit_encoding: Encoding,
) -> Result<RawLocListIter<R>, Error>
pub fn raw_locations_dwo( &self, offset: LocationListsOffset<<R as Reader>::Offset>, unit_encoding: Encoding, ) -> Result<RawLocListIter<R>, Error>
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 as Reader>::Offset>,
index: DebugLocListsIndex<<R as Reader>::Offset>,
) -> Result<LocationListsOffset<<R as Reader>::Offset>, Error>
pub fn get_offset( &self, unit_encoding: Encoding, base: DebugLocListsBase<<R as Reader>::Offset>, index: DebugLocListsIndex<<R as Reader>::Offset>, ) -> Result<LocationListsOffset<<R as Reader>::Offset>, Error>
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 as Reader>::Offset)>
pub fn lookup_offset_id( &self, id: ReaderOffsetId, ) -> Option<(SectionId, <R as Reader>::Offset)>
Call Reader::lookup_offset_id
for each section, and return the first match.
Trait Implementations§
source§impl<R> Clone for LocationLists<R>where
R: Clone,
impl<R> Clone for LocationLists<R>where
R: Clone,
source§fn clone(&self) -> LocationLists<R>
fn clone(&self) -> LocationLists<R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<R> Debug for LocationLists<R>where
R: Debug,
impl<R> Debug for LocationLists<R>where
R: Debug,
source§impl<R> Default for LocationLists<R>where
R: Default,
impl<R> Default for LocationLists<R>where
R: Default,
source§fn default() -> LocationLists<R>
fn default() -> LocationLists<R>
impl<R> Copy for LocationLists<R>where
R: Copy,
Auto Trait Implementations§
impl<R> Freeze for LocationLists<R>where
R: Freeze,
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
source§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.