Skip to main content

Debugger

Struct Debugger 

Source
pub struct Debugger<H: SyscallHandler> {
Show 13 fields pub vm: SbpfVm<H>, pub breakpoints: HashSet<u64>, pub line_breakpoints: HashSet<usize>, pub dwarf_line_map: Option<LineMap>, pub rodata: Option<Vec<RODataSymbol>>, pub last_breakpoint: Option<u64>, pub debug_mode: DebugMode, pub stopped: bool, pub exit_code: u64, pub at_breakpoint: bool, pub last_breakpoint_pc: Option<u64>, pub initial_compute_budget: u64, pub instruction_offsets: Vec<u64>,
}

Fields§

§vm: SbpfVm<H>§breakpoints: HashSet<u64>§line_breakpoints: HashSet<usize>§dwarf_line_map: Option<LineMap>§rodata: Option<Vec<RODataSymbol>>§last_breakpoint: Option<u64>§debug_mode: DebugMode§stopped: bool§exit_code: u64§at_breakpoint: bool§last_breakpoint_pc: Option<u64>§initial_compute_budget: u64§instruction_offsets: Vec<u64>

Implementations§

Source§

impl<H: SyscallHandler> Debugger<H>

Source

pub fn new(vm: SbpfVm<H>) -> Self

Source

pub fn set_dwarf_line_map(&mut self, dwarf_map: LineMap)

Source

pub fn set_rodata(&mut self, rodata: Vec<RODataSymbol>)

Source

pub fn set_breakpoint(&mut self, pc: u64)

Source

pub fn set_breakpoint_at_line(&mut self, line: usize) -> Result<(), String>

Source

pub fn remove_breakpoint_at_line(&mut self, line: usize) -> Result<(), String>

Source

pub fn get_current_line(&self) -> Option<usize>

Source

pub fn get_line_for_pc(&self, pc: u64) -> Option<usize>

Source

pub fn get_pcs_for_line(&self, line: usize) -> Vec<u64>

Source

pub fn get_breakpoints_info(&self) -> String

Source

pub fn set_debug_mode(&mut self, debug_mode: DebugMode)

Source

pub fn run(&mut self) -> DebuggerResult<DebugEvent>

Source

pub fn get_pc(&self) -> u64

Source

pub fn get_registers(&self) -> &[u64]

Source

pub fn get_register(&self, idx: usize) -> Option<u64>

Source

pub fn set_register_value( &mut self, idx: usize, value: u64, ) -> Result<(), String>

Source

pub fn get_rodata(&self) -> Option<&Vec<RODataSymbol>>

Source

pub fn get_compute_units(&self) -> u64

Source

pub fn get_instruction(&self) -> Option<&Instruction>

Source

pub fn get_instruction_asm(&self) -> Option<String>

Source

pub fn get_source_location(&self, pc: u64) -> Option<(&str, usize, usize)>

Source

pub fn clear_breakpoints(&mut self)

Source

pub fn get_memory(&self, address: u64, size: usize) -> Option<Vec<u8>>

Source

pub fn get_stack_frames(&self) -> Vec<StackFrame<'_>>

Trait Implementations§

Source§

impl<H: SyscallHandler> DebuggerInterface for Debugger<H>

Source§

fn next(&mut self) -> Value

Source§

fn continue(&mut self) -> Value

Source§

fn set_breakpoint(&mut self, file: String, line: usize) -> Value

Source§

fn remove_breakpoint(&mut self, file: String, line: usize) -> Value

Source§

fn get_stack_frames(&self) -> Value

Source§

fn get_registers(&self) -> Value

Source§

fn get_memory(&self, address: u64, size: usize) -> Value

Source§

fn set_register(&mut self, index: usize, value: u64) -> Value

Source§

fn get_rodata(&self) -> Value

Source§

fn clear_breakpoints(&mut self, _file: String) -> Value

Source§

fn quit(&mut self) -> Value

Source§

fn get_compute_units(&self) -> Value

Source§

fn run_to_json(&mut self) -> Value

Auto Trait Implementations§

§

impl<H> Freeze for Debugger<H>
where H: Freeze,

§

impl<H> !RefUnwindSafe for Debugger<H>

§

impl<H> !Send for Debugger<H>

§

impl<H> !Sync for Debugger<H>

§

impl<H> Unpin for Debugger<H>
where H: Unpin,

§

impl<H> UnsafeUnpin for Debugger<H>
where H: UnsafeUnpin,

§

impl<H> !UnwindSafe for Debugger<H>

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<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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.