Lines Matching +full:bare +full:- +full:events
1 //! An ergonomic, featureful, and easy-to-integrate implementation of the [GDB
2 //! Remote Serial Protocol](https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html#Remote-P…
3 //! in Rust, with no-compromises `#![no_std]` support.
10 //! `default-features = false`.
12 //! - `alloc`
13 //! - Implement `Connection` for `Box<dyn Connection>`.
14 //! - Log outgoing packets via `log::trace!` (uses a heap-allocated output
16 //! - Provide built-in implementations for certain protocol features:
17 //! - Use a heap-allocated packet buffer in `GdbStub` (if none is
19 //! - (Monitor Command) Use a heap-allocated output buffer in
21 //! - `std` (implies `alloc`)
22 //! - Implement `Connection` for [`TcpStream`](std::net::TcpStream) and
24 //! - Implement [`std::error::Error`] for `gdbstub::Error`.
25 //! - Add a `TargetError::Io` variant to simplify `std::io::Error` handling
27 //! - `paranoid_unsafe`
28 //! - Please refer to the [`unsafe` in `gdbstub`](https://github.com/daniel5151/gdbstub#unsafe-…
38 //! running with `gdbstub`: a [`Connection`](#the-connection-trait), a
39 //! [`Target`](#the-target-trait), and a [event loop](#the-event-loop).
45 //! > In particular, the in-tree
62 //! most likely need to be manually implemented on top of whatever in-order,
63 //! serial, byte-wise I/O your particular platform has available (e.g:
73 //! fn wait_for_gdb_connection(port: u16) -> io::Result<TcpStream> {
92 //! specific target's project/platform-specific code.
94 //! At a high level, the `Target` trait is a collection of user-defined handler
102 //! Please refer to the [`target` module documentation](target) for in-depth
108 //! Once a [`Connection`](#the-connection-trait) has been established and the
109 //! [`Target`](#the-target-trait) has been initialized, all that's left is to
116 //! // Set-up a valid `Target`
138 //! section](#gdbstubstatemachine-driving-gdbstub-in-an-async-event-loop--via-interrupt-handlers).
151 //! # fn base_ops(&mut self) -> BaseOps<Self::Arch, Self::Error> { todo!() }
158 //! # ) -> MyTargetEvent { todo!() }
162 //! # ) -> Result<(), &'static str> { todo!() }
193 //! ) -> Result<
201 //! // events will depend on your project's architecture.
224 //! // Invoked when the GDB client sends a Ctrl-C interrupt.
227 //! ) -> Result<Option<SingleThreadStopReason<u32>>, <MyTarget as Target>::Error> {
228 //! // notify the target that a ctrl-c interrupt has occurred.
231 //! // a pretty typical stop reason in response to a Ctrl-C interrupt is to
262 //! println!("connection error: {:?} - {}", kind, e,)
275 //! when handling certain events. Blocking the thread is a totally reasonable
280 //! Unfortunately, this blocking behavior can be a non-starter when integrating
282 //! thread-based execution model, such as projects using `async/await`, or
283 //! bare-metal `no_std` projects running on embedded hardware.
291 //! "pulls" these events in a blocking manner.
334 // https://users.rust-lang.org/t/compile-time-const-unwrapping/51619/7
350 /// (Internal) The fake Tid that's used when running in single-threaded mode.