Automatic date update in version.in
[binutils-gdb/blckswan.git] / gdb / i386-windows-nat.c
blobe54c78d78cd483729e7914b3231d1f47415e2ebb
1 /* Copyright (C) 2008-2022 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #include "defs.h"
19 #include "windows-nat.h"
20 #include "x86-nat.h"
21 #include "i386-tdep.h"
23 #include <windows.h>
25 #ifdef __x86_64__
26 #define CONTEXT WOW64_CONTEXT
27 #endif
28 #define context_offset(x) ((int)(size_t)&(((CONTEXT *)NULL)->x))
29 const int i386_mappings[] =
31 context_offset (Eax),
32 context_offset (Ecx),
33 context_offset (Edx),
34 context_offset (Ebx),
35 context_offset (Esp),
36 context_offset (Ebp),
37 context_offset (Esi),
38 context_offset (Edi),
39 context_offset (Eip),
40 context_offset (EFlags),
41 context_offset (SegCs),
42 context_offset (SegSs),
43 context_offset (SegDs),
44 context_offset (SegEs),
45 context_offset (SegFs),
46 context_offset (SegGs),
47 context_offset (FloatSave.RegisterArea[0 * 10]),
48 context_offset (FloatSave.RegisterArea[1 * 10]),
49 context_offset (FloatSave.RegisterArea[2 * 10]),
50 context_offset (FloatSave.RegisterArea[3 * 10]),
51 context_offset (FloatSave.RegisterArea[4 * 10]),
52 context_offset (FloatSave.RegisterArea[5 * 10]),
53 context_offset (FloatSave.RegisterArea[6 * 10]),
54 context_offset (FloatSave.RegisterArea[7 * 10]),
55 context_offset (FloatSave.ControlWord),
56 context_offset (FloatSave.StatusWord),
57 context_offset (FloatSave.TagWord),
58 context_offset (FloatSave.ErrorSelector),
59 context_offset (FloatSave.ErrorOffset),
60 context_offset (FloatSave.DataSelector),
61 context_offset (FloatSave.DataOffset),
62 context_offset (FloatSave.ErrorSelector)
63 /* XMM0-7 */ ,
64 context_offset (ExtendedRegisters[10*16]),
65 context_offset (ExtendedRegisters[11*16]),
66 context_offset (ExtendedRegisters[12*16]),
67 context_offset (ExtendedRegisters[13*16]),
68 context_offset (ExtendedRegisters[14*16]),
69 context_offset (ExtendedRegisters[15*16]),
70 context_offset (ExtendedRegisters[16*16]),
71 context_offset (ExtendedRegisters[17*16]),
72 /* MXCSR */
73 context_offset (ExtendedRegisters[24])
75 #undef context_offset
76 #undef CONTEXT
78 /* segment_register_p_ftype implementation for x86. */
80 int
81 i386_windows_segment_register_p (int regnum)
83 return regnum >= I386_CS_REGNUM && regnum <= I386_GS_REGNUM;
86 void _initialize_i386_windows_nat ();
87 void
88 _initialize_i386_windows_nat ()
90 #ifndef __x86_64__
91 x86_set_debug_register_length (4);
92 #endif