• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Implementations for various x86 architectures.
2 
3 use gdbstub::arch::Arch;
4 use gdbstub::arch::RegId;
5 
6 pub mod reg;
7 
8 /// Implements `Arch` for 64-bit x86 + SSE Extensions.
9 ///
10 /// Check out the [module level docs](gdbstub::arch#whats-with-regidimpl) for
11 /// more info about the `RegIdImpl` type parameter.
12 #[allow(non_camel_case_types, clippy::upper_case_acronyms)]
13 pub enum X86_64_SSE<RegIdImpl: RegId = reg::id::X86_64CoreRegId> {
14     #[doc(hidden)]
15     _Marker(core::marker::PhantomData<RegIdImpl>),
16 }
17 
18 impl<RegIdImpl: RegId> Arch for X86_64_SSE<RegIdImpl> {
19     type Usize = u64;
20     type Registers = reg::X86_64CoreRegs;
21     type RegId = RegIdImpl;
22     type BreakpointKind = usize;
23 
target_description_xml() -> Option<&'static str>24     fn target_description_xml() -> Option<&'static str> {
25         Some(
26             r#"<target version="1.0"><architecture>i386:x86-64</architecture><feature name="org.gnu.gdb.i386.sse"></feature></target>"#,
27         )
28     }
29 }
30 
31 /// Implements `Arch` for 32-bit x86 + SSE Extensions.
32 ///
33 /// Check out the [module level docs](gdbstub::arch#whats-with-regidimpl) for
34 /// more info about the `RegIdImpl` type parameter.
35 #[allow(non_camel_case_types, clippy::upper_case_acronyms)]
36 pub enum X86_SSE<RegIdImpl: RegId = reg::id::X86CoreRegId> {
37     #[doc(hidden)]
38     _Marker(core::marker::PhantomData<RegIdImpl>),
39 }
40 
41 impl<RegIdImpl: RegId> Arch for X86_SSE<RegIdImpl> {
42     type Usize = u32;
43     type Registers = reg::X86CoreRegs;
44     type RegId = RegIdImpl;
45     type BreakpointKind = usize;
46 
target_description_xml() -> Option<&'static str>47     fn target_description_xml() -> Option<&'static str> {
48         Some(
49             r#"<target version="1.0"><architecture>i386:intel</architecture><feature name="org.gnu.gdb.i386.sse"></feature></target>"#,
50         )
51     }
52 }
53