EvaluatorValue

Enum EvaluatorValue 

Source
pub enum EvaluatorValue<R: Reader<Offset = usize>> {
Show 14 variants Value(BaseTypeValue, ValueInformation), PointerTypeValue(Box<PointerTypeValue<R>>), VariantValue(Box<VariantValue<R>>), VariantPartValue(Box<VariantPartValue<R>>), SubrangeTypeValue(SubrangeTypeValue), Bytes(R), Array(Box<ArrayTypeValue<R>>), Struct(Box<StructureTypeValue<R>>), Enum(Box<EnumerationTypeValue<R>>), Union(Box<UnionTypeValue<R>>), Member(Box<MemberValue<R>>), OptimizedOut, LocationOutOfRange, ZeroSize,
}
Expand description

Describes all the different Rust types values in the form of a tree structure.

Variants§

§

Value(BaseTypeValue, ValueInformation)

A base_type type and value with location information.

§

PointerTypeValue(Box<PointerTypeValue<R>>)

A pointer_type type and value.

§

VariantValue(Box<VariantValue<R>>)

A variant type and value.

§

VariantPartValue(Box<VariantPartValue<R>>)

A variant_part type and value.

§

SubrangeTypeValue(SubrangeTypeValue)

A subrange_type type and value.

§

Bytes(R)

gimli-rs bytes value.

§

Array(Box<ArrayTypeValue<R>>)

A array type value.

§

Struct(Box<StructureTypeValue<R>>)

A struct type value.

§

Enum(Box<EnumerationTypeValue<R>>)

A enum type value.

§

Union(Box<UnionTypeValue<R>>)

A union type value.

§

Member(Box<MemberValue<R>>)

A attribute type value.

§

OptimizedOut

The value is optimized away.

§

LocationOutOfRange

The variable has no location currently but had or will have one. Note that the location can be a constant stored in the DWARF stack.

§

ZeroSize

The value is size 0 bits.

Implementations§

Source§

impl<R: Reader<Offset = usize>> EvaluatorValue<R>

Source

pub fn to_value(self) -> Option<BaseTypeValue>

Will return this value as a BaseTypeValue struct if possible.

Source

pub fn get_type(&self) -> String

Will return the type of this value as a String.

Source

pub fn get_variable_information(self) -> Vec<ValueInformation>

Will return a Vec of location and unparsed value infromation about the value.

Source

pub fn evaluate_variable_with_type<M: MemoryAccess>( dwarf: &Dwarf<R>, registers: &Registers, mem: &mut M, pieces: &[Piece<R>], unit_offset: UnitSectionOffset, die_offset: UnitOffset, ) -> Result<EvaluatorValue<R>>

Evaluate a list of Pieces into a value and parse it to the given type.

Description:

  • dwarf - A reference to gimli-rs Dwarf struct.
  • registers - A register struct for accessing the register values.
  • mem - A struct for accessing the memory of the debug target.
  • pieces - A list of gimli-rs pieces containing the location information..
  • unit_offset - A offset to the Unit which contains the given type DIE.
  • die_offset - A offset to the DIE that contains the type of the value.

This function will use the location information in the pieces parameter to read the values and parse it to the given type.

Source

pub fn evaluate_variable<M: MemoryAccess>( registers: &Registers, mem: &mut M, pieces: &[Piece<R>], ) -> Result<EvaluatorValue<R>>

This function will evaluate the given pieces into a unsigned 32 bit integer.

Description:

  • registers - A register struct for accessing the register values.
  • mem - A struct for accessing the memory of the debug target.
  • pieces - A list of gimli-rs pieces containing the location information..

Trait Implementations§

Source§

impl<R: Clone + Reader<Offset = usize>> Clone for EvaluatorValue<R>

Source§

fn clone(&self) -> EvaluatorValue<R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug + Reader<Offset = usize>> Debug for EvaluatorValue<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Reader<Offset = usize>> Display for EvaluatorValue<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for EvaluatorValue<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for EvaluatorValue<R>
where R: RefUnwindSafe,

§

impl<R> Send for EvaluatorValue<R>
where R: Send,

§

impl<R> Sync for EvaluatorValue<R>
where R: Sync,

§

impl<R> Unpin for EvaluatorValue<R>
where R: Unpin,

§

impl<R> UnwindSafe for EvaluatorValue<R>
where R: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.