use gdbstub::target::ext::breakpoints::{Breakpoints, HwBreakpointOps, SwBreakpointOps};
use snafu::Snafu;
use super::V5Target;
use crate::cpu::cache;
pub mod hardware;
pub mod software;
impl Breakpoints for V5Target {
fn support_sw_breakpoint(&mut self) -> Option<SwBreakpointOps<'_, Self>> {
Some(self)
}
fn support_hw_breakpoint(&mut self) -> Option<HwBreakpointOps<'_, Self>> {
Some(self)
}
}
impl V5Target {
pub fn set_breakpoints_ignored(&mut self, ignored: bool) {
self.breaks_paused = ignored;
for bkpt in self.breaks.iter_mut().flatten() {
bkpt.set_enabled(!ignored);
cache::sync_instruction(bkpt.cache_target());
}
}
}
#[derive(Debug, Snafu, PartialEq, Eq, Clone, Copy)]
pub enum BreakpointError {
CannotWrite,
AlreadyExists,
NoSpace,
NotAlignedCorrectly,
}