1 /* QNX Neutrino specific low level interface, for the remote server
3 Copyright (C) 2009-2019 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 #include <x86/context.h>
26 #include "common/x86-xstate.h"
27 #include "arch/i386.h"
28 #include "x86-tdesc.h"
30 const unsigned char x86_breakpoint
[] = { 0xCC };
31 #define x86_breakpoint_len 1
33 /* Returns offset in appropriate Neutrino's context structure.
34 Defined in x86/context.h.
35 GDBREGNO is index into regs_i386 array. It is autogenerated and
36 hopefully doesn't change. */
38 nto_x86_register_offset (int gdbregno
)
40 if (gdbregno
>= 0 && gdbregno
< 16)
42 X86_CPU_REGISTERS
*dummy
= (void*)0;
47 return (int)&(dummy
->eax
);
49 return (int)&(dummy
->ecx
);
51 return (int)&(dummy
->edx
);
53 return (int)&(dummy
->ebx
);
55 return (int)&(dummy
->esp
);
57 return (int)&(dummy
->ebp
);
59 return (int)&(dummy
->esi
);
61 return (int)&(dummy
->edi
);
63 return (int)&(dummy
->eip
);
65 return (int)&(dummy
->efl
);
67 return (int)&(dummy
->cs
);
69 return (int)&(dummy
->ss
);
72 return (int)&(dummy
->ds
);
74 return (int)&(dummy
->es
);
76 return (int)&(dummy
->fs
);
78 return (int)&(dummy
->gs
);
88 nto_x86_arch_setup (void)
90 the_low_target
.num_regs
= 16;
91 struct target_desc
*tdesc
92 = i386_create_target_description (X86_XSTATE_SSE_MASK
, false, false);
94 init_target_desc (tdesc
, i386_expedite_regs
);
99 struct nto_target_ops the_low_target
=
103 nto_x86_register_offset
,