(
&mut self,
addr: <Self::Arch as Arch>::Usize,
_kind: <Self::Arch as Arch>::BreakpointKind,
)
| 396 | |
| 397 | impl HwBreakpoint for GdbStub { |
| 398 | fn add_hw_breakpoint( |
| 399 | &mut self, |
| 400 | addr: <Self::Arch as Arch>::Usize, |
| 401 | _kind: <Self::Arch as Arch>::BreakpointKind, |
| 402 | ) -> TargetResult<bool, Self> { |
| 403 | // If the HW breakpoints reach the limit, no more can be added. |
| 404 | if self.hw_breakpoints.len() >= self.hw_breakpoints.capacity() { |
| 405 | error!( |
| 406 | "Not allowed to set more than {} HW breakpoints", |
| 407 | self.hw_breakpoints.capacity() |
| 408 | ); |
| 409 | return Ok(false); |
| 410 | } |
| 411 | |
| 412 | self.hw_breakpoints.push(GuestAddress(addr)); |
| 413 | |
| 414 | let payload = GdbRequestPayload::SetHwBreakPoint(self.hw_breakpoints.clone()); |
| 415 | match self.vm_request(payload, 0) { |
| 416 | Ok(_) => Ok(true), |
| 417 | Err(e) => { |
| 418 | error!("Failed to request SetHwBreakPoint: {e:?}"); |
| 419 | Err(TargetError::NonFatal) |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | fn remove_hw_breakpoint( |
| 424 | &mut self, |
| 425 | addr: <Self::Arch as Arch>::Usize, |
nothing calls this directly
no test coverage detected