Struct gimli::Evaluation
[−]
[src]
pub struct Evaluation<'context, 'input, Endian, Context> where Endian: 'context + Endianity,
Context: 'context + EvaluationContext<'input>,
'input: 'context { /* fields omitted */ }
A DWARF expression evaluator.
Methods
impl<'context, 'input, Endian, Context> Evaluation<'context, 'input, Endian, Context> where Endian: 'context + Endianity,
Context: EvaluationContext<'input>,
'input: 'context
[src]
Context: EvaluationContext<'input>,
'input: 'context
fn new(bytecode: &'input [u8],
address_size: u8,
format: Format,
callbacks: &'context mut Context)
-> Evaluation<'context, 'input, Endian, Context>
address_size: u8,
format: Format,
callbacks: &'context mut Context)
-> Evaluation<'context, 'input, Endian, Context>
Create a new DWARF expression evaluator.
The new evaluator is created without an initial value, without an object address, and without a maximum number of iterations.
fn set_initial_value(&mut self, value: u64)
Set an initial value to be pushed on the DWARF expression
evaluator's stack. This can be used in cases like
DW_AT_vtable_elem_location
, which require a value on the
stack before evaluation commences. If no initial value is
set, and the expression uses an opcode requiring the initial
value, then evaluation will fail with an error.
fn set_object_address(&mut self, value: u64)
Set the enclosing object's address, as used by
DW_OP_push_object_address
. If no object address is set, and
the expression uses an opcode requiring the object address,
then evaluation will fail with an error.
fn set_max_iterations(&mut self, value: u32)
Set the maximum number of iterations to be allowed by the expression evaluator.
An iteration corresponds approximately to the evaluation of a single operation in an expression ("approximately" because the implementation may allow two such operations in some cases). The default is not to have a maximum; once set, it's not possible to go back to this default state. This value can be set to avoid denial of service attacks by bad DWARF bytecode.
fn evaluate(&mut self) -> Result<Vec<Piece<'input>>, Context::ContextError> where Endian: Endianity
Evaluate a DWARF expression. If successful, the result will hold a vector of pieces, each describing a part of the final object.
Trait Implementations
impl<'context, 'input, Endian: Debug, Context: Debug> Debug for Evaluation<'context, 'input, Endian, Context> where Endian: 'context + Endianity,
Context: 'context + EvaluationContext<'input>,
'input: 'context
[src]
Context: 'context + EvaluationContext<'input>,
'input: 'context