gdbstub::stub

Struct GdbStubError

source
pub struct GdbStubError<T, C> { /* private fields */ }
Expand description

An error which may occur during a GDB debugging session.

§Additional Notes

GdbStubError’s inherent Display impl typically contains enough context for users to understand why the error occurred.

That said, there are a few instances where the error condition requires additional context.


User error: cannot report stop reason without also implementing its corresponding IDET

This is a not a bug with gdbstub. Rather, this is indicative of a bug in your gdbstub integration.

Certain stop reasons can only be used when their associated protocol feature has been implemented. e.g: a Target cannot return a StopReason::HwBreak if the hardware breakpoints IDET hasn’t been implemented.

Please double-check that you’ve implemented all the necessary supports_ methods related to the stop reason you’re trying to report.


Received an unexpected step request. This is most-likely due to this GDB client bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28440

Unfortunately, there’s nothing gdbstub can do to work around this bug.

Until the issue is fixed upstream, certain architectures are essentially forced to manually implement single-step support.

Implementations§

source§

impl<T, C> GdbStubError<T, C>

source

pub fn is_target_error(&self) -> bool

Check if the error was due to a target error.

source

pub fn into_target_error(self) -> Option<T>

If the error was due to a target error, return the concrete error type.

source

pub fn is_connection_error(&self) -> bool

Check if the error was due to a connection error.

source

pub fn into_connection_error(self) -> Option<(C, ConnectionErrorKind)>

If the error was due to a connection error, return the concrete error type.

Trait Implementations§

source§

impl<T: Debug, C: Debug> Debug for GdbStubError<T, C>

source§

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

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

impl<T, C> Display for GdbStubError<T, C>
where C: Display, T: Display,

source§

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

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

impl<T, C> Error for GdbStubError<T, C>
where C: Debug + Display, T: Debug + Display,

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl<T, C> Freeze for GdbStubError<T, C>
where C: Freeze, T: Freeze,

§

impl<T, C> RefUnwindSafe for GdbStubError<T, C>

§

impl<T, C> Send for GdbStubError<T, C>
where C: Send, T: Send,

§

impl<T, C> Sync for GdbStubError<T, C>
where C: Sync, T: Sync,

§

impl<T, C> Unpin for GdbStubError<T, C>
where C: Unpin, T: Unpin,

§

impl<T, C> UnwindSafe for GdbStubError<T, C>
where C: UnwindSafe, T: 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, 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.