Trait gdbstub::arch::Arch[][src]

pub trait Arch {
    type Usize: FromPrimitive + PrimInt + Unsigned + BeBytes + LeBytes;
    type Registers: Registers<ProgramCounter = Self::Usize>;
    type BreakpointKind: BreakpointKind;
    type RegId: RegId;
    fn target_description_xml() -> Option<&'static str> { ... }
}
Expand description

Encodes architecture-specific information, such as pointer size, register layout, etc…

Types implementing Arch should be Zero-variant Enums, as Arch impls are only ever used at the type level, and should never be explicitly instantiated.

Associated Types

type Usize: FromPrimitive + PrimInt + Unsigned + BeBytes + LeBytes[src]

The architecture’s pointer size (e.g: u32 on a 32-bit system).

type Registers: Registers<ProgramCounter = Self::Usize>[src]

The architecture’s register file. See Registers for more details.

type BreakpointKind: BreakpointKind[src]

The architecture’s breakpoint “kind”, used to determine the “size” of breakpoint to set. See BreakpointKind for more details.

type RegId: RegId[src]

Register identifier enum/struct.

Used to access individual registers via Target::read/write_register.

NOTE: An arch’s RegId type is not strictly required to have a 1:1 correspondence with the Registers type, and may include register identifiers which are separate from the main Registers structure. (e.g: the RISC-V Control and Status registers)

Provided methods

fn target_description_xml() -> Option<&'static str>[src]

(optional) Return the arch’s description XML file (target.xml).

Implementing this method enables GDB to automatically detect the target’s architecture, saving the hassle of having to run set architecture <arch> when starting a debugging session.

These descriptions can be quite succinct. For example, the target description for an armv4t target can be as simple as:

r#"<target version="1.0"><architecture>armv4t</architecture></target>"#;

See the GDB docs for details on the target description XML format.

Implementors