#[non_exhaustive]
pub enum BaseStopReason<Tid, U> {
    DoneStep,
    Exited(u8),
    Terminated(Signal),
    Signal(Signal),
    SignalWithThread {
        tid: Tid,
        signal: Signal,
    },
    SwBreak(Tid),
    HwBreak(Tid),
    Watch {
        tid: Tid,
        kind: WatchKind,
        addr: U,
    },
    ReplayLog {
        tid: Option<Tid>,
        pos: ReplayLogPosition,
    },
    CatchSyscall {
        tid: Option<Tid>,
        number: U,
        position: CatchSyscallPosition,
    },
}
Expand description

Describes why a thread stopped.

Single threaded targets should set Tid to (), whereas multi threaded targets should set Tid to Tid. To make things easier, it is recommended to use the SingleThreadStopReason and MultiThreadStopReason when possible.

Targets MUST only respond with stop reasons that correspond to IDETs that target has implemented. Not doing so will result in a runtime error.

e.g: A target which has not implemented the HwBreakpoint IDET must not return a HwBreak stop reason. While this is not enforced at compile time, doing so will result in a runtime UnsupportedStopReason error.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

DoneStep

Completed the single-step request.

Exited(u8)

The process exited with the specified exit status.

Terminated(Signal)

The process terminated with the specified signal number.

Signal(Signal)

The program received a signal.

SignalWithThread

Fields

tid: Tid

Tid of the associated thread

signal: Signal

The signal

A specific thread received a signal.

SwBreak(Tid)

A thread hit a software breakpoint (e.g. due to a trap instruction).

Requires: SwBreakpoint.

NOTE: This does not necessarily have to be a breakpoint configured by the client/user of the current GDB session.

HwBreak(Tid)

A thread hit a hardware breakpoint.

Requires: HwBreakpoint.

Watch

Fields

tid: Tid

Tid of the associated thread

kind: WatchKind

Kind of watchpoint that was hit

addr: U

Address of watched memory

A thread hit a watchpoint.

Requires: HwWatchpoint.

ReplayLog

Fields

tid: Option<Tid>

(optional) Tid of the associated thread.

pos: ReplayLogPosition

The point reached in a replay log (i.e: beginning vs. end).

The program has reached the end of the logged replay events.

Requires: ReverseCont or ReverseStep.

This is used for GDB’s reverse execution. When playing back a recording, you may hit the end of the buffer of recorded events, and as such no further execution can be done. This stop reason tells GDB that this has occurred.

CatchSyscall

Fields

tid: Option<Tid>

(optional) Tid of the associated thread.

number: U

The syscall number.

position: CatchSyscallPosition

The location the event occurred at.

The program has reached a syscall entry or return location.

Requires: CatchSyscalls.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.