Expand description
Breakpoints and single stepping for program-image execution.
Use crate::ExecutionState<DebuggerState> as the machine’s program device
and Debugger<u32, I> as a debugger device, where I is the machine’s
runtime instruction type. Implement HasBreakpointInstruction for I.
The debugger’s authored Step builds a BreakpointMessage, executes the
debugger, and applies its Break effect to the execution state.
Call crate::Loadable::start to initialize an invocation, then
crate::Loadable::resume_with_breaks with DebugAction::Continue or
DebugAction::Step. A gutter breakpoint pauses before its displaced
instruction; continuing or stepping executes that instruction once. An
explicit breakpoint resumes at the following instruction. Ordinary
crate::Loadable::resume leaves a breakpoint-suspended invocation untouched.
Breakpoint bookkeeping belongs to the patched image. After successful image
replacement, or before reusing the machine with a different image, call
Debugger::forget_breakpoints. To remove breakpoints while keeping the old
image usable, restore its instructions with Debugger::clear_all instead.
Invocation-only resets retain installed breakpoints.
Run the complete wiring, stepping, replacement, and reuse example with:
cargo run -p vihaco-stdlib --features program-image-execution --example debuggerModules§
Structs§
- Break
- An effect that propagates a hit breakpoint.
- Breakpoint
Message - Identify the breakpoint being executed.
- Debugger
- A component that manages breakpoints.
Enums§
- Debug
Action - Select continuous execution or a single step.
- Debugger
State - Debugger-specific execution suspension.
- IsBreakpoint
Installed - IsBreakpoint
Toggled
Traits§
- Breakpoint
Patchable Program - HasBreakpoint
Instruction - This instruction set has a breakpoint instruction. Implement this for your component’s runtime instruction set to define how it can build a breakpoint instruction.
Functions§
- resume_
with_ breaks - Continue or single-step execution through the selected debugger.