Struct gdbstub::stub::GdbStub

source ·
pub struct GdbStub<'a, T: Target, C: Connection> { /* private fields */ }
Expand description

Debug a Target using the GDB Remote Serial Protocol over a given Connection.

Implementations§

source§

impl<'a, T: Target, C: Connection> GdbStub<'a, T, C>

source

pub fn builder(conn: C) -> GdbStubBuilder<'a, T, C>

Create a GdbStubBuilder using the provided Connection.

source

pub fn new(conn: C) -> GdbStub<'a, T, C>

Create a new GdbStub using the provided connection.

Note: new is only available when the alloc feature is enabled, as it will use a dynamically allocated Vec as a packet buffer.

For fine-grained control over various GdbStub options, including the ability to specify a fixed-size buffer, use the GdbStub::builder method instead.

source

pub fn run_blocking<E>( self, target: &mut T ) -> Result<DisconnectReason, GdbStubError<T::Error, C::Error>>
where C: ConnectionExt, E: BlockingEventLoop<Target = T, Connection = C>,

(Quickstart) Start a GDB remote debugging session using a blocking event loop.

This method provides a quick and easy way to get up and running with gdbstub without directly having to immediately interface with the lower-level state-machine based interface.

Instead, an implementation simply needs to provide a implementation of run_blocking::BlockingEventLoop, which is a simplified set of methods describing how to drive the target.

GdbStub::run_blocking returns once the GDB client closes the debugging session, or if the target triggers a disconnect.

Note that this implementation is blocking, which many not be preferred (or suitable) in all cases. To use gdbstub in a non-blocking manner (e.g: via async/await, unix polling, from an interrupt handler, etc…) you will need to interface with the underlying GdbStubStateMachine API directly.

source

pub fn run_state_machine( self, target: &mut T ) -> Result<GdbStubStateMachine<'a, T, C>, GdbStubError<T::Error, C::Error>>

Starts a GDB remote debugging session, converting this instance of GdbStub into a GdbStubStateMachine that is ready to receive data.

Auto Trait Implementations§

§

impl<'a, T, C> RefUnwindSafe for GdbStub<'a, T, C>

§

impl<'a, T, C> Send for GdbStub<'a, T, C>
where C: Send, T: Send,

§

impl<'a, T, C> Sync for GdbStub<'a, T, C>
where C: Sync, T: Sync,

§

impl<'a, T, C> Unpin for GdbStub<'a, T, C>
where C: Unpin, T: Unpin,

§

impl<'a, T, C> !UnwindSafe for GdbStub<'a, T, C>

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.