@@ -37,25 +37,25 @@ pub mod run_blocking {
3737 ///
3838 /// [`GdbStubStateMachine`]: state_machine::GdbStubStateMachine
3939 pub struct SimpleStub < ' a , T : Target , C : Connection , Tid : IsValidTid > {
40- pub ( crate ) inner :
40+ pub ( crate ) gdb :
4141 state_machine:: GdbStubStateMachineInner < ' a , state_machine:: state:: Running , T , C , Tid > ,
4242 }
4343
4444 /// Opaque type representing an event that was occurred in
4545 /// [`BlockingEventLoop::wait_for_stop_reason`].
4646 ///
4747 /// Created via [`SimpleStub`].
48- pub struct Event < ' a , T : Target , C : Connection , Tid : IsValidTid > (
49- pub ( crate ) Result <
48+ pub struct Event < ' a , T : Target , C : Connection , Tid : IsValidTid > {
49+ pub ( crate ) gdb : Result <
5050 state_machine:: GdbStubStateMachine < ' a , T , C , Tid > ,
5151 GdbStubError < <T as Target >:: Error , <C as Connection >:: Error > ,
5252 > ,
53- ) ;
53+ }
5454
5555 impl < ' a , T : Target , C : Connection , Tid : IsValidTid > SimpleStub < ' a , T , C , Tid > {
5656 /// Return a mutable reference to the underlying connection.
5757 pub fn borrow_conn ( & mut self ) -> & mut C {
58- self . inner . borrow_conn ( )
58+ self . gdb . borrow_conn ( )
5959 }
6060
6161 /// Report a target stop reason back to GDB.
@@ -69,12 +69,16 @@ pub mod run_blocking {
6969 GdbStubError < <T as Target >:: Error , <C as Connection >:: Error > ,
7070 > ,
7171 ) -> Event < ' a , T , C , Tid > {
72- Event ( report ( self . inner . report_stop ( target) ) )
72+ Event {
73+ gdb : report ( self . gdb . report_stop ( target) ) ,
74+ }
7375 }
7476
7577 /// Pass a byte to the GDB stub.
7678 pub fn incoming_data ( self , target : & mut T , byte : u8 ) -> Event < ' a , T , C , Tid > {
77- Event ( self . inner . incoming_data ( target, byte) )
79+ Event {
80+ gdb : self . gdb . incoming_data ( target, byte) ,
81+ }
7882 }
7983 }
8084
@@ -83,9 +87,7 @@ pub mod run_blocking {
8387 ///
8488 /// Reminder: to use `gdbstub` in a non-blocking manner (e.g: via
8589 /// async/await, unix polling, from an interrupt handler, etc...) you will
86- /// need to interface with the
87- /// [`GdbStubStateMachine`](state_machine::GdbStubStateMachine) API
88- /// directly.
90+ /// need to interface with the [`GdbStubStateMachine`] API directly.
8991 pub trait BlockingEventLoop {
9092 /// The Target being driven.
9193 type Target : Target ;
@@ -145,12 +147,10 @@ pub mod run_blocking {
145147 /// `Event::StopReason` in `wait_for_stop_reason()` as usual.
146148 ///
147149 /// _Suggestion_: If you're unsure which stop reason to report in
148- /// response to a ctrl-c interrupt,
149- /// [`BaseStopReason::Signal(Signal::SIGINT)`] may be a sensible
150+ /// response to a ctrl-c interrupt, [`Signal::SIGINT`] may be a sensible
150151 /// default.
151152 ///
152- /// [`BaseStopReason::Signal(Signal::SIGINT)`]:
153- /// crate::stub::BaseStopReason::Signal
153+ /// [`Signal::SIGINT`]: crate::common::Signal::SIGINT
154154 fn on_interrupt ( target : & mut Self :: Target ) -> Result < ( ) , <Self :: Target as Target >:: Error > {
155155 let _ = target;
156156 Ok ( ( ) )
@@ -248,10 +248,9 @@ impl<'a, T: Target, C: Connection> GdbStub<'a, T, C> {
248248 use run_blocking:: WaitForStopReasonError ;
249249
250250 // block waiting for the target to return a stop reason
251- let res =
252- E :: wait_for_stop_reason ( target, run_blocking:: SimpleStub { inner : gdb } ) ;
251+ let res = E :: wait_for_stop_reason ( target, run_blocking:: SimpleStub { gdb } ) ;
253252 match res {
254- Ok ( run_blocking:: Event ( gdb) ) => gdb?,
253+ Ok ( run_blocking:: Event { gdb } ) => gdb?,
255254 Err ( WaitForStopReasonError :: Target ( e) ) => {
256255 break Err ( InternalError :: TargetError ( e) . into ( ) ) ;
257256 }
0 commit comments