2023-04-06 03:23:35 +00:00
|
|
|
use gdbstub::arch::SingleStepGdbBehavior;
|
2024-09-22 17:43:02 +00:00
|
|
|
use gdbstub::target::Target;
|
2023-03-12 02:37:47 +00:00
|
|
|
use gdbstub::target::ext::base::BaseOps;
|
|
|
|
|
use gdbstub::target::ext::breakpoints::BreakpointsOps;
|
|
|
|
|
use gdbstub::target::ext::extended_mode::ExtendedModeOps;
|
|
|
|
|
use gdbstub::target::ext::monitor_cmd::MonitorCmdOps;
|
|
|
|
|
|
|
|
|
|
use super::XousTarget;
|
|
|
|
|
|
|
|
|
|
impl Target for XousTarget {
|
|
|
|
|
type Arch = gdbstub_arch::riscv::Riscv32;
|
|
|
|
|
type Error = &'static str;
|
|
|
|
|
|
2024-01-14 11:27:14 +00:00
|
|
|
fn base_ops(&mut self) -> BaseOps<Self::Arch, Self::Error> { BaseOps::MultiThread(self) }
|
2023-03-12 02:37:47 +00:00
|
|
|
|
2024-01-14 11:27:14 +00:00
|
|
|
fn support_breakpoints(&mut self) -> Option<BreakpointsOps<Self>> { Some(self) }
|
2023-03-12 02:37:47 +00:00
|
|
|
|
|
|
|
|
/// Opt in to having GDB handle breakpoints for us. This allows for an unlimited number
|
2023-04-06 01:37:46 +00:00
|
|
|
/// of breakpoints without having us keep track of the breakpoints ourselves, but
|
|
|
|
|
/// doesn't work with XIP programs.
|
2024-01-14 11:27:14 +00:00
|
|
|
fn guard_rail_implicit_sw_breakpoints(&self) -> bool { true }
|
2023-03-12 02:37:47 +00:00
|
|
|
|
2024-01-14 11:27:14 +00:00
|
|
|
fn guard_rail_single_step_gdb_behavior(&self) -> SingleStepGdbBehavior { SingleStepGdbBehavior::Required }
|
2023-04-06 03:23:35 +00:00
|
|
|
|
2024-01-14 11:27:14 +00:00
|
|
|
fn support_monitor_cmd(&mut self) -> Option<MonitorCmdOps<'_, Self>> { Some(self) }
|
2023-03-12 02:37:47 +00:00
|
|
|
|
2024-01-14 11:27:14 +00:00
|
|
|
fn support_extended_mode(&mut self) -> Option<ExtendedModeOps<'_, Self>> { Some(self) }
|
2023-03-12 02:37:47 +00:00
|
|
|
}
|