Skip to main content

DebugProxyClient

Struct DebugProxyClient 

Source
pub struct DebugProxyClient<R: ReadWrite> {
    pub socket: R,
    pub noack_mode: bool,
}
Expand description

Client for interacting with the iOS debug proxy service

Implements the GDB Remote Serial Protocol for communicating with debugserver on iOS devices. Handles packet formatting, checksums, and acknowledgments.

Fields§

§socket: R

The underlying socket connection to debugproxy

§noack_mode: bool

Flag indicating whether ACK mode is disabled

Implementations§

Source§

impl<R: ReadWrite> DebugProxyClient<R>

Source

pub fn new(socket: R) -> Self

Creates a new debug proxy client with default settings

§Arguments
  • socket - Established connection to debugproxy service
Source

pub fn into_inner(self) -> R

Consumes the client and returns the underlying socket

Source

pub async fn send_command( &mut self, command: DebugserverCommand, ) -> Result<Option<String>, IdeviceError>

Sends a command to debugserver and waits for response

Formats the command according to GDB Remote Serial Protocol: $[]#

§Arguments
  • command - The command and arguments to send
§Returns

The response string if successful, None if no response received

§Errors

Returns IdeviceError if communication fails

Source

pub async fn read_response(&mut self) -> Result<Option<String>, IdeviceError>

Reads a response packet from debugserver

Handles the GDB Remote Serial Protocol response format: $#

§Returns

The response data without protocol framing if successful

§Errors

Returns IdeviceError if communication fails or protocol is violated

Source

pub async fn send_raw(&mut self, bytes: &[u8]) -> Result<(), IdeviceError>

Sends raw bytes directly to the debugproxy connection

§Arguments
  • bytes - The raw bytes to send
§Errors

Returns IdeviceError if writing fails

Source

pub async fn read(&mut self, len: usize) -> Result<String, IdeviceError>

Reads raw bytes from the debugproxy connection

§Arguments
  • len - Maximum number of bytes to read
§Returns

The received data as a string

§Errors

Returns IdeviceError if reading fails or data isn’t valid UTF-8

Source

pub async fn set_argv( &mut self, argv: Vec<String>, ) -> Result<String, IdeviceError>

Sets program arguments using the ‘A’ command

Formats arguments according to GDB protocol: A,,

§Arguments
  • argv - Program arguments to set
§Returns

The debugserver response

§Errors

Returns IdeviceError if arguments are empty or communication fails

Source

pub async fn send_ack(&mut self) -> Result<(), IdeviceError>

Sends an acknowledgment (+)

§Errors

Returns IdeviceError if writing fails

Source

pub async fn send_noack(&mut self) -> Result<(), IdeviceError>

Sends a negative acknowledgment (-)

§Errors

Returns IdeviceError if writing fails

Source

pub fn set_ack_mode(&mut self, enabled: bool)

Enables or disables ACK mode

When disabled, the client won’t expect or send acknowledgments

§Arguments
  • enabled - Whether to enable ACK mode

Trait Implementations§

Source§

impl<R: Debug + ReadWrite> Debug for DebugProxyClient<R>

Source§

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

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

impl RsdService for DebugProxyClient<Box<dyn ReadWrite>>

Source§

fn rsd_service_name() -> Cow<'static, str>

Source§

async fn from_stream(stream: Box<dyn ReadWrite>) -> Result<Self, IdeviceError>

Source§

fn connect_rsd( provider: &mut impl RsdProvider, handshake: &mut RsdHandshake, ) -> impl Future<Output = Result<Self, IdeviceError>>
where Self: RsdService,

Auto Trait Implementations§

§

impl<R> Freeze for DebugProxyClient<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for DebugProxyClient<R>
where R: RefUnwindSafe,

§

impl<R> Send for DebugProxyClient<R>

§

impl<R> Sync for DebugProxyClient<R>

§

impl<R> Unpin for DebugProxyClient<R>

§

impl<R> UnsafeUnpin for DebugProxyClient<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for DebugProxyClient<R>
where R: UnwindSafe,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more