Enum gimli::Operation [−][src]
pub enum Operation<R, Offset = usize> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, { Deref { base_type: UnitOffset<Offset>, size: u8, space: bool, }, Drop, Pick { index: u8, }, Swap, Rot, Abs, And, Div, Minus, Mod, Mul, Neg, Not, Or, Plus, PlusConstant { value: u64, }, Shl, Shr, Shra, Xor, Bra { target: R, }, Eq, Ge, Gt, Le, Lt, Ne, Skip { target: R, }, Literal { value: u64, }, Register { register: u64, }, RegisterOffset { register: u64, offset: i64, base_type: UnitOffset<Offset>, }, FrameOffset { offset: i64, }, Nop, PushObjectAddress, Call { offset: DieReference<Offset>, }, TLS, CallFrameCFA, Piece { size_in_bits: u64, bit_offset: Option<u64>, }, ImplicitValue { data: R, }, StackValue, ImplicitPointer { value: DebugInfoOffset<Offset>, byte_offset: i64, }, EntryValue { expression: R, }, ParameterRef { offset: UnitOffset<Offset>, }, TextRelativeOffset { offset: u64, }, TypedLiteral { base_type: UnitOffset<Offset>, value: R, }, Convert { base_type: UnitOffset<Offset>, }, Reinterpret { base_type: UnitOffset<Offset>, }, }
A single decoded DWARF expression operation.
DWARF expression evaluation is done in two parts: first the raw bytes of the next part of the expression are decoded; and then the decoded operation is evaluated. This approach lets other consumers inspect the DWARF expression without reimplementing the decoding operation.
Multiple DWARF opcodes may decode into a single Operation. For
example, both DW_OP_deref and DW_OP_xderef are represented
using Operation::Deref.
Variants
DerefA dereference operation.
Fields of Deref
base_type: UnitOffset<Offset> | The DIE of the base type or 0 to indicate the generic type |
size: u8 | The size of the data to dereference. |
space: bool | True if the dereference operation takes an address space argument; false otherwise. |
DropDrop an item from the stack.
PickPick an item from the stack and push it on top of the stack.
This operation handles DW_OP_pick, DW_OP_dup, and
DW_OP_over.
Fields of Pick
index: u8 | The index, from the top of the stack, of the item to copy. |
SwapSwap the top two stack items.
RotRotate the top three stack items.
AbsTake the absolute value of the top of the stack.
AndBitwise and of the top two values on the stack.
DivDivide the top two values on the stack.
MinusSubtract the top two values on the stack.
ModModulus of the top two values on the stack.
MulMultiply the top two values on the stack.
NegNegate the top of the stack.
NotBitwise not of the top of the stack.
OrBitwise or of the top two values on the stack.
PlusAdd the top two values on the stack.
PlusConstantAdd a constant to the topmost value on the stack.
Fields of PlusConstant
value: u64 | The value to add. |
ShlLogical left shift of the 2nd value on the stack by the number of bits given by the topmost value on the stack.
ShrRight shift of the 2nd value on the stack by the number of bits given by the topmost value on the stack.
ShraArithmetic left shift of the 2nd value on the stack by the number of bits given by the topmost value on the stack.
XorBitwise xor of the top two values on the stack.
BraBranch to the target location if the top of stack is nonzero.
Fields of Bra
target: R | The target bytecode. |
EqCompare the top two stack values for equality.
GeCompare the top two stack values using >=.
GtCompare the top two stack values using >.
LeCompare the top two stack values using <=.
LtCompare the top two stack values using <.
NeCompare the top two stack values using !=.
SkipUnconditional branch to the target location.
Fields of Skip
target: R | The target bytecode. |
LiteralPush a constant value on the stack. This handles multiple DWARF opcodes.
Fields of Literal
value: u64 | The value to push. |
RegisterIndicate that this piece's location is in the given register.
Fields of Register
register: u64 | The register number. |
RegisterOffsetFind the value of the given register, add the offset, and then push the resulting sum on the stack.
Fields of RegisterOffset
register: u64 | The register number. |
offset: i64 | The offset to add. |
base_type: UnitOffset<Offset> | The DIE of the base type or 0 to indicate the generic type |
FrameOffsetCompute the frame base (using DW_AT_frame_base), add the
given offset, and then push the resulting sum on the stack.
Fields of FrameOffset
offset: i64 | The offset to add. |
NopNo operation.
PushObjectAddressPush the object address on the stack.
CallEvaluate a DWARF expression as a subroutine. The expression
comes from the DW_AT_location attribute of the indicated
DIE.
Fields of Call
offset: DieReference<Offset> | The DIE to use. |
TLSCompute the address of a thread-local variable and push it on the stack.
CallFrameCFACompute the call frame CFA and push it on the stack.
PieceTerminate a piece.
Fields of Piece
size_in_bits: u64 | The size of this piece in bits. |
bit_offset: Option<u64> | The bit offset of this piece. If |
ImplicitValueRepresents DW_OP_implicit_value.
Fields of ImplicitValue
data: R | The implicit value to use. |
StackValueRepresents DW_OP_stack_value.
ImplicitPointerRepresents DW_OP_implicit_pointer. The object is a pointer to
a value which has no actual location, such as an implicit value or
a stack value.
Fields of ImplicitPointer
value: DebugInfoOffset<Offset> | The |
byte_offset: i64 | The byte offset into the value that the implicit pointer points to. |
EntryValueRepresents DW_OP_entry_value. Evaluate an expression at the entry to
the current subprogram, and push it on the stack.
Fields of EntryValue
expression: R | The expression to be evaluated. |
ParameterRefRepresents DW_OP_GNU_parameter_ref. This represents a parameter that was
optimized out. The offset points to the definition of the parameter, and is
matched to the DW_TAG_GNU_call_site_parameter in the caller that also
points to the same definition of the parameter.
Fields of ParameterRef
offset: UnitOffset<Offset> | The DIE to use. |
TextRelativeOffsetAn offset relative to the base of the .text section of the binary.
e.g. for DW_OP_addr.
Fields of TextRelativeOffset
offset: u64 | The offfset to add. |
TypedLiteralRepresents DW_OP_const_type.
Fields of TypedLiteral
base_type: UnitOffset<Offset> | The DIE of the base type |
value: R | The value |
ConvertRepresents DW_OP_convert
Fields of Convert
base_type: UnitOffset<Offset> | The DIE of the base type |
ReinterpretRepresents DW_OP_reinterpret
Fields of Reinterpret
base_type: UnitOffset<Offset> | The DIE of the base type |
Methods
impl<R, Offset> Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R, Offset> Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, pub fn parse(
bytes: &mut R,
bytecode: &R,
address_size: u8,
format: Format
) -> Result<Operation<R, Offset>>[src]
pub fn parse(
bytes: &mut R,
bytecode: &R,
address_size: u8,
format: Format
) -> Result<Operation<R, Offset>>Parse a single DWARF expression operation.
This is useful when examining a DWARF expression for reasons other than direct evaluation.
bytes points to a the operation to decode. It should point into
the same array as bytecode, which should be the entire
expression.
Trait Implementations
impl<R: Debug, Offset: Debug> Debug for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R: Debug, Offset: Debug> Debug for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<R: Clone, Offset: Clone> Clone for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R: Clone, Offset: Clone> Clone for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, fn clone(&self) -> Operation<R, Offset>[src]
fn clone(&self) -> Operation<R, Offset>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<R: Copy, Offset: Copy> Copy for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R: Copy, Offset: Copy> Copy for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, impl<R: PartialEq, Offset: PartialEq> PartialEq for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R: PartialEq, Offset: PartialEq> PartialEq for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, fn eq(&self, other: &Operation<R, Offset>) -> bool[src]
fn eq(&self, other: &Operation<R, Offset>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Operation<R, Offset>) -> bool[src]
fn ne(&self, other: &Operation<R, Offset>) -> boolThis method tests for !=.
impl<R: Eq, Offset: Eq> Eq for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset, [src]
impl<R: Eq, Offset: Eq> Eq for Operation<R, Offset> where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,