pub struct ElfDebugger<'a> { /* private fields */ }
Implementations§
Source§impl<'a> ElfDebugger<'a>
impl<'a> ElfDebugger<'a>
pub fn disconnect(self) -> Result<()>
pub fn resolve( &self, address: impl Into<SymbolicAddress>, ) -> Result<ResolvedAddress>
Sourcepub fn read_reg(&mut self, reg: impl Into<RiscvReg>) -> Result<u32>
pub fn read_reg(&mut self, reg: impl Into<RiscvReg>) -> Result<u32>
Read a RISC-V register.
This is a convience wrapper around read_riscv_reg
provided by the JTAG trait.
Sourcepub fn write_reg(&mut self, reg: impl Into<RiscvReg>, value: u32) -> Result<()>
pub fn write_reg(&mut self, reg: impl Into<RiscvReg>, value: u32) -> Result<()>
Write a RISC-V register.
This is a convience wrapper around write_riscv_reg
provided by the JTAG trait.
Sourcepub fn read_u32(&mut self, addr: u32) -> Result<u32>
pub fn read_u32(&mut self, addr: u32) -> Result<u32>
Read a 32-bit word from memory.
This is a convience wrapper around read_memory32
provided by the JTAG trait.
Sourcepub fn write_u32(&mut self, addr: u32, value: u32) -> Result<()>
pub fn write_u32(&mut self, addr: u32, value: u32) -> Result<()>
Write a 32-bit word to memory.
This is a convience wrapper around write_memory32
provided by the JTAG trait.
Sourcepub fn set_pc(&mut self, address: impl Into<SymbolicAddress>) -> Result<()>
pub fn set_pc(&mut self, address: impl Into<SymbolicAddress>) -> Result<()>
Set the program counter to the given address.
Sourcepub fn set_breakpoint(
&mut self,
address: impl Into<SymbolicAddress>,
) -> Result<()>
pub fn set_breakpoint( &mut self, address: impl Into<SymbolicAddress>, ) -> Result<()>
Set a breakpoint at the given address.
Sourcepub fn expect_pc(&mut self, address: impl Into<SymbolicAddress>) -> Result<()>
pub fn expect_pc(&mut self, address: impl Into<SymbolicAddress>) -> Result<()>
Assert the current program counter is at the given address.
Sourcepub fn expect_pc_range(
&mut self,
range: Range<impl Into<SymbolicAddress>>,
) -> Result<()>
pub fn expect_pc_range( &mut self, range: Range<impl Into<SymbolicAddress>>, ) -> Result<()>
Assert the current program counter is within the given range.
Sourcepub fn run_until(
&mut self,
address: impl Into<SymbolicAddress>,
timeout: Duration,
) -> Result<()>
pub fn run_until( &mut self, address: impl Into<SymbolicAddress>, timeout: Duration, ) -> Result<()>
Continue execution until the address is hit.
Note that a breakpoint must not already exist for the target address, otherwise this function will fail.
This function will also fail if a pre-existing breakpoint is hit before the target address is hit.