pub trait Debugger: Send + Debug {
// Provided methods
fn activate(&mut self) { ... }
fn deactivate(&mut self) { ... }
fn enter_block(&mut self, engine_state: &EngineState, block: &Block) { ... }
fn leave_block(&mut self, engine_state: &EngineState, block: &Block) { ... }
fn enter_element(
&mut self,
engine_state: &EngineState,
pipeline_element: &PipelineElement,
) { ... }
fn leave_element(
&mut self,
engine_state: &EngineState,
element: &PipelineElement,
result: &Result<PipelineData, ShellError>,
) { ... }
fn enter_instruction(
&mut self,
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
) { ... }
fn leave_instruction(
&mut self,
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
error: Option<&ShellError>,
) { ... }
fn report(
&self,
engine_state: &EngineState,
debugger_span: Span,
) -> Result<Value, ShellError> { ... }
}
Expand description
Debugger trait that every debugger needs to implement.
By default, its methods are empty. Not every Debugger needs to implement all of them.
Provided Methods§
Sourcefn activate(&mut self)
fn activate(&mut self)
Called by EngineState::activate_debugger().
Intended for initializing the debugger.
Sourcefn deactivate(&mut self)
fn deactivate(&mut self)
Called by EngineState::deactivate_debugger().
Intended for wrapping up the debugger after a debugging session before returning back to normal evaluation without debugging.
Sourcefn enter_block(&mut self, engine_state: &EngineState, block: &Block)
fn enter_block(&mut self, engine_state: &EngineState, block: &Block)
Called when the evaluator enters a block
Sourcefn leave_block(&mut self, engine_state: &EngineState, block: &Block)
fn leave_block(&mut self, engine_state: &EngineState, block: &Block)
Called when the evaluator leaves a block
Sourcefn enter_element(
&mut self,
engine_state: &EngineState,
pipeline_element: &PipelineElement,
)
fn enter_element( &mut self, engine_state: &EngineState, pipeline_element: &PipelineElement, )
Called when the AST evaluator enters a pipeline element
Sourcefn leave_element(
&mut self,
engine_state: &EngineState,
element: &PipelineElement,
result: &Result<PipelineData, ShellError>,
)
fn leave_element( &mut self, engine_state: &EngineState, element: &PipelineElement, result: &Result<PipelineData, ShellError>, )
Called when the AST evaluator leaves a pipeline element
Sourcefn enter_instruction(
&mut self,
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
)
fn enter_instruction( &mut self, engine_state: &EngineState, ir_block: &IrBlock, instruction_index: usize, registers: &[PipelineData], )
Called before the IR evaluator runs an instruction
Sourcefn leave_instruction(
&mut self,
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
error: Option<&ShellError>,
)
fn leave_instruction( &mut self, engine_state: &EngineState, ir_block: &IrBlock, instruction_index: usize, registers: &[PipelineData], error: Option<&ShellError>, )
Called after the IR evaluator runs an instruction
Sourcefn report(
&self,
engine_state: &EngineState,
debugger_span: Span,
) -> Result<Value, ShellError>
fn report( &self, engine_state: &EngineState, debugger_span: Span, ) -> Result<Value, ShellError>
Create a final report as a Value
Intended to be called after deactivate()