| 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 "i386-tdep.h" |
| 21 | 22 |
| 22 #include <windows.h> | 23 #include <windows.h> |
| 23 | 24 |
| 24 #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) | 25 #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) |
| 25 static const int mappings[] = | 26 static const int mappings[] = |
| 26 { | 27 { |
| 27 context_offset (Eax), | 28 context_offset (Eax), |
| 28 context_offset (Ecx), | 29 context_offset (Ecx), |
| 29 context_offset (Edx), | 30 context_offset (Edx), |
| 30 context_offset (Ebx), | 31 context_offset (Ebx), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 context_offset (ExtendedRegisters[13*16]), | 64 context_offset (ExtendedRegisters[13*16]), |
| 64 context_offset (ExtendedRegisters[14*16]), | 65 context_offset (ExtendedRegisters[14*16]), |
| 65 context_offset (ExtendedRegisters[15*16]), | 66 context_offset (ExtendedRegisters[15*16]), |
| 66 context_offset (ExtendedRegisters[16*16]), | 67 context_offset (ExtendedRegisters[16*16]), |
| 67 context_offset (ExtendedRegisters[17*16]), | 68 context_offset (ExtendedRegisters[17*16]), |
| 68 /* MXCSR */ | 69 /* MXCSR */ |
| 69 context_offset (ExtendedRegisters[24]) | 70 context_offset (ExtendedRegisters[24]) |
| 70 }; | 71 }; |
| 71 #undef context_offset | 72 #undef context_offset |
| 72 | 73 |
| 74 /* segment_register_p_ftype implementation for x86. */ |
| 75 |
| 76 static int |
| 77 i386_windows_segment_register_p (int regnum) |
| 78 { |
| 79 return regnum >= I386_CS_REGNUM && regnum <= I386_GS_REGNUM; |
| 80 } |
| 81 |
| 82 /* -Wmissing-prototypes */ |
| 83 extern initialize_file_ftype _initialize_i386_windows_nat; |
| 84 |
| 73 void | 85 void |
| 74 _initialize_i386_windows_nat (void) | 86 _initialize_i386_windows_nat (void) |
| 75 { | 87 { |
| 76 windows_set_context_register_offsets (mappings); | 88 windows_set_context_register_offsets (mappings); |
| 89 windows_set_segment_register_p (i386_windows_segment_register_p); |
| 77 i386_set_debug_register_length (4); | 90 i386_set_debug_register_length (4); |
| 78 } | 91 } |
| OLD | NEW |