MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / add_hw_breakpoint

Method add_hw_breakpoint

vmm/src/gdb.rs:398–422  ·  view source on GitHub ↗
(
        &mut self,
        addr: <Self::Arch as Arch>::Usize,
        _kind: <Self::Arch as Arch>::BreakpointKind,
    )

Source from the content-addressed store, hash-verified

396
397impl 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,

Callers

nothing calls this directly

Calls 5

capacityMethod · 0.80
vm_requestMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected