Struct lc3_ensemble::sim::debug::BreakpointList

source ·
pub struct BreakpointList { /* private fields */ }
Expand description

A list of breakpoints.

This works similarly to GDB breakpoints, in that creating a breakpoint gives you an ID which you can use to query or remove the breakpoint later.

Implementations§

source§

impl BreakpointList

source

pub fn new() -> Self

Creates a new breakpoint list.

source

pub fn get(&self, key: BreakpointKey) -> Option<&Breakpoint>

Gets an immutable reference to breakpoint with a given key, returning None if it was already removed.

source

pub fn get_mut(&mut self, key: BreakpointKey) -> Option<&mut Breakpoint>

Gets a mutable reference to breakpoint with a given key, returning None if it was already removed.

source

pub fn contains_key(&self, key: BreakpointKey) -> bool

Checks if the key is currently associated with some breakpoint.

source

pub fn len(&self) -> usize

Counts the number of defined breakpoints.

source

pub fn is_empty(&self) -> bool

Checks if the breakpoint list is empty.

source

pub fn insert(&mut self, bpt: Breakpoint) -> BreakpointKey

Inserts a breakpoint into the list and returns its key.

source

pub fn remove(&mut self, key: BreakpointKey) -> Option<Breakpoint>

Remove breakpoint with given key.

If breakpoint was previously removed, then this returns None.

source

pub fn remove_breakpoint( &mut self, breakpoint: &Breakpoint ) -> Option<Breakpoint>

Remove breakpoint that matches a given value.

This is a utility function to remove a breakpoint by value. If you’d like to remove by key, use BreakpointList::remove.

Note that this can only reliably remove PC, Reg, and Mem breakpoints. The remaining 3 may fail to match even if an identical breakpoint appears in the list.

source

pub fn remove_breakpoint_by( &mut self, pred: impl FnMut(&mut Breakpoint) -> bool ) -> Option<Breakpoint>

Remove breakpoint that matches a given predicate.

This is a utility function to remove a breakpoint by value. If you’d like to remove by key, use BreakpointList::remove.

source

pub fn clear(&mut self)

Removes all breakpoints from the list.

source

pub fn iter(&self) -> Iter<'_, BreakpointKey, Breakpoint>

An iterator visiting all breakpoints and their associated keys in arbitrary order.

This function must iterate over all slots, empty or not. In the face of many deleted elements it can be inefficient.

source

pub fn iter_mut(&mut self) -> IterMut<'_, BreakpointKey, Breakpoint>

An iterator visiting all breakpoints and their associated keys in arbitrary order, with a mutable reference to each breakpoint.

This function must iterate over all slots, empty or not. In the face of many deleted elements it can be inefficient.

source

pub fn keys(&self) -> Keys<'_, BreakpointKey, Breakpoint>

An iterator visiting all keys in arbitrary order.

This function must iterate over all slots, empty or not. In the face of many deleted elements it can be inefficient.

source

pub fn values(&self) -> Values<'_, BreakpointKey, Breakpoint>

An iterator visiting all breakpoints in arbitrary order.

This function must iterate over all slots, empty or not. In the face of many deleted elements it can be inefficient.

source

pub fn values_mut(&mut self) -> ValuesMut<'_, BreakpointKey, Breakpoint>

An iterator visiting all breakpoints in arbitrary order, with a mutable reference to each breakpoint.

This function must iterate over all slots, empty or not. In the face of many deleted elements it can be inefficient.

Trait Implementations§

source§

impl Debug for BreakpointList

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BreakpointList

source§

fn default() -> BreakpointList

Returns the “default value” for a type. Read more
source§

impl Index<BreakpointKey> for BreakpointList

§

type Output = Breakpoint

The returned type after indexing.
source§

fn index(&self, index: BreakpointKey) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<BreakpointKey> for BreakpointList

source§

fn index_mut(&mut self, index: BreakpointKey) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V