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>
impl<'a, T: Target, C: Connection> GdbStub<'a, T, C>
sourcepub fn builder(conn: C) -> GdbStubBuilder<'a, T, C>
pub fn builder(conn: C) -> GdbStubBuilder<'a, T, C>
Create a GdbStubBuilder
using the provided Connection.
sourcepub fn new(conn: C) -> GdbStub<'a, T, C>
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.
sourcepub fn run_blocking<E>(
self,
target: &mut T,
) -> Result<DisconnectReason, GdbStubError<T::Error, C::Error>>where
C: ConnectionExt,
E: BlockingEventLoop<Target = T, Connection = C>,
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.
sourcepub fn run_state_machine(
self,
target: &mut T,
) -> Result<GdbStubStateMachine<'a, T, C>, GdbStubError<T::Error, C::Error>>
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.