Skip to main content

Debugger

Struct Debugger 

Source
pub struct Debugger<K: Ord + 'static, I> { /* private fields */ }
Expand description

A component that manages breakpoints.

This component can handle both explicit breakpoints (those appearing in source) and “gutter” breakpoints, or those that are inserted (similar to gdb’s INT3 insertion on b).

Implementations§

Source§

impl<K: Ord + 'static, I> Debugger<K, I>

Source

pub fn forget_breakpoints(&mut self)

Discard all saved breakpoint instructions and paused-breakpoint state.

Use this when discarding the patched program, before using this debugger with a different image. This does not restore instructions in the old program. To remove breakpoints while keeping that program usable, call Self::clear_all instead. Invocation-only resets retain breakpoints.

Source§

impl<K: Ord + Clone + 'static, I: Clone> Debugger<K, I>

Source

pub fn set_breakpoint<P>( &mut self, program: &mut P, key: K, ) -> IsBreakpointToggled
where P: BreakpointPatchableProgram<K, Instruction = I>,

Installs a gutter breakpoint and retains the displaced instruction.

Source

pub fn clear_breakpoint<P>( &mut self, program: &mut P, key: K, ) -> IsBreakpointToggled
where P: BreakpointPatchableProgram<K, Instruction = I>,

Restores a gutter breakpoint’s displaced instruction.

Source

pub fn toggle_breakpoint<P>( &mut self, program: &mut P, key: K, ) -> IsBreakpointToggled
where P: BreakpointPatchableProgram<K, Instruction = I>,

Source

pub fn clear_all<P>(&mut self, program: &mut P)
where P: BreakpointPatchableProgram<K, Instruction = I>,

Source

pub fn breakpoints(&self) -> impl ExactSizeIterator<Item = &K> + '_

Source

pub fn displaced(&self, key: &K) -> Option<&I>

Source

pub fn contains(&self, key: &K) -> bool

Trait Implementations§

Source§

impl<K: Ord + 'static, I> Capabilities for Debugger<K, I>

Source§

const DESCRIPTION: &'static Description

Raw generated data. Internal reporting uses the validated capabilities.
Source§

impl<K: Ord + 'static, I> Component for Debugger<K, I>

Source§

impl<K: Ord + 'static, I> Default for Debugger<K, I>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K: Ord + 'static, I> Execute<Breakpoint> for Debugger<K, I>

Source§

type Message = BreakpointMessage<K>

Input supplied by the runtime, rather than encoded in the instruction.
Source§

type Effect = Break

The successful result.
Source§

type Error = Infallible

The component’s execution error, usually eyre::Report.
Source§

fn execute( &mut self, _instruction: &Breakpoint, message: Self::Message, ) -> Result<Self::Effect, Self::Error>

Execute a borrowed instruction without consuming its payload. Read more
Source§

impl<K: Ord + 'static, I> HasInventory for Debugger<K, I>

Source§

type Provider = Provider

Source§

impl<K: Ord + 'static, I> Reset for Debugger<K, I>

Source§

fn reset(&mut self)

reset the component state into initial state

Auto Trait Implementations§

§

impl<K, I> Freeze for Debugger<K, I>
where K: Freeze,

§

impl<K, I> RefUnwindSafe for Debugger<K, I>

§

impl<K, I> Send for Debugger<K, I>
where K: Send, I: Send,

§

impl<K, I> Sync for Debugger<K, I>
where K: Sync, I: Sync,

§

impl<K, I> Unpin for Debugger<K, I>
where K: Unpin,

§

impl<K, I> UnsafeUnpin for Debugger<K, I>
where K: UnsafeUnpin,

§

impl<K, I> UnwindSafe for Debugger<K, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<D> Apply<PushToStack<()>> for D

Source§

fn apply(&mut self, _: PushToStack<()>)

Apply a single effect to this destination.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

§

type Proj<U: 'src> = U

§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.