Enum addr2line::LookupResult

source ·
pub enum LookupResult<L: LookupContinuation> {
    Load {
        load: SplitDwarfLoad<<L as LookupContinuation>::Buf>,
        continuation: L,
    },
    Output(<L as LookupContinuation>::Output),
}
Expand description

Operations that consult debug information may require additional files to be loaded if split DWARF is being used. This enum returns the result of the operation in the Break variant, or information about the split DWARF that is required and a continuation to invoke once it is available in the Continue variant.

This enum is intended to be used in a loop like so:

  const ADDRESS: u64 = 0xdeadbeef;
  let mut r = ctx.find_frames(ADDRESS);
  let result = loop {
    match r {
      LookupResult::Output(result) => break result,
      LookupResult::Load { load, continuation } => {
        let dwo = do_split_dwarf_load(load);
        r = continuation.resume(dwo);
      }
    }
  };

Variants§

§

Load

The lookup requires split DWARF data to be loaded.

Fields

§load: SplitDwarfLoad<<L as LookupContinuation>::Buf>

The information needed to find the split DWARF data.

§continuation: L

The continuation to resume with the loaded split DWARF data.

§

Output(<L as LookupContinuation>::Output)

The lookup has completed and produced an output.

Implementations§

source§

impl<L: LookupContinuation> LookupResult<L>

source

pub fn skip_all_loads(self) -> L::Output

Callers that do not handle split DWARF can call skip_all_loads to fast-forward to the end result. This result is produced with the data that is available and may be less accurate than the the results that would be produced if the caller did properly support split DWARF.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.