1 /* QNX Neutrino specific low level interface, for the remote server
4 Free Software Foundation, Inc.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include <x86/context.h>
29 /* Definition auto generated from reg-i386.dep. */
30 extern void init_registers_i386 ();
31 extern struct reg
*regs_i386
;
33 const unsigned char x86_breakpoint
[] = { 0xCC };
34 #define x86_breakpoint_len 1
36 /* Returns offset in appropriate Neutrino's context structure.
37 Defined in x86/context.h.
38 GDBREGNO is index into regs_i386 array. It is autogenerated and
39 hopefully doesn't change. */
41 nto_x86_register_offset (int gdbregno
)
43 if (gdbregno
>= 0 && gdbregno
< 16)
45 X86_CPU_REGISTERS
*dummy
= (void*)0;
50 return (int)&(dummy
->eax
);
52 return (int)&(dummy
->ecx
);
54 return (int)&(dummy
->edx
);
56 return (int)&(dummy
->ebx
);
58 return (int)&(dummy
->esp
);
60 return (int)&(dummy
->ebp
);
62 return (int)&(dummy
->esi
);
64 return (int)&(dummy
->edi
);
66 return (int)&(dummy
->eip
);
68 return (int)&(dummy
->efl
);
70 return (int)&(dummy
->cs
);
72 return (int)&(dummy
->ss
);
75 return (int)&(dummy
->ds
);
77 return (int)&(dummy
->es
);
79 return (int)&(dummy
->fs
);
81 return (int)&(dummy
->gs
);
91 nto_x86_arch_setup (void)
93 init_registers_i386 ();
94 the_low_target
.num_regs
= 16;
97 struct nto_target_ops the_low_target
=
101 nto_x86_register_offset
,