[−][src]Enum gimli::read::Value
pub enum Value { Generic(u64), I8(i8), U8(u8), I16(i16), U16(u16), I32(i32), U32(u32), I64(i64), U64(u64), F32(f32), F64(f64), }
The value of an entry on the DWARF stack.
Variants
A generic value, which is address-sized and of unspecified sign.
A signed 8-bit integer value.
An unsigned 8-bit integer value.
A signed 16-bit integer value.
An unsigned 16-bit integer value.
A signed 32-bit integer value.
An unsigned 32-bit integer value.
A signed 64-bit integer value.
An unsigned 64-bit integer value.
A 32-bit floating point value.
A 64-bit floating point value.
Implementations
impl Value
[src][−]
pub fn value_type(&self) -> ValueType
[src][−]
Return the ValueType
corresponding to this Value
.
pub fn parse<R: Reader>(value_type: ValueType, bytes: R) -> Result<Value>
[src][−]
Read a Value
with the given value_type
from a Reader
.
pub fn to_u64(self, addr_mask: u64) -> Result<u64>
[src][−]
Convert a Value
to a u64
.
The ValueType
of self
must be integral.
Values are sign extended if the source value is signed.
pub fn from_u64(value_type: ValueType, value: u64) -> Result<Value>
[src][−]
Create a Value
with the given value_type
from a u64
value.
The value_type
may be integral or floating point.
The result is truncated if the u64
value does
not fit the bounds of the value_type
.
pub fn convert(self, value_type: ValueType, addr_mask: u64) -> Result<Value>
[src][−]
Convert a Value
to the given value_type
.
When converting between integral types, the result is truncated
if the source value does not fit the bounds of the value_type
.
When converting from floating point types, the result is not defined
if the source value does not fit the bounds of the value_type
.
This corresponds to the DWARF DW_OP_convert
operation.
pub fn reinterpret(self, value_type: ValueType, addr_mask: u64) -> Result<Value>
[src][−]
Reinterpret the bits in a Value
as the given value_type
.
The source and result value types must have equal sizes.
This corresponds to the DWARF DW_OP_reinterpret
operation.
pub fn abs(self, addr_mask: u64) -> Result<Value>
[src][−]
Perform an absolute value operation.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_abs
operation.
pub fn neg(self, addr_mask: u64) -> Result<Value>
[src][−]
Perform a negation operation.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_neg
operation.
pub fn add(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform an addition operation.
This operation requires matching types.
This corresponds to the DWARF DW_OP_plus
operation.
pub fn sub(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a subtraction operation.
This operation requires matching types.
This corresponds to the DWARF DW_OP_minus
operation.
pub fn mul(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a multiplication operation.
This operation requires matching types.
This corresponds to the DWARF DW_OP_mul
operation.
pub fn div(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a division operation.
This operation requires matching types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_div
operation.
pub fn rem(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a remainder operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as an unsigned value.
This corresponds to the DWARF DW_OP_mod
operation.
pub fn not(self, addr_mask: u64) -> Result<Value>
[src][−]
Perform a bitwise not operation.
This operation requires matching integral types.
This corresponds to the DWARF DW_OP_not
operation.
pub fn and(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a bitwise and operation.
This operation requires matching integral types.
This corresponds to the DWARF DW_OP_and
operation.
pub fn or(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a bitwise or operation.
This operation requires matching integral types.
This corresponds to the DWARF DW_OP_or
operation.
pub fn xor(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a bitwise exclusive-or operation.
This operation requires matching integral types.
This corresponds to the DWARF DW_OP_xor
operation.
pub fn shl(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a shift left operation.
This operation requires integral types. If the shift length exceeds the type size, then 0 is returned. If the shift length is negative then an error is returned.
This corresponds to the DWARF DW_OP_shl
operation.
pub fn shr(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform a logical shift right operation.
This operation requires an unsigned integral type for the value.
If the value type is Generic
, then it is interpreted as an unsigned value.
This operation requires an integral type for the shift length. If the shift length exceeds the type size, then 0 is returned. If the shift length is negative then an error is returned.
This corresponds to the DWARF DW_OP_shr
operation.
pub fn shra(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform an arithmetic shift right operation.
This operation requires a signed integral type for the value.
If the value type is Generic
, then it is interpreted as a signed value.
This operation requires an integral type for the shift length. If the shift length exceeds the type size, then 0 is returned for positive values, and -1 is returned for negative values. If the shift length is negative then an error is returned.
This corresponds to the DWARF DW_OP_shra
operation.
pub fn eq(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the ==
relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_eq
operation.
pub fn ge(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the >=
relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_ge
operation.
pub fn gt(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the >
relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_gt
operation.
pub fn le(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the `<= relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_le
operation.
pub fn lt(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the `< relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_lt
operation.
pub fn ne(self, rhs: Value, addr_mask: u64) -> Result<Value>
[src][−]
Perform the `!= relational operation.
This operation requires matching integral types.
If the value type is Generic
, then it is interpreted as a signed value.
This corresponds to the DWARF DW_OP_ne
operation.
Trait Implementations
impl Clone for Value
[src][+]
impl Copy for Value
[src]
impl Debug for Value
[src][+]
impl PartialEq<Value> for Value
[src][+]
impl StructuralPartialEq for Value
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,