Struct gimli::write::Expression[][src]

pub struct Expression { /* fields omitted */ }

The bytecode for a DWARF expression or location description.

Implementations

impl Expression[src]

pub fn from<R: Reader<Offset = usize>>(
    from_expression: Expression<R>,
    encoding: Encoding,
    dwarf: Option<&Dwarf<R>>,
    unit: Option<&Unit<R>>,
    entry_ids: Option<&HashMap<UnitSectionOffset, (UnitId, UnitEntryId)>>,
    convert_address: &dyn Fn(u64) -> Option<Address>
) -> ConvertResult<Expression>
[src]

Create an expression from the input expression.

impl Expression[src]

pub fn new() -> Self[src]

Create an empty expression.

pub fn raw(bytecode: Vec<u8>) -> Self[src]

Create an expression from raw bytecode.

This does not support operations that require references, such as DW_OP_addr.

pub fn op(&mut self, opcode: DwOp)[src]

Add an operation to the expression.

This should only be used for operations that have no explicit operands.

pub fn op_addr(&mut self, address: Address)[src]

Add a DW_OP_addr operation to the expression.

pub fn op_constu(&mut self, value: u64)[src]

Add a DW_OP_constu operation to the expression.

This may be emitted as a smaller equivalent operation.

pub fn op_consts(&mut self, value: i64)[src]

Add a DW_OP_consts operation to the expression.

This may be emitted as a smaller equivalent operation.

pub fn op_const_type(&mut self, base: UnitEntryId, value: Box<[u8]>)[src]

Add a DW_OP_const_type or DW_OP_GNU_const_type operation to the expression.

pub fn op_fbreg(&mut self, offset: i64)[src]

Add a DW_OP_fbreg operation to the expression.

pub fn op_breg(&mut self, register: Register, offset: i64)[src]

Add a DW_OP_bregx operation to the expression.

This may be emitted as a smaller equivalent operation.

pub fn op_regval_type(&mut self, register: Register, base: UnitEntryId)[src]

Add a DW_OP_regval_type or DW_OP_GNU_regval_type operation to the expression.

This may be emitted as a smaller equivalent operation.

pub fn op_pick(&mut self, index: u8)[src]

Add a DW_OP_pick operation to the expression.

This may be emitted as a DW_OP_dup or DW_OP_over operation.

pub fn op_deref(&mut self)[src]

Add a DW_OP_deref operation to the expression.

pub fn op_xderef(&mut self)[src]

Add a DW_OP_xderef operation to the expression.

pub fn op_deref_size(&mut self, size: u8)[src]

Add a DW_OP_deref_size operation to the expression.

pub fn op_xderef_size(&mut self, size: u8)[src]

Add a DW_OP_xderef_size operation to the expression.

pub fn op_deref_type(&mut self, size: u8, base: UnitEntryId)[src]

Add a DW_OP_deref_type or DW_OP_GNU_deref_type operation to the expression.

pub fn op_xderef_type(&mut self, size: u8, base: UnitEntryId)[src]

Add a DW_OP_xderef_type operation to the expression.

pub fn op_plus_uconst(&mut self, value: u64)[src]

Add a DW_OP_plus_uconst operation to the expression.

pub fn op_skip(&mut self) -> usize[src]

Add a DW_OP_skip operation to the expression.

Returns the index of the operation. The caller must call set_target with this index to set the target of the branch.

pub fn op_bra(&mut self) -> usize[src]

Add a DW_OP_bra operation to the expression.

Returns the index of the operation. The caller must call set_target with this index to set the target of the branch.

pub fn next_index(&self) -> usize[src]

Return the index that will be assigned to the next operation.

This can be passed to set_target.

pub fn set_target(&mut self, operation: usize, new_target: usize)[src]

Set the target of a DW_OP_skip or DW_OP_bra operation .

pub fn op_call(&mut self, entry: UnitEntryId)[src]

Add a DW_OP_call4 operation to the expression.

pub fn op_call_ref(&mut self, entry: Reference)[src]

Add a DW_OP_call_ref operation to the expression.

pub fn op_convert(&mut self, base: Option<UnitEntryId>)[src]

Add a DW_OP_convert or DW_OP_GNU_convert operation to the expression.

base is the DIE of the base type, or None for the generic type.

pub fn op_reinterpret(&mut self, base: Option<UnitEntryId>)[src]

Add a DW_OP_reinterpret or DW_OP_GNU_reinterpret operation to the expression.

base is the DIE of the base type, or None for the generic type.

pub fn op_entry_value(&mut self, expression: Expression)[src]

Add a DW_OP_entry_value or DW_OP_GNU_entry_value operation to the expression.

pub fn op_reg(&mut self, register: Register)[src]

Add a DW_OP_regx operation to the expression.

This may be emitted as a smaller equivalent operation.

pub fn op_implicit_value(&mut self, data: Box<[u8]>)[src]

Add a DW_OP_implicit_value operation to the expression.

pub fn op_implicit_pointer(&mut self, entry: Reference, byte_offset: i64)[src]

Add a DW_OP_implicit_pointer or DW_OP_GNU_implicit_pointer operation to the expression.

pub fn op_piece(&mut self, size_in_bytes: u64)[src]

Add a DW_OP_piece operation to the expression.

pub fn op_bit_piece(&mut self, size_in_bits: u64, bit_offset: u64)[src]

Add a DW_OP_bit_piece operation to the expression.

pub fn op_gnu_parameter_ref(&mut self, entry: UnitEntryId)[src]

Add a DW_OP_GNU_parameter_ref operation to the expression.

Trait Implementations

impl Clone for Expression[src]

impl Debug for Expression[src]

impl Default for Expression[src]

impl Eq for Expression[src]

impl Hash for Expression[src]

impl PartialEq<Expression> for Expression[src]

impl StructuralEq for Expression[src]

impl StructuralPartialEq for Expression[src]

Auto Trait Implementations

impl RefUnwindSafe for Expression

impl Send for Expression

impl Sync for Expression

impl Unpin for Expression

impl UnwindSafe for Expression

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.