OLD | NEW |
1 /* Copyright (C) 2009-2012 Free Software Foundation, Inc. | 1 /* Copyright (C) 2009-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 "osabi.h" | 19 #include "osabi.h" |
20 #include "amd64-tdep.h" | 20 #include "amd64-tdep.h" |
21 #include "solib.h" | 21 #include "solib.h" |
22 #include "solib-target.h" | 22 #include "solib-target.h" |
23 #include "gdbtypes.h" | 23 #include "gdbtypes.h" |
24 #include "gdbcore.h" | 24 #include "gdbcore.h" |
25 #include "regcache.h" | 25 #include "regcache.h" |
| 26 #include "windows-tdep.h" |
26 | 27 |
27 /* The registers used to pass integer arguments during a function call. */ | 28 /* The registers used to pass integer arguments during a function call. */ |
28 static int amd64_windows_dummy_call_integer_regs[] = | 29 static int amd64_windows_dummy_call_integer_regs[] = |
29 { | 30 { |
30 AMD64_RCX_REGNUM, /* %rcx */ | 31 AMD64_RCX_REGNUM, /* %rcx */ |
31 AMD64_RDX_REGNUM, /* %rdx */ | 32 AMD64_RDX_REGNUM, /* %rdx */ |
32 8, /* %r8 */ | 33 8, /* %r8 */ |
33 9 /* %r9 */ | 34 9 /* %r9 */ |
34 }; | 35 }; |
35 | 36 |
(...skipping 30 matching lines...) Expand all Loading... |
66 default: | 67 default: |
67 /* For all the other types, the conventions are the same as | 68 /* For all the other types, the conventions are the same as |
68 with the System V ABI. */ | 69 with the System V ABI. */ |
69 amd64_classify (type, class); | 70 amd64_classify (type, class); |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
73 /* Implement the "return_value" gdbarch method for amd64-windows. */ | 74 /* Implement the "return_value" gdbarch method for amd64-windows. */ |
74 | 75 |
75 static enum return_value_convention | 76 static enum return_value_convention |
76 amd64_windows_return_value (struct gdbarch *gdbarch, struct type *func_type, | 77 amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, |
77 struct type *type, struct regcache *regcache, | 78 struct type *type, struct regcache *regcache, |
78 gdb_byte *readbuf, const gdb_byte *writebuf) | 79 gdb_byte *readbuf, const gdb_byte *writebuf) |
79 { | 80 { |
80 int len = TYPE_LENGTH (type); | 81 int len = TYPE_LENGTH (type); |
81 int regnum = -1; | 82 int regnum = -1; |
82 | 83 |
83 /* See if our value is returned through a register. If it is, then | 84 /* See if our value is returned through a register. If it is, then |
84 store the associated register number in REGNUM. */ | 85 store the associated register number in REGNUM. */ |
85 switch (TYPE_CODE (type)) | 86 switch (TYPE_CODE (type)) |
86 { | 87 { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 /* Function calls. */ | 168 /* Function calls. */ |
168 tdep->call_dummy_num_integer_regs = | 169 tdep->call_dummy_num_integer_regs = |
169 ARRAY_SIZE (amd64_windows_dummy_call_integer_regs); | 170 ARRAY_SIZE (amd64_windows_dummy_call_integer_regs); |
170 tdep->call_dummy_integer_regs = amd64_windows_dummy_call_integer_regs; | 171 tdep->call_dummy_integer_regs = amd64_windows_dummy_call_integer_regs; |
171 tdep->classify = amd64_windows_classify; | 172 tdep->classify = amd64_windows_classify; |
172 tdep->memory_args_by_pointer = 1; | 173 tdep->memory_args_by_pointer = 1; |
173 tdep->integer_param_regs_saved_in_caller_frame = 1; | 174 tdep->integer_param_regs_saved_in_caller_frame = 1; |
174 set_gdbarch_return_value (gdbarch, amd64_windows_return_value); | 175 set_gdbarch_return_value (gdbarch, amd64_windows_return_value); |
175 set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); | 176 set_gdbarch_skip_main_prologue (gdbarch, amd64_skip_main_prologue); |
176 | 177 |
| 178 set_gdbarch_iterate_over_objfiles_in_search_order |
| 179 (gdbarch, windows_iterate_over_objfiles_in_search_order); |
| 180 |
177 set_solib_ops (gdbarch, &solib_target_so_ops); | 181 set_solib_ops (gdbarch, &solib_target_so_ops); |
178 } | 182 } |
179 | 183 |
| 184 /* -Wmissing-prototypes */ |
| 185 extern initialize_file_ftype _initialize_amd64_windows_tdep; |
| 186 |
180 void | 187 void |
181 _initialize_amd64_windows_tdep (void) | 188 _initialize_amd64_windows_tdep (void) |
182 { | 189 { |
183 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_CYGWIN, | 190 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_CYGWIN, |
184 amd64_windows_init_abi); | 191 amd64_windows_init_abi); |
185 } | 192 } |
186 | 193 |
OLD | NEW |