Struct gimli::StateMachine
[−]
[src]
pub struct StateMachine<'input, Program, Endian> where Program: LineNumberProgram<'input, Endian>,
Endian: Endianity { /* fields omitted */ }
Executes a LineNumberProgram
to recreate the matrix mapping to and from
instructions to source locations.
"The hypothetical machine used by a consumer of the line number information to expand the byte-coded instruction stream into a matrix of line number information." -- Section 6.2.1
Methods
impl<'input, Program, Endian> StateMachine<'input, Program, Endian> where Program: LineNumberProgram<'input, Endian>,
Endian: Endianity
[src]
Endian: Endianity
fn header(&self) -> &LineNumberProgramHeader<'input, Endian>
Get a reference to the header for this state machine's line number program.
fn next_row(&mut self)
-> Result<Option<(&LineNumberProgramHeader<'input, Endian>, &LineNumberRow)>>
-> Result<Option<(&LineNumberProgramHeader<'input, Endian>, &LineNumberRow)>>
Parse and execute the next opcodes in the line number program until another row in the line number matrix is computed.
The freshly computed row is returned as Ok(Some((header, row)))
.
If the matrix is complete, and there are no more new rows in the line
number matrix, then Ok(None)
is returned. If there was an error parsing
an opcode, then Err(e)
is returned.
Unfortunately, the references mean that this cannot be a
FallibleIterator
.
fn run_to_address(&mut self,
addr: &u64)
-> Result<Option<(&LineNumberProgramHeader<'input, Endian>, &LineNumberRow)>>
addr: &u64)
-> Result<Option<(&LineNumberProgramHeader<'input, Endian>, &LineNumberRow)>>
Parse and execute opcodes until we reach a row matching addr
, the end of the program,
or an error.
Trait Implementations
impl<'input, Program: Debug, Endian: Debug> Debug for StateMachine<'input, Program, Endian> where Program: LineNumberProgram<'input, Endian>,
Endian: Endianity
[src]
Endian: Endianity
impl<'input, Program: Clone, Endian: Clone> Clone for StateMachine<'input, Program, Endian> where Program: LineNumberProgram<'input, Endian>,
Endian: Endianity
[src]
Endian: Endianity
fn clone(&self) -> StateMachine<'input, Program, Endian>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more