OLD | NEW |
1 /* Copyright (C) 2008-2012 Free Software Foundation, Inc. | 1 /* Copyright (C) 2008-2012 Free Software Foundation, Inc. |
2 | 2 |
3 This file is part of GDB. | 3 This file is part of GDB. |
4 | 4 |
5 This program is free software; you can redistribute it and/or modify | 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 | 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 | 7 the Free Software Foundation; either version 3 of the License, or |
8 (at your option) any later version. | 8 (at your option) any later version. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, | 10 This program is distributed in the hope that it will be useful, |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 GNU General Public License for more details. | 13 GNU General Public License for more details. |
14 | 14 |
15 You should have received a copy of the GNU General Public License | 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/>. */ | 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
17 | 17 |
18 #include "defs.h" | 18 #include "defs.h" |
19 #include "windows-nat.h" | 19 #include "windows-nat.h" |
20 #include "i386-nat.h" | 20 #include "i386-nat.h" |
| 21 #include "amd64-tdep.h" |
| 22 |
21 #include <windows.h> | 23 #include <windows.h> |
22 | 24 |
23 #define context_offset(x) (offsetof (CONTEXT, x)) | 25 #define context_offset(x) (offsetof (CONTEXT, x)) |
24 static const int mappings[] = | 26 static const int mappings[] = |
25 { | 27 { |
26 context_offset (Rax), | 28 context_offset (Rax), |
27 context_offset (Rbx), | 29 context_offset (Rbx), |
28 context_offset (Rcx), | 30 context_offset (Rcx), |
29 context_offset (Rdx), | 31 context_offset (Rdx), |
30 context_offset (Rsi), | 32 context_offset (Rsi), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 context_offset (Xmm11), | 80 context_offset (Xmm11), |
79 context_offset (Xmm12), | 81 context_offset (Xmm12), |
80 context_offset (Xmm13), | 82 context_offset (Xmm13), |
81 context_offset (Xmm14), | 83 context_offset (Xmm14), |
82 context_offset (Xmm15), | 84 context_offset (Xmm15), |
83 /* MXCSR */ | 85 /* MXCSR */ |
84 context_offset (FloatSave.MxCsr) | 86 context_offset (FloatSave.MxCsr) |
85 }; | 87 }; |
86 #undef context_offset | 88 #undef context_offset |
87 | 89 |
| 90 /* segment_register_p_ftype implementation for amd64. */ |
| 91 |
| 92 static int |
| 93 amd64_windows_segment_register_p (int regnum) |
| 94 { |
| 95 return regnum >= AMD64_CS_REGNUM && regnum <= AMD64_GS_REGNUM; |
| 96 } |
| 97 |
| 98 /* -Wmissing-prototypes */ |
| 99 extern initialize_file_ftype _initialize_amd64_windows_nat; |
| 100 |
88 void | 101 void |
89 _initialize_amd64_windows_nat (void) | 102 _initialize_amd64_windows_nat (void) |
90 { | 103 { |
91 windows_set_context_register_offsets (mappings); | 104 windows_set_context_register_offsets (mappings); |
| 105 windows_set_segment_register_p (amd64_windows_segment_register_p); |
92 i386_set_debug_register_length (8); | 106 i386_set_debug_register_length (8); |
93 } | 107 } |
OLD | NEW |