Commit | Line | Data |
---|---|---|
59233f88 AC |
1 | /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */ |
2 | ||
adf40b2e | 3 | /* Dynamic architecture support for GDB, the GNU debugger. |
79d45cd4 | 4 | |
424163ea DJ |
5 | Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
6 | Free Software Foundation, Inc. | |
c906108c | 7 | |
96baa820 JM |
8 | This file is part of GDB. |
9 | ||
10 | This program is free software; you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 12 | the Free Software Foundation; either version 3 of the License, or |
96baa820 | 13 | (at your option) any later version. |
c906108c | 14 | |
96baa820 JM |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
c906108c | 19 | |
96baa820 | 20 | You should have received a copy of the GNU General Public License |
a9762ec7 | 21 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
adf40b2e | 22 | |
104c1213 JM |
23 | /* This file was created with the aid of ``gdbarch.sh''. |
24 | ||
52204a0b | 25 | The Bourne shell script ``gdbarch.sh'' creates the files |
104c1213 JM |
26 | ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them |
27 | against the existing ``gdbarch.[hc]''. Any differences found | |
28 | being reported. | |
29 | ||
30 | If editing this file, please also run gdbarch.sh and merge any | |
52204a0b | 31 | changes into that script. Conversely, when making sweeping changes |
104c1213 JM |
32 | to this file, modifying gdbarch.sh and using its output may prove |
33 | easier. */ | |
c906108c | 34 | |
c906108c SS |
35 | |
36 | #include "defs.h" | |
1ad03bde | 37 | #include "arch-utils.h" |
c906108c | 38 | |
0f71a2f6 | 39 | #include "gdbcmd.h" |
faaf634c | 40 | #include "inferior.h" |
7a292a7a | 41 | #include "symcat.h" |
c906108c | 42 | |
f0d4cc9e | 43 | #include "floatformat.h" |
c906108c | 44 | |
95160752 | 45 | #include "gdb_assert.h" |
b66d6d2e | 46 | #include "gdb_string.h" |
67c2c32c | 47 | #include "gdb-events.h" |
b59ff9d5 | 48 | #include "reggroups.h" |
4be87837 | 49 | #include "osabi.h" |
aebd7893 | 50 | #include "gdb_obstack.h" |
95160752 | 51 | |
104c1213 JM |
52 | /* Static function declarations */ |
53 | ||
b3cc3077 | 54 | static void alloc_gdbarch_data (struct gdbarch *); |
104c1213 | 55 | |
0f71a2f6 JM |
56 | /* Non-zero if we want to trace architecture code. */ |
57 | ||
58 | #ifndef GDBARCH_DEBUG | |
59 | #define GDBARCH_DEBUG 0 | |
60 | #endif | |
61 | int gdbarch_debug = GDBARCH_DEBUG; | |
920d2a44 AC |
62 | static void |
63 | show_gdbarch_debug (struct ui_file *file, int from_tty, | |
64 | struct cmd_list_element *c, const char *value) | |
65 | { | |
66 | fprintf_filtered (file, _("Architecture debugging is %s.\n"), value); | |
67 | } | |
0f71a2f6 | 68 | |
456fcf94 | 69 | static const char * |
8da61cc4 | 70 | pformat (const struct floatformat **format) |
456fcf94 AC |
71 | { |
72 | if (format == NULL) | |
73 | return "(null)"; | |
74 | else | |
8da61cc4 DJ |
75 | /* Just print out one of them - this is only for diagnostics. */ |
76 | return format[0]->name; | |
456fcf94 AC |
77 | } |
78 | ||
0f71a2f6 JM |
79 | |
80 | /* Maintain the struct gdbarch object */ | |
81 | ||
82 | struct gdbarch | |
adf40b2e | 83 | { |
76860b5f AC |
84 | /* Has this architecture been fully initialized? */ |
85 | int initialized_p; | |
aebd7893 AC |
86 | |
87 | /* An obstack bound to the lifetime of the architecture. */ | |
88 | struct obstack *obstack; | |
89 | ||
adf40b2e JM |
90 | /* basic architectural information */ |
91 | const struct bfd_arch_info * bfd_arch_info; | |
92 | int byte_order; | |
4be87837 | 93 | enum gdb_osabi osabi; |
424163ea | 94 | const struct target_desc * target_desc; |
0f71a2f6 | 95 | |
adf40b2e JM |
96 | /* target specific vector. */ |
97 | struct gdbarch_tdep *tdep; | |
4b9b3959 | 98 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 99 | |
adf40b2e | 100 | /* per-architecture data-pointers */ |
95160752 | 101 | unsigned nr_data; |
adf40b2e | 102 | void **data; |
0f71a2f6 | 103 | |
adf40b2e JM |
104 | /* per-architecture swap-regions */ |
105 | struct gdbarch_swap *swap; | |
0f71a2f6 | 106 | |
adf40b2e | 107 | /* Multi-arch values. |
0f71a2f6 | 108 | |
adf40b2e | 109 | When extending this structure you must: |
0f71a2f6 | 110 | |
adf40b2e | 111 | Add the field below. |
0f71a2f6 | 112 | |
adf40b2e JM |
113 | Declare set/get functions and define the corresponding |
114 | macro in gdbarch.h. | |
0f71a2f6 | 115 | |
adf40b2e JM |
116 | gdbarch_alloc(): If zero/NULL is not a suitable default, |
117 | initialize the new field. | |
0f71a2f6 | 118 | |
adf40b2e JM |
119 | verify_gdbarch(): Confirm that the target updated the field |
120 | correctly. | |
0f71a2f6 | 121 | |
7e73cedf | 122 | gdbarch_dump(): Add a fprintf_unfiltered call so that the new |
adf40b2e | 123 | field is dumped out |
0f71a2f6 | 124 | |
c0e8c252 | 125 | ``startup_gdbarch()'': Append an initial value to the static |
adf40b2e | 126 | variable (base values on the host's c-type system). |
0f71a2f6 | 127 | |
adf40b2e JM |
128 | get_gdbarch(): Implement the set/get functions (probably using |
129 | the macro's as shortcuts). | |
0f71a2f6 JM |
130 | |
131 | */ | |
132 | ||
adf40b2e JM |
133 | int short_bit; |
134 | int int_bit; | |
135 | int long_bit; | |
136 | int long_long_bit; | |
137 | int float_bit; | |
8da61cc4 | 138 | const struct floatformat ** float_format; |
adf40b2e | 139 | int double_bit; |
8da61cc4 | 140 | const struct floatformat ** double_format; |
adf40b2e | 141 | int long_double_bit; |
8da61cc4 | 142 | const struct floatformat ** long_double_format; |
66b43ecb | 143 | int ptr_bit; |
52204a0b | 144 | int addr_bit; |
4e409299 | 145 | int char_signed; |
adf40b2e JM |
146 | gdbarch_read_pc_ftype *read_pc; |
147 | gdbarch_write_pc_ftype *write_pc; | |
39d4ef09 | 148 | gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; |
d8124050 AC |
149 | gdbarch_pseudo_register_read_ftype *pseudo_register_read; |
150 | gdbarch_pseudo_register_write_ftype *pseudo_register_write; | |
adf40b2e | 151 | int num_regs; |
0aba1244 | 152 | int num_pseudo_regs; |
adf40b2e | 153 | int sp_regnum; |
adf40b2e | 154 | int pc_regnum; |
c2169756 | 155 | int ps_regnum; |
60054393 | 156 | int fp0_regnum; |
88c72b7d AC |
157 | gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum; |
158 | gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum; | |
159 | gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum; | |
160 | gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum; | |
161 | gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum; | |
adf40b2e | 162 | gdbarch_register_name_ftype *register_name; |
9c04cab7 | 163 | gdbarch_register_type_ftype *register_type; |
f3be58bc | 164 | gdbarch_unwind_dummy_id_ftype *unwind_dummy_id; |
f3be58bc | 165 | int deprecated_fp_regnum; |
b8de8283 | 166 | gdbarch_push_dummy_call_ftype *push_dummy_call; |
adf40b2e | 167 | int call_dummy_location; |
7043d8dc | 168 | gdbarch_push_dummy_code_ftype *push_dummy_code; |
b8de8283 AC |
169 | gdbarch_print_registers_info_ftype *print_registers_info; |
170 | gdbarch_print_float_info_ftype *print_float_info; | |
171 | gdbarch_print_vector_info_ftype *print_vector_info; | |
172 | gdbarch_register_sim_regno_ftype *register_sim_regno; | |
b8de8283 AC |
173 | gdbarch_cannot_fetch_register_ftype *cannot_fetch_register; |
174 | gdbarch_cannot_store_register_ftype *cannot_store_register; | |
175 | gdbarch_get_longjmp_target_ftype *get_longjmp_target; | |
adf40b2e | 176 | int believe_pcc_promotion; |
13d01224 AC |
177 | gdbarch_convert_register_p_ftype *convert_register_p; |
178 | gdbarch_register_to_value_ftype *register_to_value; | |
179 | gdbarch_value_to_register_ftype *value_to_register; | |
9acbedc0 | 180 | gdbarch_value_from_register_ftype *value_from_register; |
4478b372 JB |
181 | gdbarch_pointer_to_address_ftype *pointer_to_address; |
182 | gdbarch_address_to_pointer_ftype *address_to_pointer; | |
fc0c74b1 | 183 | gdbarch_integer_to_address_ftype *integer_to_address; |
92ad9cd9 | 184 | gdbarch_return_value_ftype *return_value; |
ebba8386 | 185 | gdbarch_extract_return_value_ftype *extract_return_value; |
adf40b2e | 186 | gdbarch_store_return_value_ftype *store_return_value; |
b5622e8d | 187 | gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention; |
adf40b2e JM |
188 | gdbarch_skip_prologue_ftype *skip_prologue; |
189 | gdbarch_inner_than_ftype *inner_than; | |
190 | gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; | |
a1131521 | 191 | gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address; |
917317f4 JM |
192 | gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint; |
193 | gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint; | |
adf40b2e | 194 | CORE_ADDR decr_pc_after_break; |
782263ab | 195 | CORE_ADDR deprecated_function_start_offset; |
123dc839 | 196 | gdbarch_remote_register_number_ftype *remote_register_number; |
b2756930 | 197 | gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address; |
adf40b2e | 198 | CORE_ADDR frame_args_skip; |
12cc2063 | 199 | gdbarch_unwind_pc_ftype *unwind_pc; |
a9e5fdc2 | 200 | gdbarch_unwind_sp_ftype *unwind_sp; |
adf40b2e | 201 | gdbarch_frame_num_args_ftype *frame_num_args; |
dc604539 | 202 | gdbarch_frame_align_ftype *frame_align; |
88d89dbb | 203 | gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr; |
192cb3d4 | 204 | gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr; |
8b148df9 | 205 | int frame_red_zone_size; |
f517ea4e | 206 | gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr; |
875e1767 | 207 | gdbarch_addr_bits_remove_ftype *addr_bits_remove; |
181c1381 | 208 | gdbarch_smash_text_address_ftype *smash_text_address; |
64c4637f | 209 | gdbarch_software_single_step_ftype *software_single_step; |
3352ef37 | 210 | gdbarch_single_step_through_delay_ftype *single_step_through_delay; |
2bf0cb65 | 211 | gdbarch_print_insn_ftype *print_insn; |
bdcd319a | 212 | gdbarch_skip_trampoline_code_ftype *skip_trampoline_code; |
dea0c52f | 213 | gdbarch_skip_solib_resolver_ftype *skip_solib_resolver; |
d50355b6 | 214 | gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline; |
c12260ac | 215 | gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p; |
552c04a7 | 216 | gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; |
a2cf933a EZ |
217 | gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; |
218 | gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; | |
5720643c | 219 | const char * name_of_malloc; |
c4ed33b9 | 220 | int cannot_step_breakpoint; |
f74fa174 | 221 | int have_nonsteppable_watchpoint; |
8b2dbe47 KB |
222 | gdbarch_address_class_type_flags_ftype *address_class_type_flags; |
223 | gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name; | |
224 | gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags; | |
b59ff9d5 | 225 | gdbarch_register_reggroup_p_ftype *register_reggroup_p; |
143985b7 | 226 | gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument; |
6ce6d90f | 227 | gdbarch_regset_from_core_section_ftype *regset_from_core_section; |
0d5de010 DJ |
228 | int vtable_function_descriptors; |
229 | int vbit_in_delta; | |
6d350bb5 | 230 | gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint; |
1c772458 | 231 | gdbarch_overlay_update_ftype *overlay_update; |
adf40b2e | 232 | }; |
0f71a2f6 JM |
233 | |
234 | ||
235 | /* The default architecture uses host values (for want of a better | |
236 | choice). */ | |
237 | ||
238 | extern const struct bfd_arch_info bfd_default_arch_struct; | |
239 | ||
4b9b3959 AC |
240 | struct gdbarch startup_gdbarch = |
241 | { | |
76860b5f | 242 | 1, /* Always initialized. */ |
aebd7893 | 243 | NULL, /* The obstack. */ |
0f71a2f6 | 244 | /* basic architecture information */ |
ec5cbaec AC |
245 | &bfd_default_arch_struct, /* bfd_arch_info */ |
246 | BFD_ENDIAN_BIG, /* byte_order */ | |
247 | GDB_OSABI_UNKNOWN, /* osabi */ | |
424163ea | 248 | 0, /* target_desc */ |
4b9b3959 AC |
249 | /* target specific vector and its dump routine */ |
250 | NULL, NULL, | |
0f71a2f6 JM |
251 | /*per-architecture data-pointers and swap regions */ |
252 | 0, NULL, NULL, | |
253 | /* Multi-arch values */ | |
ec5cbaec AC |
254 | 8 * sizeof (short), /* short_bit */ |
255 | 8 * sizeof (int), /* int_bit */ | |
256 | 8 * sizeof (long), /* long_bit */ | |
257 | 8 * sizeof (LONGEST), /* long_long_bit */ | |
258 | 8 * sizeof (float), /* float_bit */ | |
456fcf94 | 259 | 0, /* float_format */ |
ec5cbaec | 260 | 8 * sizeof (double), /* double_bit */ |
456fcf94 | 261 | 0, /* double_format */ |
ec5cbaec | 262 | 8 * sizeof (long double), /* long_double_bit */ |
456fcf94 | 263 | 0, /* long_double_format */ |
ec5cbaec AC |
264 | 8 * sizeof (void*), /* ptr_bit */ |
265 | 8 * sizeof (void*), /* addr_bit */ | |
ec5cbaec AC |
266 | 1, /* char_signed */ |
267 | 0, /* read_pc */ | |
268 | 0, /* write_pc */ | |
ec5cbaec AC |
269 | 0, /* virtual_frame_pointer */ |
270 | 0, /* pseudo_register_read */ | |
271 | 0, /* pseudo_register_write */ | |
272 | 0, /* num_regs */ | |
273 | 0, /* num_pseudo_regs */ | |
274 | -1, /* sp_regnum */ | |
ec5cbaec AC |
275 | -1, /* pc_regnum */ |
276 | -1, /* ps_regnum */ | |
277 | 0, /* fp0_regnum */ | |
ec5cbaec AC |
278 | 0, /* stab_reg_to_regnum */ |
279 | 0, /* ecoff_reg_to_regnum */ | |
280 | 0, /* dwarf_reg_to_regnum */ | |
281 | 0, /* sdb_reg_to_regnum */ | |
282 | 0, /* dwarf2_reg_to_regnum */ | |
283 | 0, /* register_name */ | |
9c04cab7 | 284 | 0, /* register_type */ |
f3be58bc | 285 | 0, /* unwind_dummy_id */ |
f3be58bc | 286 | -1, /* deprecated_fp_regnum */ |
b8de8283 | 287 | 0, /* push_dummy_call */ |
ec5cbaec | 288 | 0, /* call_dummy_location */ |
ec5cbaec | 289 | 0, /* push_dummy_code */ |
b8de8283 AC |
290 | default_print_registers_info, /* print_registers_info */ |
291 | 0, /* print_float_info */ | |
292 | 0, /* print_vector_info */ | |
293 | 0, /* register_sim_regno */ | |
b8de8283 AC |
294 | 0, /* cannot_fetch_register */ |
295 | 0, /* cannot_store_register */ | |
296 | 0, /* get_longjmp_target */ | |
ec5cbaec | 297 | 0, /* believe_pcc_promotion */ |
ec5cbaec AC |
298 | 0, /* convert_register_p */ |
299 | 0, /* register_to_value */ | |
300 | 0, /* value_to_register */ | |
9acbedc0 | 301 | 0, /* value_from_register */ |
ec5cbaec AC |
302 | 0, /* pointer_to_address */ |
303 | 0, /* address_to_pointer */ | |
304 | 0, /* integer_to_address */ | |
92ad9cd9 | 305 | 0, /* return_value */ |
ec5cbaec AC |
306 | 0, /* extract_return_value */ |
307 | 0, /* store_return_value */ | |
b5622e8d | 308 | 0, /* deprecated_use_struct_convention */ |
ec5cbaec | 309 | 0, /* skip_prologue */ |
ec5cbaec AC |
310 | 0, /* inner_than */ |
311 | 0, /* breakpoint_from_pc */ | |
a1131521 | 312 | 0, /* adjust_breakpoint_address */ |
ec5cbaec AC |
313 | 0, /* memory_insert_breakpoint */ |
314 | 0, /* memory_remove_breakpoint */ | |
315 | 0, /* decr_pc_after_break */ | |
782263ab | 316 | 0, /* deprecated_function_start_offset */ |
123dc839 | 317 | default_remote_register_number, /* remote_register_number */ |
b2756930 | 318 | 0, /* fetch_tls_load_module_address */ |
ec5cbaec | 319 | 0, /* frame_args_skip */ |
ec5cbaec | 320 | 0, /* unwind_pc */ |
a9e5fdc2 | 321 | 0, /* unwind_sp */ |
ec5cbaec | 322 | 0, /* frame_num_args */ |
ec5cbaec | 323 | 0, /* frame_align */ |
88d89dbb | 324 | 0, /* deprecated_reg_struct_has_addr */ |
192cb3d4 | 325 | default_stabs_argument_has_addr, /* stabs_argument_has_addr */ |
8b148df9 | 326 | 0, /* frame_red_zone_size */ |
e2d0e7eb | 327 | convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */ |
ec5cbaec AC |
328 | 0, /* addr_bits_remove */ |
329 | 0, /* smash_text_address */ | |
330 | 0, /* software_single_step */ | |
3352ef37 | 331 | 0, /* single_step_through_delay */ |
ec5cbaec AC |
332 | 0, /* print_insn */ |
333 | 0, /* skip_trampoline_code */ | |
4c8c40e6 | 334 | generic_skip_solib_resolver, /* skip_solib_resolver */ |
ec5cbaec | 335 | 0, /* in_solib_return_trampoline */ |
ec5cbaec AC |
336 | generic_in_function_epilogue_p, /* in_function_epilogue_p */ |
337 | construct_inferior_arguments, /* construct_inferior_arguments */ | |
ec5cbaec AC |
338 | 0, /* elf_make_msymbol_special */ |
339 | 0, /* coff_make_msymbol_special */ | |
340 | "malloc", /* name_of_malloc */ | |
341 | 0, /* cannot_step_breakpoint */ | |
342 | 0, /* have_nonsteppable_watchpoint */ | |
343 | 0, /* address_class_type_flags */ | |
344 | 0, /* address_class_type_flags_to_name */ | |
345 | 0, /* address_class_name_to_type_flags */ | |
346 | default_register_reggroup_p, /* register_reggroup_p */ | |
347 | 0, /* fetch_pointer_argument */ | |
6ce6d90f | 348 | 0, /* regset_from_core_section */ |
0d5de010 DJ |
349 | 0, /* vtable_function_descriptors */ |
350 | 0, /* vbit_in_delta */ | |
6d350bb5 | 351 | 0, /* skip_permanent_breakpoint */ |
1c772458 | 352 | 0, /* overlay_update */ |
c0e8c252 | 353 | /* startup_gdbarch() */ |
0f71a2f6 | 354 | }; |
4b9b3959 | 355 | |
c0e8c252 | 356 | struct gdbarch *current_gdbarch = &startup_gdbarch; |
0f71a2f6 | 357 | |
66b43ecb | 358 | /* Create a new ``struct gdbarch'' based on information provided by |
0f71a2f6 JM |
359 | ``struct gdbarch_info''. */ |
360 | ||
361 | struct gdbarch * | |
104c1213 JM |
362 | gdbarch_alloc (const struct gdbarch_info *info, |
363 | struct gdbarch_tdep *tdep) | |
0f71a2f6 | 364 | { |
85de9627 | 365 | /* NOTE: The new architecture variable is named ``current_gdbarch'' |
ea06eb3d | 366 | so that macros such as TARGET_ARCHITECTURE, when expanded, refer to |
85de9627 AC |
367 | the current local architecture and not the previous global |
368 | architecture. This ensures that the new architectures initial | |
369 | values are not influenced by the previous architecture. Once | |
370 | everything is parameterised with gdbarch, this will go away. */ | |
aebd7893 AC |
371 | struct gdbarch *current_gdbarch; |
372 | ||
373 | /* Create an obstack for allocating all the per-architecture memory, | |
374 | then use that to allocate the architecture vector. */ | |
375 | struct obstack *obstack = XMALLOC (struct obstack); | |
376 | obstack_init (obstack); | |
377 | current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch)); | |
85de9627 | 378 | memset (current_gdbarch, 0, sizeof (*current_gdbarch)); |
aebd7893 | 379 | current_gdbarch->obstack = obstack; |
0f71a2f6 | 380 | |
85de9627 | 381 | alloc_gdbarch_data (current_gdbarch); |
b3cc3077 | 382 | |
85de9627 | 383 | current_gdbarch->tdep = tdep; |
0f71a2f6 | 384 | |
85de9627 AC |
385 | current_gdbarch->bfd_arch_info = info->bfd_arch_info; |
386 | current_gdbarch->byte_order = info->byte_order; | |
4be87837 | 387 | current_gdbarch->osabi = info->osabi; |
424163ea | 388 | current_gdbarch->target_desc = info->target_desc; |
0f71a2f6 JM |
389 | |
390 | /* Force the explicit initialization of these. */ | |
85de9627 AC |
391 | current_gdbarch->short_bit = 2*TARGET_CHAR_BIT; |
392 | current_gdbarch->int_bit = 4*TARGET_CHAR_BIT; | |
393 | current_gdbarch->long_bit = 4*TARGET_CHAR_BIT; | |
9a76efb6 | 394 | current_gdbarch->long_long_bit = 2*current_gdbarch->long_bit; |
85de9627 AC |
395 | current_gdbarch->float_bit = 4*TARGET_CHAR_BIT; |
396 | current_gdbarch->double_bit = 8*TARGET_CHAR_BIT; | |
17ef5d92 | 397 | current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT; |
9a76efb6 | 398 | current_gdbarch->ptr_bit = current_gdbarch->int_bit; |
4e409299 | 399 | current_gdbarch->char_signed = -1; |
85de9627 AC |
400 | current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer; |
401 | current_gdbarch->num_regs = -1; | |
402 | current_gdbarch->sp_regnum = -1; | |
85de9627 | 403 | current_gdbarch->pc_regnum = -1; |
c2169756 | 404 | current_gdbarch->ps_regnum = -1; |
85de9627 | 405 | current_gdbarch->fp0_regnum = -1; |
85de9627 AC |
406 | current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum; |
407 | current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum; | |
408 | current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum; | |
409 | current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum; | |
410 | current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum; | |
f3be58bc | 411 | current_gdbarch->deprecated_fp_regnum = -1; |
b99fa2d2 | 412 | current_gdbarch->call_dummy_location = AT_ENTRY_POINT; |
b8de8283 AC |
413 | current_gdbarch->print_registers_info = default_print_registers_info; |
414 | current_gdbarch->register_sim_regno = legacy_register_sim_regno; | |
415 | current_gdbarch->cannot_fetch_register = cannot_register_not; | |
416 | current_gdbarch->cannot_store_register = cannot_register_not; | |
a1f4a1b6 | 417 | current_gdbarch->convert_register_p = generic_convert_register_p; |
9acbedc0 | 418 | current_gdbarch->value_from_register = default_value_from_register; |
85de9627 AC |
419 | current_gdbarch->pointer_to_address = unsigned_pointer_to_address; |
420 | current_gdbarch->address_to_pointer = unsigned_address_to_pointer; | |
750eb019 | 421 | current_gdbarch->return_value = legacy_return_value; |
b5622e8d | 422 | current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention; |
85de9627 AC |
423 | current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint; |
424 | current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint; | |
123dc839 | 425 | current_gdbarch->remote_register_number = default_remote_register_number; |
192cb3d4 | 426 | current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr; |
e2d0e7eb | 427 | current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity; |
85de9627 | 428 | current_gdbarch->addr_bits_remove = core_addr_identity; |
181c1381 | 429 | current_gdbarch->smash_text_address = core_addr_identity; |
85de9627 | 430 | current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code; |
dea0c52f | 431 | current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver; |
d50355b6 | 432 | current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline; |
c12260ac | 433 | current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p; |
552c04a7 | 434 | current_gdbarch->construct_inferior_arguments = construct_inferior_arguments; |
a2cf933a EZ |
435 | current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; |
436 | current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; | |
5720643c | 437 | current_gdbarch->name_of_malloc = "malloc"; |
b59ff9d5 | 438 | current_gdbarch->register_reggroup_p = default_register_reggroup_p; |
0f71a2f6 JM |
439 | /* gdbarch_alloc() */ |
440 | ||
85de9627 | 441 | return current_gdbarch; |
0f71a2f6 JM |
442 | } |
443 | ||
444 | ||
aebd7893 AC |
445 | /* Allocate extra space using the per-architecture obstack. */ |
446 | ||
447 | void * | |
448 | gdbarch_obstack_zalloc (struct gdbarch *arch, long size) | |
449 | { | |
450 | void *data = obstack_alloc (arch->obstack, size); | |
451 | memset (data, 0, size); | |
452 | return data; | |
453 | } | |
454 | ||
455 | ||
058f20d5 JB |
456 | /* Free a gdbarch struct. This should never happen in normal |
457 | operation --- once you've created a gdbarch, you keep it around. | |
458 | However, if an architecture's init function encounters an error | |
459 | building the structure, it may need to clean up a partially | |
460 | constructed gdbarch. */ | |
4b9b3959 | 461 | |
058f20d5 JB |
462 | void |
463 | gdbarch_free (struct gdbarch *arch) | |
464 | { | |
aebd7893 | 465 | struct obstack *obstack; |
95160752 | 466 | gdb_assert (arch != NULL); |
aebd7893 AC |
467 | gdb_assert (!arch->initialized_p); |
468 | obstack = arch->obstack; | |
469 | obstack_free (obstack, 0); /* Includes the ARCH. */ | |
470 | xfree (obstack); | |
058f20d5 JB |
471 | } |
472 | ||
473 | ||
db446970 AC |
474 | /* Ensure that all values in a GDBARCH are reasonable. */ |
475 | ||
476 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it | |
477 | just happens to match the global variable ``current_gdbarch''. That | |
478 | way macros refering to that variable get the local and not the global | |
479 | version - ulgh. Once everything is parameterised with gdbarch, this | |
480 | will go away. */ | |
0f71a2f6 | 481 | |
0f71a2f6 | 482 | static void |
db446970 | 483 | verify_gdbarch (struct gdbarch *current_gdbarch) |
0f71a2f6 | 484 | { |
f16a1923 AC |
485 | struct ui_file *log; |
486 | struct cleanup *cleanups; | |
487 | long dummy; | |
488 | char *buf; | |
f16a1923 AC |
489 | log = mem_fileopen (); |
490 | cleanups = make_cleanup_ui_file_delete (log); | |
0f71a2f6 | 491 | /* fundamental */ |
db446970 | 492 | if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN) |
f16a1923 | 493 | fprintf_unfiltered (log, "\n\tbyte-order"); |
db446970 | 494 | if (current_gdbarch->bfd_arch_info == NULL) |
f16a1923 | 495 | fprintf_unfiltered (log, "\n\tbfd_arch_info"); |
0f71a2f6 | 496 | /* Check those that need to be defined for the given multi-arch level. */ |
66b43ecb AC |
497 | /* Skip verify of short_bit, invalid_p == 0 */ |
498 | /* Skip verify of int_bit, invalid_p == 0 */ | |
499 | /* Skip verify of long_bit, invalid_p == 0 */ | |
500 | /* Skip verify of long_long_bit, invalid_p == 0 */ | |
501 | /* Skip verify of float_bit, invalid_p == 0 */ | |
456fcf94 | 502 | if (current_gdbarch->float_format == 0) |
8da61cc4 | 503 | current_gdbarch->float_format = floatformats_ieee_single; |
66b43ecb | 504 | /* Skip verify of double_bit, invalid_p == 0 */ |
456fcf94 | 505 | if (current_gdbarch->double_format == 0) |
8da61cc4 | 506 | current_gdbarch->double_format = floatformats_ieee_double; |
66b43ecb | 507 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
456fcf94 | 508 | if (current_gdbarch->long_double_format == 0) |
8da61cc4 | 509 | current_gdbarch->long_double_format = floatformats_ieee_double; |
66b43ecb | 510 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
db446970 | 511 | if (current_gdbarch->addr_bit == 0) |
819844ad | 512 | current_gdbarch->addr_bit = gdbarch_ptr_bit (current_gdbarch); |
db446970 AC |
513 | if (current_gdbarch->char_signed == -1) |
514 | current_gdbarch->char_signed = 1; | |
cde9ea48 | 515 | /* Skip verify of read_pc, has predicate */ |
61a1198a | 516 | /* Skip verify of write_pc, has predicate */ |
39d4ef09 | 517 | /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ |
d8124050 AC |
518 | /* Skip verify of pseudo_register_read, has predicate */ |
519 | /* Skip verify of pseudo_register_write, has predicate */ | |
4d60522e | 520 | if (current_gdbarch->num_regs == -1) |
f16a1923 | 521 | fprintf_unfiltered (log, "\n\tnum_regs"); |
0aba1244 | 522 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1200cd6e | 523 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
1200cd6e | 524 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
c2169756 | 525 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
60054393 | 526 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
88c72b7d AC |
527 | /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */ |
528 | /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */ | |
529 | /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */ | |
530 | /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */ | |
531 | /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ | |
9c04cab7 | 532 | /* Skip verify of register_type, has predicate */ |
f3be58bc | 533 | /* Skip verify of unwind_dummy_id, has predicate */ |
f3be58bc | 534 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ |
b8de8283 | 535 | /* Skip verify of push_dummy_call, has predicate */ |
b8de8283 | 536 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
b8de8283 | 537 | /* Skip verify of push_dummy_code, has predicate */ |
0ab7a791 | 538 | /* Skip verify of print_registers_info, invalid_p == 0 */ |
23e3a7ac | 539 | /* Skip verify of print_float_info, has predicate */ |
e76f1f2e | 540 | /* Skip verify of print_vector_info, has predicate */ |
7c7651b2 | 541 | /* Skip verify of register_sim_regno, invalid_p == 0 */ |
01fb7433 AC |
542 | /* Skip verify of cannot_fetch_register, invalid_p == 0 */ |
543 | /* Skip verify of cannot_store_register, invalid_p == 0 */ | |
9df628e0 | 544 | /* Skip verify of get_longjmp_target, has predicate */ |
13d01224 | 545 | /* Skip verify of convert_register_p, invalid_p == 0 */ |
9acbedc0 | 546 | /* Skip verify of value_from_register, invalid_p == 0 */ |
4478b372 JB |
547 | /* Skip verify of pointer_to_address, invalid_p == 0 */ |
548 | /* Skip verify of address_to_pointer, invalid_p == 0 */ | |
fc0c74b1 | 549 | /* Skip verify of integer_to_address, has predicate */ |
92ad9cd9 | 550 | /* Skip verify of return_value, has predicate */ |
b5622e8d | 551 | /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */ |
4d60522e | 552 | if (current_gdbarch->skip_prologue == 0) |
f16a1923 | 553 | fprintf_unfiltered (log, "\n\tskip_prologue"); |
4d60522e | 554 | if (current_gdbarch->inner_than == 0) |
f16a1923 | 555 | fprintf_unfiltered (log, "\n\tinner_than"); |
4d60522e | 556 | if (current_gdbarch->breakpoint_from_pc == 0) |
aaab4dba | 557 | fprintf_unfiltered (log, "\n\tbreakpoint_from_pc"); |
a1131521 | 558 | /* Skip verify of adjust_breakpoint_address, has predicate */ |
c0e8c252 AC |
559 | /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ |
560 | /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ | |
71bd6bd4 | 561 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
782263ab | 562 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
123dc839 | 563 | /* Skip verify of remote_register_number, invalid_p == 0 */ |
b2756930 | 564 | /* Skip verify of fetch_tls_load_module_address, has predicate */ |
5867a2fb | 565 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
12cc2063 | 566 | /* Skip verify of unwind_pc, has predicate */ |
a9e5fdc2 | 567 | /* Skip verify of unwind_sp, has predicate */ |
983a287a | 568 | /* Skip verify of frame_num_args, has predicate */ |
dc604539 | 569 | /* Skip verify of frame_align, has predicate */ |
88d89dbb | 570 | /* Skip verify of deprecated_reg_struct_has_addr, has predicate */ |
192cb3d4 | 571 | /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */ |
f517ea4e | 572 | /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */ |
875e1767 | 573 | /* Skip verify of addr_bits_remove, invalid_p == 0 */ |
181c1381 | 574 | /* Skip verify of smash_text_address, invalid_p == 0 */ |
64c4637f | 575 | /* Skip verify of software_single_step, has predicate */ |
3352ef37 | 576 | /* Skip verify of single_step_through_delay, has predicate */ |
4d60522e | 577 | if (current_gdbarch->print_insn == 0) |
f6c40618 | 578 | fprintf_unfiltered (log, "\n\tprint_insn"); |
bdcd319a | 579 | /* Skip verify of skip_trampoline_code, invalid_p == 0 */ |
dea0c52f | 580 | /* Skip verify of skip_solib_resolver, invalid_p == 0 */ |
d50355b6 | 581 | /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ |
c12260ac | 582 | /* Skip verify of in_function_epilogue_p, invalid_p == 0 */ |
552c04a7 | 583 | /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ |
a2cf933a EZ |
584 | /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ |
585 | /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ | |
5720643c | 586 | /* Skip verify of name_of_malloc, invalid_p == 0 */ |
c4ed33b9 | 587 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ |
f74fa174 | 588 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ |
8b2dbe47 KB |
589 | /* Skip verify of address_class_type_flags, has predicate */ |
590 | /* Skip verify of address_class_type_flags_to_name, has predicate */ | |
591 | /* Skip verify of address_class_name_to_type_flags, has predicate */ | |
7e20f3fb | 592 | /* Skip verify of register_reggroup_p, invalid_p == 0 */ |
143985b7 | 593 | /* Skip verify of fetch_pointer_argument, has predicate */ |
6ce6d90f | 594 | /* Skip verify of regset_from_core_section, has predicate */ |
0d5de010 DJ |
595 | /* Skip verify of vtable_function_descriptors, invalid_p == 0 */ |
596 | /* Skip verify of vbit_in_delta, invalid_p == 0 */ | |
6d350bb5 | 597 | /* Skip verify of skip_permanent_breakpoint, has predicate */ |
1c772458 | 598 | /* Skip verify of overlay_update, has predicate */ |
f16a1923 AC |
599 | buf = ui_file_xstrdup (log, &dummy); |
600 | make_cleanup (xfree, buf); | |
601 | if (strlen (buf) > 0) | |
602 | internal_error (__FILE__, __LINE__, | |
e2e0b3e5 | 603 | _("verify_gdbarch: the following are invalid ...%s"), |
f16a1923 AC |
604 | buf); |
605 | do_cleanups (cleanups); | |
0f71a2f6 JM |
606 | } |
607 | ||
608 | ||
609 | /* Print out the details of the current architecture. */ | |
610 | ||
4b9b3959 AC |
611 | /* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it |
612 | just happens to match the global variable ``current_gdbarch''. That | |
613 | way macros refering to that variable get the local and not the global | |
614 | version - ulgh. Once everything is parameterised with gdbarch, this | |
615 | will go away. */ | |
616 | ||
0f71a2f6 | 617 | void |
db446970 | 618 | gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) |
0f71a2f6 | 619 | { |
b78960be AC |
620 | const char *gdb_xm_file = "<not-defined>"; |
621 | const char *gdb_nm_file = "<not-defined>"; | |
622 | const char *gdb_tm_file = "<not-defined>"; | |
623 | #if defined (GDB_XM_FILE) | |
624 | gdb_xm_file = GDB_XM_FILE; | |
625 | #endif | |
626 | fprintf_unfiltered (file, | |
627 | "gdbarch_dump: GDB_XM_FILE = %s\n", | |
628 | gdb_xm_file); | |
629 | #if defined (GDB_NM_FILE) | |
630 | gdb_nm_file = GDB_NM_FILE; | |
631 | #endif | |
632 | fprintf_unfiltered (file, | |
633 | "gdbarch_dump: GDB_NM_FILE = %s\n", | |
634 | gdb_nm_file); | |
635 | #if defined (GDB_TM_FILE) | |
636 | gdb_tm_file = GDB_TM_FILE; | |
637 | #endif | |
4b9b3959 | 638 | fprintf_unfiltered (file, |
b78960be AC |
639 | "gdbarch_dump: GDB_TM_FILE = %s\n", |
640 | gdb_tm_file); | |
48f7351b AC |
641 | fprintf_unfiltered (file, |
642 | "gdbarch_dump: addr_bit = %s\n", | |
643 | paddr_d (current_gdbarch->addr_bit)); | |
48f7351b AC |
644 | fprintf_unfiltered (file, |
645 | "gdbarch_dump: addr_bits_remove = <0x%lx>\n", | |
646 | (long) current_gdbarch->addr_bits_remove); | |
7996bcec AC |
647 | fprintf_unfiltered (file, |
648 | "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n", | |
649 | gdbarch_address_class_name_to_type_flags_p (current_gdbarch)); | |
650 | fprintf_unfiltered (file, | |
48f7351b | 651 | "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n", |
7996bcec | 652 | (long) current_gdbarch->address_class_name_to_type_flags); |
48f7351b AC |
653 | fprintf_unfiltered (file, |
654 | "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n", | |
655 | gdbarch_address_class_type_flags_p (current_gdbarch)); | |
48f7351b AC |
656 | fprintf_unfiltered (file, |
657 | "gdbarch_dump: address_class_type_flags = <0x%lx>\n", | |
658 | (long) current_gdbarch->address_class_type_flags); | |
7996bcec AC |
659 | fprintf_unfiltered (file, |
660 | "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n", | |
661 | gdbarch_address_class_type_flags_to_name_p (current_gdbarch)); | |
662 | fprintf_unfiltered (file, | |
48f7351b | 663 | "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n", |
7996bcec | 664 | (long) current_gdbarch->address_class_type_flags_to_name); |
48f7351b AC |
665 | fprintf_unfiltered (file, |
666 | "gdbarch_dump: address_to_pointer = <0x%lx>\n", | |
667 | (long) current_gdbarch->address_to_pointer); | |
a1131521 KB |
668 | fprintf_unfiltered (file, |
669 | "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n", | |
670 | gdbarch_adjust_breakpoint_address_p (current_gdbarch)); | |
671 | fprintf_unfiltered (file, | |
48f7351b | 672 | "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n", |
a1131521 | 673 | (long) current_gdbarch->adjust_breakpoint_address); |
48f7351b AC |
674 | fprintf_unfiltered (file, |
675 | "gdbarch_dump: believe_pcc_promotion = %s\n", | |
676 | paddr_d (current_gdbarch->believe_pcc_promotion)); | |
283354d8 | 677 | fprintf_unfiltered (file, |
48f7351b | 678 | "gdbarch_dump: bfd_arch_info = %s\n", |
1143fffb | 679 | gdbarch_bfd_arch_info (current_gdbarch)->printable_name); |
48f7351b AC |
680 | fprintf_unfiltered (file, |
681 | "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n", | |
682 | (long) current_gdbarch->breakpoint_from_pc); | |
48f7351b AC |
683 | fprintf_unfiltered (file, |
684 | "gdbarch_dump: byte_order = %s\n", | |
685 | paddr_d (current_gdbarch->byte_order)); | |
48f7351b AC |
686 | fprintf_unfiltered (file, |
687 | "gdbarch_dump: call_dummy_location = %s\n", | |
688 | paddr_d (current_gdbarch->call_dummy_location)); | |
48f7351b AC |
689 | fprintf_unfiltered (file, |
690 | "gdbarch_dump: cannot_fetch_register = <0x%lx>\n", | |
691 | (long) current_gdbarch->cannot_fetch_register); | |
48f7351b AC |
692 | fprintf_unfiltered (file, |
693 | "gdbarch_dump: cannot_step_breakpoint = %s\n", | |
694 | paddr_d (current_gdbarch->cannot_step_breakpoint)); | |
48f7351b AC |
695 | fprintf_unfiltered (file, |
696 | "gdbarch_dump: cannot_store_register = <0x%lx>\n", | |
697 | (long) current_gdbarch->cannot_store_register); | |
48f7351b AC |
698 | fprintf_unfiltered (file, |
699 | "gdbarch_dump: char_signed = %s\n", | |
700 | paddr_d (current_gdbarch->char_signed)); | |
7996bcec | 701 | fprintf_unfiltered (file, |
48f7351b AC |
702 | "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n", |
703 | (long) current_gdbarch->coff_make_msymbol_special); | |
704 | fprintf_unfiltered (file, | |
705 | "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n", | |
7996bcec | 706 | (long) current_gdbarch->construct_inferior_arguments); |
a2428dbe | 707 | fprintf_unfiltered (file, |
48f7351b | 708 | "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n", |
a2428dbe | 709 | (long) current_gdbarch->convert_from_func_ptr_addr); |
48f7351b AC |
710 | fprintf_unfiltered (file, |
711 | "gdbarch_dump: convert_register_p = <0x%lx>\n", | |
712 | (long) current_gdbarch->convert_register_p); | |
48f7351b AC |
713 | fprintf_unfiltered (file, |
714 | "gdbarch_dump: decr_pc_after_break = 0x%s\n", | |
715 | paddr_nz (current_gdbarch->decr_pc_after_break)); | |
48f7351b AC |
716 | fprintf_unfiltered (file, |
717 | "gdbarch_dump: deprecated_fp_regnum = %s\n", | |
718 | paddr_d (current_gdbarch->deprecated_fp_regnum)); | |
48f7351b AC |
719 | fprintf_unfiltered (file, |
720 | "gdbarch_dump: deprecated_function_start_offset = 0x%s\n", | |
721 | paddr_nz (current_gdbarch->deprecated_function_start_offset)); | |
48f7351b AC |
722 | fprintf_unfiltered (file, |
723 | "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n", | |
724 | gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch)); | |
48f7351b AC |
725 | fprintf_unfiltered (file, |
726 | "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n", | |
727 | (long) current_gdbarch->deprecated_reg_struct_has_addr); | |
48f7351b AC |
728 | fprintf_unfiltered (file, |
729 | "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n", | |
730 | (long) current_gdbarch->deprecated_use_struct_convention); | |
48f7351b AC |
731 | fprintf_unfiltered (file, |
732 | "gdbarch_dump: double_bit = %s\n", | |
733 | paddr_d (current_gdbarch->double_bit)); | |
a2428dbe | 734 | fprintf_unfiltered (file, |
48f7351b | 735 | "gdbarch_dump: double_format = %s\n", |
456fcf94 | 736 | pformat (current_gdbarch->double_format)); |
48f7351b AC |
737 | fprintf_unfiltered (file, |
738 | "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n", | |
739 | (long) current_gdbarch->dwarf2_reg_to_regnum); | |
48f7351b AC |
740 | fprintf_unfiltered (file, |
741 | "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n", | |
742 | (long) current_gdbarch->dwarf_reg_to_regnum); | |
48f7351b AC |
743 | fprintf_unfiltered (file, |
744 | "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n", | |
745 | (long) current_gdbarch->ecoff_reg_to_regnum); | |
48f7351b AC |
746 | fprintf_unfiltered (file, |
747 | "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n", | |
748 | (long) current_gdbarch->elf_make_msymbol_special); | |
48f7351b AC |
749 | fprintf_unfiltered (file, |
750 | "gdbarch_dump: extract_return_value = <0x%lx>\n", | |
751 | (long) current_gdbarch->extract_return_value); | |
48f7351b AC |
752 | fprintf_unfiltered (file, |
753 | "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n", | |
754 | gdbarch_fetch_pointer_argument_p (current_gdbarch)); | |
48f7351b AC |
755 | fprintf_unfiltered (file, |
756 | "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n", | |
757 | (long) current_gdbarch->fetch_pointer_argument); | |
b2756930 KB |
758 | fprintf_unfiltered (file, |
759 | "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n", | |
760 | gdbarch_fetch_tls_load_module_address_p (current_gdbarch)); | |
b2756930 KB |
761 | fprintf_unfiltered (file, |
762 | "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n", | |
763 | (long) current_gdbarch->fetch_tls_load_module_address); | |
48f7351b AC |
764 | fprintf_unfiltered (file, |
765 | "gdbarch_dump: float_bit = %s\n", | |
766 | paddr_d (current_gdbarch->float_bit)); | |
a2428dbe | 767 | fprintf_unfiltered (file, |
48f7351b | 768 | "gdbarch_dump: float_format = %s\n", |
456fcf94 | 769 | pformat (current_gdbarch->float_format)); |
48f7351b AC |
770 | fprintf_unfiltered (file, |
771 | "gdbarch_dump: fp0_regnum = %s\n", | |
772 | paddr_d (current_gdbarch->fp0_regnum)); | |
a2428dbe AC |
773 | fprintf_unfiltered (file, |
774 | "gdbarch_dump: gdbarch_frame_align_p() = %d\n", | |
775 | gdbarch_frame_align_p (current_gdbarch)); | |
776 | fprintf_unfiltered (file, | |
48f7351b | 777 | "gdbarch_dump: frame_align = <0x%lx>\n", |
a2428dbe | 778 | (long) current_gdbarch->frame_align); |
48f7351b AC |
779 | fprintf_unfiltered (file, |
780 | "gdbarch_dump: frame_args_skip = 0x%s\n", | |
781 | paddr_nz (current_gdbarch->frame_args_skip)); | |
48f7351b AC |
782 | fprintf_unfiltered (file, |
783 | "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n", | |
784 | gdbarch_frame_num_args_p (current_gdbarch)); | |
48f7351b AC |
785 | fprintf_unfiltered (file, |
786 | "gdbarch_dump: frame_num_args = <0x%lx>\n", | |
787 | (long) current_gdbarch->frame_num_args); | |
48f7351b AC |
788 | fprintf_unfiltered (file, |
789 | "gdbarch_dump: frame_red_zone_size = %s\n", | |
790 | paddr_d (current_gdbarch->frame_red_zone_size)); | |
48f7351b AC |
791 | fprintf_unfiltered (file, |
792 | "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n", | |
793 | gdbarch_get_longjmp_target_p (current_gdbarch)); | |
48f7351b AC |
794 | fprintf_unfiltered (file, |
795 | "gdbarch_dump: get_longjmp_target = <0x%lx>\n", | |
796 | (long) current_gdbarch->get_longjmp_target); | |
a2428dbe | 797 | fprintf_unfiltered (file, |
48f7351b AC |
798 | "gdbarch_dump: have_nonsteppable_watchpoint = %s\n", |
799 | paddr_d (current_gdbarch->have_nonsteppable_watchpoint)); | |
800 | fprintf_unfiltered (file, | |
801 | "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n", | |
a2428dbe | 802 | (long) current_gdbarch->in_function_epilogue_p); |
48f7351b AC |
803 | fprintf_unfiltered (file, |
804 | "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n", | |
805 | (long) current_gdbarch->in_solib_return_trampoline); | |
48f7351b AC |
806 | fprintf_unfiltered (file, |
807 | "gdbarch_dump: inner_than = <0x%lx>\n", | |
808 | (long) current_gdbarch->inner_than); | |
48f7351b AC |
809 | fprintf_unfiltered (file, |
810 | "gdbarch_dump: int_bit = %s\n", | |
811 | paddr_d (current_gdbarch->int_bit)); | |
48f7351b AC |
812 | fprintf_unfiltered (file, |
813 | "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n", | |
814 | gdbarch_integer_to_address_p (current_gdbarch)); | |
48f7351b AC |
815 | fprintf_unfiltered (file, |
816 | "gdbarch_dump: integer_to_address = <0x%lx>\n", | |
817 | (long) current_gdbarch->integer_to_address); | |
48f7351b AC |
818 | fprintf_unfiltered (file, |
819 | "gdbarch_dump: long_bit = %s\n", | |
820 | paddr_d (current_gdbarch->long_bit)); | |
48f7351b AC |
821 | fprintf_unfiltered (file, |
822 | "gdbarch_dump: long_double_bit = %s\n", | |
823 | paddr_d (current_gdbarch->long_double_bit)); | |
a2428dbe | 824 | fprintf_unfiltered (file, |
48f7351b | 825 | "gdbarch_dump: long_double_format = %s\n", |
456fcf94 | 826 | pformat (current_gdbarch->long_double_format)); |
48f7351b AC |
827 | fprintf_unfiltered (file, |
828 | "gdbarch_dump: long_long_bit = %s\n", | |
829 | paddr_d (current_gdbarch->long_long_bit)); | |
48f7351b AC |
830 | fprintf_unfiltered (file, |
831 | "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n", | |
832 | (long) current_gdbarch->memory_insert_breakpoint); | |
48f7351b AC |
833 | fprintf_unfiltered (file, |
834 | "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n", | |
835 | (long) current_gdbarch->memory_remove_breakpoint); | |
5720643c | 836 | fprintf_unfiltered (file, |
48f7351b | 837 | "gdbarch_dump: name_of_malloc = %s\n", |
aea8766f | 838 | current_gdbarch->name_of_malloc); |
48f7351b AC |
839 | fprintf_unfiltered (file, |
840 | "gdbarch_dump: num_pseudo_regs = %s\n", | |
841 | paddr_d (current_gdbarch->num_pseudo_regs)); | |
48f7351b AC |
842 | fprintf_unfiltered (file, |
843 | "gdbarch_dump: num_regs = %s\n", | |
844 | paddr_d (current_gdbarch->num_regs)); | |
48f7351b AC |
845 | fprintf_unfiltered (file, |
846 | "gdbarch_dump: osabi = %s\n", | |
847 | paddr_d (current_gdbarch->osabi)); | |
1c772458 UW |
848 | fprintf_unfiltered (file, |
849 | "gdbarch_dump: gdbarch_overlay_update_p() = %d\n", | |
850 | gdbarch_overlay_update_p (current_gdbarch)); | |
851 | fprintf_unfiltered (file, | |
852 | "gdbarch_dump: overlay_update = <0x%lx>\n", | |
853 | (long) current_gdbarch->overlay_update); | |
48f7351b AC |
854 | fprintf_unfiltered (file, |
855 | "gdbarch_dump: pc_regnum = %s\n", | |
856 | paddr_d (current_gdbarch->pc_regnum)); | |
48f7351b AC |
857 | fprintf_unfiltered (file, |
858 | "gdbarch_dump: pointer_to_address = <0x%lx>\n", | |
859 | (long) current_gdbarch->pointer_to_address); | |
7996bcec AC |
860 | fprintf_unfiltered (file, |
861 | "gdbarch_dump: gdbarch_print_float_info_p() = %d\n", | |
862 | gdbarch_print_float_info_p (current_gdbarch)); | |
863 | fprintf_unfiltered (file, | |
48f7351b | 864 | "gdbarch_dump: print_float_info = <0x%lx>\n", |
7996bcec AC |
865 | (long) current_gdbarch->print_float_info); |
866 | fprintf_unfiltered (file, | |
48f7351b AC |
867 | "gdbarch_dump: print_insn = <0x%lx>\n", |
868 | (long) current_gdbarch->print_insn); | |
869 | fprintf_unfiltered (file, | |
870 | "gdbarch_dump: print_registers_info = <0x%lx>\n", | |
7996bcec AC |
871 | (long) current_gdbarch->print_registers_info); |
872 | fprintf_unfiltered (file, | |
873 | "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n", | |
874 | gdbarch_print_vector_info_p (current_gdbarch)); | |
875 | fprintf_unfiltered (file, | |
48f7351b | 876 | "gdbarch_dump: print_vector_info = <0x%lx>\n", |
7996bcec | 877 | (long) current_gdbarch->print_vector_info); |
48f7351b AC |
878 | fprintf_unfiltered (file, |
879 | "gdbarch_dump: ps_regnum = %s\n", | |
880 | paddr_d (current_gdbarch->ps_regnum)); | |
a2428dbe AC |
881 | fprintf_unfiltered (file, |
882 | "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n", | |
883 | gdbarch_pseudo_register_read_p (current_gdbarch)); | |
884 | fprintf_unfiltered (file, | |
48f7351b | 885 | "gdbarch_dump: pseudo_register_read = <0x%lx>\n", |
a2428dbe AC |
886 | (long) current_gdbarch->pseudo_register_read); |
887 | fprintf_unfiltered (file, | |
888 | "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", | |
889 | gdbarch_pseudo_register_write_p (current_gdbarch)); | |
890 | fprintf_unfiltered (file, | |
48f7351b | 891 | "gdbarch_dump: pseudo_register_write = <0x%lx>\n", |
a2428dbe | 892 | (long) current_gdbarch->pseudo_register_write); |
48f7351b AC |
893 | fprintf_unfiltered (file, |
894 | "gdbarch_dump: ptr_bit = %s\n", | |
895 | paddr_d (current_gdbarch->ptr_bit)); | |
7996bcec AC |
896 | fprintf_unfiltered (file, |
897 | "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n", | |
898 | gdbarch_push_dummy_call_p (current_gdbarch)); | |
899 | fprintf_unfiltered (file, | |
48f7351b | 900 | "gdbarch_dump: push_dummy_call = <0x%lx>\n", |
7996bcec AC |
901 | (long) current_gdbarch->push_dummy_call); |
902 | fprintf_unfiltered (file, | |
903 | "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n", | |
904 | gdbarch_push_dummy_code_p (current_gdbarch)); | |
905 | fprintf_unfiltered (file, | |
48f7351b | 906 | "gdbarch_dump: push_dummy_code = <0x%lx>\n", |
7996bcec | 907 | (long) current_gdbarch->push_dummy_code); |
48f7351b AC |
908 | fprintf_unfiltered (file, |
909 | "gdbarch_dump: gdbarch_read_pc_p() = %d\n", | |
910 | gdbarch_read_pc_p (current_gdbarch)); | |
48f7351b AC |
911 | fprintf_unfiltered (file, |
912 | "gdbarch_dump: read_pc = <0x%lx>\n", | |
913 | (long) current_gdbarch->read_pc); | |
a2428dbe | 914 | fprintf_unfiltered (file, |
48f7351b AC |
915 | "gdbarch_dump: register_name = <0x%lx>\n", |
916 | (long) current_gdbarch->register_name); | |
917 | fprintf_unfiltered (file, | |
918 | "gdbarch_dump: register_reggroup_p = <0x%lx>\n", | |
a2428dbe | 919 | (long) current_gdbarch->register_reggroup_p); |
48f7351b AC |
920 | fprintf_unfiltered (file, |
921 | "gdbarch_dump: register_sim_regno = <0x%lx>\n", | |
922 | (long) current_gdbarch->register_sim_regno); | |
48f7351b AC |
923 | fprintf_unfiltered (file, |
924 | "gdbarch_dump: register_to_value = <0x%lx>\n", | |
925 | (long) current_gdbarch->register_to_value); | |
7996bcec AC |
926 | fprintf_unfiltered (file, |
927 | "gdbarch_dump: gdbarch_register_type_p() = %d\n", | |
928 | gdbarch_register_type_p (current_gdbarch)); | |
929 | fprintf_unfiltered (file, | |
48f7351b | 930 | "gdbarch_dump: register_type = <0x%lx>\n", |
7996bcec | 931 | (long) current_gdbarch->register_type); |
a2428dbe AC |
932 | fprintf_unfiltered (file, |
933 | "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n", | |
934 | gdbarch_regset_from_core_section_p (current_gdbarch)); | |
935 | fprintf_unfiltered (file, | |
48f7351b | 936 | "gdbarch_dump: regset_from_core_section = <0x%lx>\n", |
a2428dbe | 937 | (long) current_gdbarch->regset_from_core_section); |
123dc839 DJ |
938 | fprintf_unfiltered (file, |
939 | "gdbarch_dump: remote_register_number = <0x%lx>\n", | |
940 | (long) current_gdbarch->remote_register_number); | |
a2428dbe AC |
941 | fprintf_unfiltered (file, |
942 | "gdbarch_dump: gdbarch_return_value_p() = %d\n", | |
943 | gdbarch_return_value_p (current_gdbarch)); | |
944 | fprintf_unfiltered (file, | |
48f7351b | 945 | "gdbarch_dump: return_value = <0x%lx>\n", |
a2428dbe | 946 | (long) current_gdbarch->return_value); |
48f7351b AC |
947 | fprintf_unfiltered (file, |
948 | "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n", | |
949 | (long) current_gdbarch->sdb_reg_to_regnum); | |
48f7351b AC |
950 | fprintf_unfiltered (file, |
951 | "gdbarch_dump: short_bit = %s\n", | |
952 | paddr_d (current_gdbarch->short_bit)); | |
3352ef37 AC |
953 | fprintf_unfiltered (file, |
954 | "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n", | |
955 | gdbarch_single_step_through_delay_p (current_gdbarch)); | |
956 | fprintf_unfiltered (file, | |
957 | "gdbarch_dump: single_step_through_delay = <0x%lx>\n", | |
958 | (long) current_gdbarch->single_step_through_delay); | |
6d350bb5 UW |
959 | fprintf_unfiltered (file, |
960 | "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n", | |
961 | gdbarch_skip_permanent_breakpoint_p (current_gdbarch)); | |
962 | fprintf_unfiltered (file, | |
963 | "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n", | |
964 | (long) current_gdbarch->skip_permanent_breakpoint); | |
dea0c52f | 965 | fprintf_unfiltered (file, |
48f7351b AC |
966 | "gdbarch_dump: skip_prologue = <0x%lx>\n", |
967 | (long) current_gdbarch->skip_prologue); | |
968 | fprintf_unfiltered (file, | |
969 | "gdbarch_dump: skip_solib_resolver = <0x%lx>\n", | |
4c8c40e6 | 970 | (long) current_gdbarch->skip_solib_resolver); |
48f7351b AC |
971 | fprintf_unfiltered (file, |
972 | "gdbarch_dump: skip_trampoline_code = <0x%lx>\n", | |
973 | (long) current_gdbarch->skip_trampoline_code); | |
48f7351b AC |
974 | fprintf_unfiltered (file, |
975 | "gdbarch_dump: smash_text_address = <0x%lx>\n", | |
976 | (long) current_gdbarch->smash_text_address); | |
48f7351b AC |
977 | fprintf_unfiltered (file, |
978 | "gdbarch_dump: gdbarch_software_single_step_p() = %d\n", | |
979 | gdbarch_software_single_step_p (current_gdbarch)); | |
48f7351b AC |
980 | fprintf_unfiltered (file, |
981 | "gdbarch_dump: software_single_step = <0x%lx>\n", | |
982 | (long) current_gdbarch->software_single_step); | |
48f7351b AC |
983 | fprintf_unfiltered (file, |
984 | "gdbarch_dump: sp_regnum = %s\n", | |
985 | paddr_d (current_gdbarch->sp_regnum)); | |
a2428dbe | 986 | fprintf_unfiltered (file, |
48f7351b AC |
987 | "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n", |
988 | (long) current_gdbarch->stab_reg_to_regnum); | |
989 | fprintf_unfiltered (file, | |
990 | "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n", | |
a2428dbe | 991 | (long) current_gdbarch->stabs_argument_has_addr); |
48f7351b AC |
992 | fprintf_unfiltered (file, |
993 | "gdbarch_dump: store_return_value = <0x%lx>\n", | |
994 | (long) current_gdbarch->store_return_value); | |
424163ea DJ |
995 | fprintf_unfiltered (file, |
996 | "gdbarch_dump: target_desc = %s\n", | |
997 | paddr_d ((long) current_gdbarch->target_desc)); | |
7996bcec | 998 | fprintf_unfiltered (file, |
a2428dbe AC |
999 | "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n", |
1000 | gdbarch_unwind_dummy_id_p (current_gdbarch)); | |
cde9ea48 | 1001 | fprintf_unfiltered (file, |
48f7351b | 1002 | "gdbarch_dump: unwind_dummy_id = <0x%lx>\n", |
a2428dbe | 1003 | (long) current_gdbarch->unwind_dummy_id); |
08e45a40 | 1004 | fprintf_unfiltered (file, |
a2428dbe AC |
1005 | "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n", |
1006 | gdbarch_unwind_pc_p (current_gdbarch)); | |
7996bcec | 1007 | fprintf_unfiltered (file, |
48f7351b | 1008 | "gdbarch_dump: unwind_pc = <0x%lx>\n", |
a2428dbe | 1009 | (long) current_gdbarch->unwind_pc); |
bd1ce8ba | 1010 | fprintf_unfiltered (file, |
a2428dbe AC |
1011 | "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n", |
1012 | gdbarch_unwind_sp_p (current_gdbarch)); | |
bd1ce8ba | 1013 | fprintf_unfiltered (file, |
48f7351b | 1014 | "gdbarch_dump: unwind_sp = <0x%lx>\n", |
a2428dbe | 1015 | (long) current_gdbarch->unwind_sp); |
9acbedc0 UW |
1016 | fprintf_unfiltered (file, |
1017 | "gdbarch_dump: value_from_register = <0x%lx>\n", | |
1018 | (long) current_gdbarch->value_from_register); | |
48f7351b AC |
1019 | fprintf_unfiltered (file, |
1020 | "gdbarch_dump: value_to_register = <0x%lx>\n", | |
1021 | (long) current_gdbarch->value_to_register); | |
0d5de010 DJ |
1022 | fprintf_unfiltered (file, |
1023 | "gdbarch_dump: vbit_in_delta = %s\n", | |
1024 | paddr_d (current_gdbarch->vbit_in_delta)); | |
48f7351b AC |
1025 | fprintf_unfiltered (file, |
1026 | "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n", | |
1027 | (long) current_gdbarch->virtual_frame_pointer); | |
0d5de010 DJ |
1028 | fprintf_unfiltered (file, |
1029 | "gdbarch_dump: vtable_function_descriptors = %s\n", | |
1030 | paddr_d (current_gdbarch->vtable_function_descriptors)); | |
4b9b3959 | 1031 | fprintf_unfiltered (file, |
61a1198a UW |
1032 | "gdbarch_dump: gdbarch_write_pc_p() = %d\n", |
1033 | gdbarch_write_pc_p (current_gdbarch)); | |
48f7351b AC |
1034 | fprintf_unfiltered (file, |
1035 | "gdbarch_dump: write_pc = <0x%lx>\n", | |
1036 | (long) current_gdbarch->write_pc); | |
4b9b3959 AC |
1037 | if (current_gdbarch->dump_tdep != NULL) |
1038 | current_gdbarch->dump_tdep (current_gdbarch, file); | |
0f71a2f6 JM |
1039 | } |
1040 | ||
1041 | struct gdbarch_tdep * | |
104c1213 | 1042 | gdbarch_tdep (struct gdbarch *gdbarch) |
0f71a2f6 JM |
1043 | { |
1044 | if (gdbarch_debug >= 2) | |
0f71a2f6 JM |
1045 | fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); |
1046 | return gdbarch->tdep; | |
1047 | } | |
1048 | ||
1049 | ||
1050 | const struct bfd_arch_info * | |
104c1213 | 1051 | gdbarch_bfd_arch_info (struct gdbarch *gdbarch) |
0f71a2f6 | 1052 | { |
8de9bdc4 | 1053 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1054 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1055 | fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n"); |
1056 | return gdbarch->bfd_arch_info; | |
1057 | } | |
1058 | ||
1059 | int | |
104c1213 | 1060 | gdbarch_byte_order (struct gdbarch *gdbarch) |
0f71a2f6 | 1061 | { |
8de9bdc4 | 1062 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1063 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1064 | fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n"); |
1065 | return gdbarch->byte_order; | |
1066 | } | |
1067 | ||
4be87837 DJ |
1068 | enum gdb_osabi |
1069 | gdbarch_osabi (struct gdbarch *gdbarch) | |
1070 | { | |
1071 | gdb_assert (gdbarch != NULL); | |
1072 | if (gdbarch_debug >= 2) | |
1073 | fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n"); | |
1074 | return gdbarch->osabi; | |
1075 | } | |
1076 | ||
424163ea DJ |
1077 | const struct target_desc * |
1078 | gdbarch_target_desc (struct gdbarch *gdbarch) | |
1079 | { | |
1080 | gdb_assert (gdbarch != NULL); | |
1081 | if (gdbarch_debug >= 2) | |
1082 | fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n"); | |
1083 | return gdbarch->target_desc; | |
1084 | } | |
1085 | ||
0f71a2f6 | 1086 | int |
104c1213 | 1087 | gdbarch_short_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1088 | { |
8de9bdc4 | 1089 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1090 | /* Skip verify of short_bit, invalid_p == 0 */ |
0f71a2f6 | 1091 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1092 | fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n"); |
1093 | return gdbarch->short_bit; | |
1094 | } | |
1095 | ||
1096 | void | |
104c1213 JM |
1097 | set_gdbarch_short_bit (struct gdbarch *gdbarch, |
1098 | int short_bit) | |
0f71a2f6 JM |
1099 | { |
1100 | gdbarch->short_bit = short_bit; | |
1101 | } | |
1102 | ||
1103 | int | |
104c1213 | 1104 | gdbarch_int_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1105 | { |
8de9bdc4 | 1106 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1107 | /* Skip verify of int_bit, invalid_p == 0 */ |
0f71a2f6 | 1108 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1109 | fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n"); |
1110 | return gdbarch->int_bit; | |
1111 | } | |
1112 | ||
1113 | void | |
104c1213 JM |
1114 | set_gdbarch_int_bit (struct gdbarch *gdbarch, |
1115 | int int_bit) | |
0f71a2f6 JM |
1116 | { |
1117 | gdbarch->int_bit = int_bit; | |
1118 | } | |
1119 | ||
1120 | int | |
104c1213 | 1121 | gdbarch_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1122 | { |
8de9bdc4 | 1123 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1124 | /* Skip verify of long_bit, invalid_p == 0 */ |
0f71a2f6 | 1125 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1126 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n"); |
1127 | return gdbarch->long_bit; | |
1128 | } | |
1129 | ||
1130 | void | |
104c1213 JM |
1131 | set_gdbarch_long_bit (struct gdbarch *gdbarch, |
1132 | int long_bit) | |
0f71a2f6 JM |
1133 | { |
1134 | gdbarch->long_bit = long_bit; | |
1135 | } | |
1136 | ||
1137 | int | |
104c1213 | 1138 | gdbarch_long_long_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1139 | { |
8de9bdc4 | 1140 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1141 | /* Skip verify of long_long_bit, invalid_p == 0 */ |
0f71a2f6 | 1142 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1143 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n"); |
1144 | return gdbarch->long_long_bit; | |
1145 | } | |
1146 | ||
1147 | void | |
104c1213 JM |
1148 | set_gdbarch_long_long_bit (struct gdbarch *gdbarch, |
1149 | int long_long_bit) | |
0f71a2f6 JM |
1150 | { |
1151 | gdbarch->long_long_bit = long_long_bit; | |
1152 | } | |
1153 | ||
1154 | int | |
104c1213 | 1155 | gdbarch_float_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1156 | { |
8de9bdc4 | 1157 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1158 | /* Skip verify of float_bit, invalid_p == 0 */ |
0f71a2f6 | 1159 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1160 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n"); |
1161 | return gdbarch->float_bit; | |
1162 | } | |
1163 | ||
1164 | void | |
104c1213 JM |
1165 | set_gdbarch_float_bit (struct gdbarch *gdbarch, |
1166 | int float_bit) | |
0f71a2f6 JM |
1167 | { |
1168 | gdbarch->float_bit = float_bit; | |
1169 | } | |
1170 | ||
8da61cc4 | 1171 | const struct floatformat ** |
456fcf94 AC |
1172 | gdbarch_float_format (struct gdbarch *gdbarch) |
1173 | { | |
1174 | gdb_assert (gdbarch != NULL); | |
1175 | if (gdbarch_debug >= 2) | |
1176 | fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n"); | |
1177 | return gdbarch->float_format; | |
1178 | } | |
1179 | ||
1180 | void | |
1181 | set_gdbarch_float_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1182 | const struct floatformat ** float_format) |
456fcf94 AC |
1183 | { |
1184 | gdbarch->float_format = float_format; | |
1185 | } | |
1186 | ||
0f71a2f6 | 1187 | int |
104c1213 | 1188 | gdbarch_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1189 | { |
8de9bdc4 | 1190 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1191 | /* Skip verify of double_bit, invalid_p == 0 */ |
0f71a2f6 | 1192 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1193 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n"); |
1194 | return gdbarch->double_bit; | |
1195 | } | |
1196 | ||
1197 | void | |
104c1213 JM |
1198 | set_gdbarch_double_bit (struct gdbarch *gdbarch, |
1199 | int double_bit) | |
0f71a2f6 JM |
1200 | { |
1201 | gdbarch->double_bit = double_bit; | |
1202 | } | |
1203 | ||
8da61cc4 | 1204 | const struct floatformat ** |
456fcf94 AC |
1205 | gdbarch_double_format (struct gdbarch *gdbarch) |
1206 | { | |
1207 | gdb_assert (gdbarch != NULL); | |
1208 | if (gdbarch_debug >= 2) | |
1209 | fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n"); | |
1210 | return gdbarch->double_format; | |
1211 | } | |
1212 | ||
1213 | void | |
1214 | set_gdbarch_double_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1215 | const struct floatformat ** double_format) |
456fcf94 AC |
1216 | { |
1217 | gdbarch->double_format = double_format; | |
1218 | } | |
1219 | ||
0f71a2f6 | 1220 | int |
104c1213 | 1221 | gdbarch_long_double_bit (struct gdbarch *gdbarch) |
0f71a2f6 | 1222 | { |
8de9bdc4 | 1223 | gdb_assert (gdbarch != NULL); |
66b43ecb | 1224 | /* Skip verify of long_double_bit, invalid_p == 0 */ |
0f71a2f6 | 1225 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1226 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n"); |
1227 | return gdbarch->long_double_bit; | |
1228 | } | |
1229 | ||
1230 | void | |
104c1213 JM |
1231 | set_gdbarch_long_double_bit (struct gdbarch *gdbarch, |
1232 | int long_double_bit) | |
0f71a2f6 JM |
1233 | { |
1234 | gdbarch->long_double_bit = long_double_bit; | |
1235 | } | |
1236 | ||
8da61cc4 | 1237 | const struct floatformat ** |
456fcf94 AC |
1238 | gdbarch_long_double_format (struct gdbarch *gdbarch) |
1239 | { | |
1240 | gdb_assert (gdbarch != NULL); | |
1241 | if (gdbarch_debug >= 2) | |
1242 | fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n"); | |
1243 | return gdbarch->long_double_format; | |
1244 | } | |
1245 | ||
1246 | void | |
1247 | set_gdbarch_long_double_format (struct gdbarch *gdbarch, | |
8da61cc4 | 1248 | const struct floatformat ** long_double_format) |
456fcf94 AC |
1249 | { |
1250 | gdbarch->long_double_format = long_double_format; | |
1251 | } | |
1252 | ||
66b43ecb AC |
1253 | int |
1254 | gdbarch_ptr_bit (struct gdbarch *gdbarch) | |
1255 | { | |
8de9bdc4 | 1256 | gdb_assert (gdbarch != NULL); |
66b43ecb AC |
1257 | /* Skip verify of ptr_bit, invalid_p == 0 */ |
1258 | if (gdbarch_debug >= 2) | |
1259 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n"); | |
1260 | return gdbarch->ptr_bit; | |
1261 | } | |
1262 | ||
1263 | void | |
1264 | set_gdbarch_ptr_bit (struct gdbarch *gdbarch, | |
1265 | int ptr_bit) | |
1266 | { | |
1267 | gdbarch->ptr_bit = ptr_bit; | |
1268 | } | |
1269 | ||
52204a0b DT |
1270 | int |
1271 | gdbarch_addr_bit (struct gdbarch *gdbarch) | |
1272 | { | |
8de9bdc4 | 1273 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1274 | /* Check variable changed from pre-default. */ |
1275 | gdb_assert (gdbarch->addr_bit != 0); | |
52204a0b DT |
1276 | if (gdbarch_debug >= 2) |
1277 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); | |
1278 | return gdbarch->addr_bit; | |
1279 | } | |
1280 | ||
1281 | void | |
1282 | set_gdbarch_addr_bit (struct gdbarch *gdbarch, | |
1283 | int addr_bit) | |
1284 | { | |
1285 | gdbarch->addr_bit = addr_bit; | |
1286 | } | |
1287 | ||
4e409299 JB |
1288 | int |
1289 | gdbarch_char_signed (struct gdbarch *gdbarch) | |
1290 | { | |
8de9bdc4 | 1291 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1292 | /* Check variable changed from pre-default. */ |
1293 | gdb_assert (gdbarch->char_signed != -1); | |
4e409299 JB |
1294 | if (gdbarch_debug >= 2) |
1295 | fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n"); | |
1296 | return gdbarch->char_signed; | |
1297 | } | |
1298 | ||
1299 | void | |
1300 | set_gdbarch_char_signed (struct gdbarch *gdbarch, | |
1301 | int char_signed) | |
1302 | { | |
1303 | gdbarch->char_signed = char_signed; | |
1304 | } | |
1305 | ||
cde9ea48 AC |
1306 | int |
1307 | gdbarch_read_pc_p (struct gdbarch *gdbarch) | |
1308 | { | |
1309 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1310 | return gdbarch->read_pc != NULL; |
cde9ea48 AC |
1311 | } |
1312 | ||
0f71a2f6 | 1313 | CORE_ADDR |
61a1198a | 1314 | gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache) |
0f71a2f6 | 1315 | { |
8de9bdc4 | 1316 | gdb_assert (gdbarch != NULL); |
956ac328 | 1317 | gdb_assert (gdbarch->read_pc != NULL); |
0f71a2f6 | 1318 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1319 | fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); |
61a1198a | 1320 | return gdbarch->read_pc (regcache); |
0f71a2f6 JM |
1321 | } |
1322 | ||
1323 | void | |
104c1213 JM |
1324 | set_gdbarch_read_pc (struct gdbarch *gdbarch, |
1325 | gdbarch_read_pc_ftype read_pc) | |
0f71a2f6 JM |
1326 | { |
1327 | gdbarch->read_pc = read_pc; | |
1328 | } | |
1329 | ||
61a1198a UW |
1330 | int |
1331 | gdbarch_write_pc_p (struct gdbarch *gdbarch) | |
1332 | { | |
1333 | gdb_assert (gdbarch != NULL); | |
1334 | return gdbarch->write_pc != NULL; | |
1335 | } | |
1336 | ||
0f71a2f6 | 1337 | void |
61a1198a | 1338 | gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val) |
0f71a2f6 | 1339 | { |
8de9bdc4 | 1340 | gdb_assert (gdbarch != NULL); |
956ac328 | 1341 | gdb_assert (gdbarch->write_pc != NULL); |
0f71a2f6 | 1342 | if (gdbarch_debug >= 2) |
0f71a2f6 | 1343 | fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); |
61a1198a | 1344 | gdbarch->write_pc (regcache, val); |
0f71a2f6 JM |
1345 | } |
1346 | ||
1347 | void | |
104c1213 JM |
1348 | set_gdbarch_write_pc (struct gdbarch *gdbarch, |
1349 | gdbarch_write_pc_ftype write_pc) | |
0f71a2f6 JM |
1350 | { |
1351 | gdbarch->write_pc = write_pc; | |
1352 | } | |
1353 | ||
39d4ef09 AC |
1354 | void |
1355 | gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) | |
1356 | { | |
8de9bdc4 | 1357 | gdb_assert (gdbarch != NULL); |
956ac328 | 1358 | gdb_assert (gdbarch->virtual_frame_pointer != NULL); |
39d4ef09 AC |
1359 | if (gdbarch_debug >= 2) |
1360 | fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n"); | |
1361 | gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset); | |
1362 | } | |
1363 | ||
1364 | void | |
1365 | set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, | |
1366 | gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer) | |
1367 | { | |
1368 | gdbarch->virtual_frame_pointer = virtual_frame_pointer; | |
1369 | } | |
1370 | ||
61a0eb5b | 1371 | int |
d8124050 | 1372 | gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch) |
61a0eb5b | 1373 | { |
8de9bdc4 | 1374 | gdb_assert (gdbarch != NULL); |
956ac328 | 1375 | return gdbarch->pseudo_register_read != NULL; |
61a0eb5b AC |
1376 | } |
1377 | ||
1378 | void | |
b60c417a | 1379 | gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf) |
61a0eb5b | 1380 | { |
8de9bdc4 | 1381 | gdb_assert (gdbarch != NULL); |
956ac328 | 1382 | gdb_assert (gdbarch->pseudo_register_read != NULL); |
61a0eb5b | 1383 | if (gdbarch_debug >= 2) |
d8124050 AC |
1384 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n"); |
1385 | gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
1386 | } |
1387 | ||
1388 | void | |
d8124050 AC |
1389 | set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, |
1390 | gdbarch_pseudo_register_read_ftype pseudo_register_read) | |
61a0eb5b | 1391 | { |
d8124050 | 1392 | gdbarch->pseudo_register_read = pseudo_register_read; |
61a0eb5b AC |
1393 | } |
1394 | ||
1395 | int | |
d8124050 | 1396 | gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) |
61a0eb5b | 1397 | { |
8de9bdc4 | 1398 | gdb_assert (gdbarch != NULL); |
956ac328 | 1399 | return gdbarch->pseudo_register_write != NULL; |
61a0eb5b AC |
1400 | } |
1401 | ||
1402 | void | |
b60c417a | 1403 | gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf) |
61a0eb5b | 1404 | { |
8de9bdc4 | 1405 | gdb_assert (gdbarch != NULL); |
956ac328 | 1406 | gdb_assert (gdbarch->pseudo_register_write != NULL); |
61a0eb5b | 1407 | if (gdbarch_debug >= 2) |
d8124050 AC |
1408 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n"); |
1409 | gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf); | |
61a0eb5b AC |
1410 | } |
1411 | ||
1412 | void | |
d8124050 AC |
1413 | set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, |
1414 | gdbarch_pseudo_register_write_ftype pseudo_register_write) | |
61a0eb5b | 1415 | { |
d8124050 | 1416 | gdbarch->pseudo_register_write = pseudo_register_write; |
61a0eb5b AC |
1417 | } |
1418 | ||
0f71a2f6 | 1419 | int |
104c1213 | 1420 | gdbarch_num_regs (struct gdbarch *gdbarch) |
0f71a2f6 | 1421 | { |
8de9bdc4 | 1422 | gdb_assert (gdbarch != NULL); |
956ac328 AC |
1423 | /* Check variable changed from pre-default. */ |
1424 | gdb_assert (gdbarch->num_regs != -1); | |
0f71a2f6 | 1425 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1426 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); |
1427 | return gdbarch->num_regs; | |
1428 | } | |
1429 | ||
1430 | void | |
104c1213 JM |
1431 | set_gdbarch_num_regs (struct gdbarch *gdbarch, |
1432 | int num_regs) | |
0f71a2f6 JM |
1433 | { |
1434 | gdbarch->num_regs = num_regs; | |
1435 | } | |
1436 | ||
0aba1244 EZ |
1437 | int |
1438 | gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) | |
1439 | { | |
8de9bdc4 | 1440 | gdb_assert (gdbarch != NULL); |
0aba1244 EZ |
1441 | /* Skip verify of num_pseudo_regs, invalid_p == 0 */ |
1442 | if (gdbarch_debug >= 2) | |
1443 | fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); | |
1444 | return gdbarch->num_pseudo_regs; | |
1445 | } | |
1446 | ||
1447 | void | |
1448 | set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, | |
1449 | int num_pseudo_regs) | |
1450 | { | |
1451 | gdbarch->num_pseudo_regs = num_pseudo_regs; | |
1452 | } | |
1453 | ||
0f71a2f6 | 1454 | int |
104c1213 | 1455 | gdbarch_sp_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 1456 | { |
8de9bdc4 | 1457 | gdb_assert (gdbarch != NULL); |
1200cd6e | 1458 | /* Skip verify of sp_regnum, invalid_p == 0 */ |
0f71a2f6 | 1459 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1460 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); |
1461 | return gdbarch->sp_regnum; | |
1462 | } | |
1463 | ||
1464 | void | |
104c1213 JM |
1465 | set_gdbarch_sp_regnum (struct gdbarch *gdbarch, |
1466 | int sp_regnum) | |
0f71a2f6 JM |
1467 | { |
1468 | gdbarch->sp_regnum = sp_regnum; | |
1469 | } | |
1470 | ||
0f71a2f6 | 1471 | int |
104c1213 | 1472 | gdbarch_pc_regnum (struct gdbarch *gdbarch) |
0f71a2f6 | 1473 | { |
8de9bdc4 | 1474 | gdb_assert (gdbarch != NULL); |
1200cd6e | 1475 | /* Skip verify of pc_regnum, invalid_p == 0 */ |
0f71a2f6 | 1476 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1477 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); |
1478 | return gdbarch->pc_regnum; | |
1479 | } | |
1480 | ||
1481 | void | |
104c1213 JM |
1482 | set_gdbarch_pc_regnum (struct gdbarch *gdbarch, |
1483 | int pc_regnum) | |
0f71a2f6 JM |
1484 | { |
1485 | gdbarch->pc_regnum = pc_regnum; | |
1486 | } | |
1487 | ||
c2169756 AC |
1488 | int |
1489 | gdbarch_ps_regnum (struct gdbarch *gdbarch) | |
1490 | { | |
8de9bdc4 | 1491 | gdb_assert (gdbarch != NULL); |
c2169756 AC |
1492 | /* Skip verify of ps_regnum, invalid_p == 0 */ |
1493 | if (gdbarch_debug >= 2) | |
1494 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n"); | |
1495 | return gdbarch->ps_regnum; | |
1496 | } | |
1497 | ||
1498 | void | |
1499 | set_gdbarch_ps_regnum (struct gdbarch *gdbarch, | |
1500 | int ps_regnum) | |
1501 | { | |
1502 | gdbarch->ps_regnum = ps_regnum; | |
1503 | } | |
1504 | ||
60054393 MS |
1505 | int |
1506 | gdbarch_fp0_regnum (struct gdbarch *gdbarch) | |
1507 | { | |
8de9bdc4 | 1508 | gdb_assert (gdbarch != NULL); |
60054393 MS |
1509 | /* Skip verify of fp0_regnum, invalid_p == 0 */ |
1510 | if (gdbarch_debug >= 2) | |
1511 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n"); | |
1512 | return gdbarch->fp0_regnum; | |
1513 | } | |
1514 | ||
1515 | void | |
1516 | set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, | |
1517 | int fp0_regnum) | |
1518 | { | |
1519 | gdbarch->fp0_regnum = fp0_regnum; | |
1520 | } | |
1521 | ||
88c72b7d AC |
1522 | int |
1523 | gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) | |
1524 | { | |
8de9bdc4 | 1525 | gdb_assert (gdbarch != NULL); |
956ac328 | 1526 | gdb_assert (gdbarch->stab_reg_to_regnum != NULL); |
88c72b7d AC |
1527 | if (gdbarch_debug >= 2) |
1528 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); | |
1529 | return gdbarch->stab_reg_to_regnum (stab_regnr); | |
1530 | } | |
1531 | ||
1532 | void | |
1533 | set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, | |
1534 | gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum) | |
1535 | { | |
1536 | gdbarch->stab_reg_to_regnum = stab_reg_to_regnum; | |
1537 | } | |
1538 | ||
1539 | int | |
1540 | gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) | |
1541 | { | |
8de9bdc4 | 1542 | gdb_assert (gdbarch != NULL); |
956ac328 | 1543 | gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL); |
88c72b7d AC |
1544 | if (gdbarch_debug >= 2) |
1545 | fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); | |
1546 | return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); | |
1547 | } | |
1548 | ||
1549 | void | |
1550 | set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, | |
1551 | gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum) | |
1552 | { | |
1553 | gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum; | |
1554 | } | |
1555 | ||
1556 | int | |
1557 | gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) | |
1558 | { | |
8de9bdc4 | 1559 | gdb_assert (gdbarch != NULL); |
956ac328 | 1560 | gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL); |
88c72b7d AC |
1561 | if (gdbarch_debug >= 2) |
1562 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); | |
1563 | return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); | |
1564 | } | |
1565 | ||
1566 | void | |
1567 | set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, | |
1568 | gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum) | |
1569 | { | |
1570 | gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum; | |
1571 | } | |
1572 | ||
1573 | int | |
1574 | gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) | |
1575 | { | |
8de9bdc4 | 1576 | gdb_assert (gdbarch != NULL); |
956ac328 | 1577 | gdb_assert (gdbarch->sdb_reg_to_regnum != NULL); |
88c72b7d AC |
1578 | if (gdbarch_debug >= 2) |
1579 | fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); | |
1580 | return gdbarch->sdb_reg_to_regnum (sdb_regnr); | |
1581 | } | |
1582 | ||
1583 | void | |
1584 | set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, | |
1585 | gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum) | |
1586 | { | |
1587 | gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum; | |
1588 | } | |
1589 | ||
1590 | int | |
1591 | gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) | |
1592 | { | |
8de9bdc4 | 1593 | gdb_assert (gdbarch != NULL); |
956ac328 | 1594 | gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL); |
88c72b7d AC |
1595 | if (gdbarch_debug >= 2) |
1596 | fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); | |
1597 | return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); | |
1598 | } | |
1599 | ||
1600 | void | |
1601 | set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, | |
1602 | gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum) | |
1603 | { | |
1604 | gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum; | |
1605 | } | |
1606 | ||
fa88f677 | 1607 | const char * |
0f71a2f6 JM |
1608 | gdbarch_register_name (struct gdbarch *gdbarch, int regnr) |
1609 | { | |
8de9bdc4 | 1610 | gdb_assert (gdbarch != NULL); |
956ac328 | 1611 | gdb_assert (gdbarch->register_name != NULL); |
0f71a2f6 | 1612 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1613 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); |
1614 | return gdbarch->register_name (regnr); | |
1615 | } | |
1616 | ||
1617 | void | |
104c1213 JM |
1618 | set_gdbarch_register_name (struct gdbarch *gdbarch, |
1619 | gdbarch_register_name_ftype register_name) | |
0f71a2f6 JM |
1620 | { |
1621 | gdbarch->register_name = register_name; | |
1622 | } | |
1623 | ||
0f71a2f6 | 1624 | int |
9c04cab7 | 1625 | gdbarch_register_type_p (struct gdbarch *gdbarch) |
0f71a2f6 | 1626 | { |
8de9bdc4 | 1627 | gdb_assert (gdbarch != NULL); |
956ac328 | 1628 | return gdbarch->register_type != NULL; |
9c04cab7 AC |
1629 | } |
1630 | ||
1631 | struct type * | |
1632 | gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) | |
1633 | { | |
1634 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1635 | gdb_assert (gdbarch->register_type != NULL); |
0f71a2f6 | 1636 | if (gdbarch_debug >= 2) |
9c04cab7 AC |
1637 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n"); |
1638 | return gdbarch->register_type (gdbarch, reg_nr); | |
0f71a2f6 JM |
1639 | } |
1640 | ||
1641 | void | |
9c04cab7 AC |
1642 | set_gdbarch_register_type (struct gdbarch *gdbarch, |
1643 | gdbarch_register_type_ftype register_type) | |
0f71a2f6 | 1644 | { |
9c04cab7 | 1645 | gdbarch->register_type = register_type; |
0f71a2f6 JM |
1646 | } |
1647 | ||
f3be58bc AC |
1648 | int |
1649 | gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch) | |
1650 | { | |
1651 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1652 | return gdbarch->unwind_dummy_id != NULL; |
f3be58bc AC |
1653 | } |
1654 | ||
1655 | struct frame_id | |
1656 | gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info) | |
1657 | { | |
1658 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1659 | gdb_assert (gdbarch->unwind_dummy_id != NULL); |
f3be58bc AC |
1660 | if (gdbarch_debug >= 2) |
1661 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n"); | |
1662 | return gdbarch->unwind_dummy_id (gdbarch, info); | |
1663 | } | |
1664 | ||
1665 | void | |
1666 | set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, | |
1667 | gdbarch_unwind_dummy_id_ftype unwind_dummy_id) | |
1668 | { | |
1669 | gdbarch->unwind_dummy_id = unwind_dummy_id; | |
1670 | } | |
1671 | ||
f3be58bc AC |
1672 | int |
1673 | gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch) | |
1674 | { | |
1675 | gdb_assert (gdbarch != NULL); | |
1676 | /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ | |
1677 | if (gdbarch_debug >= 2) | |
1678 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n"); | |
1679 | return gdbarch->deprecated_fp_regnum; | |
1680 | } | |
1681 | ||
1682 | void | |
1683 | set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, | |
1684 | int deprecated_fp_regnum) | |
1685 | { | |
1686 | gdbarch->deprecated_fp_regnum = deprecated_fp_regnum; | |
1687 | } | |
1688 | ||
0ab7a791 | 1689 | int |
b8de8283 | 1690 | gdbarch_push_dummy_call_p (struct gdbarch *gdbarch) |
0ab7a791 AC |
1691 | { |
1692 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1693 | return gdbarch->push_dummy_call != NULL; |
0ab7a791 AC |
1694 | } |
1695 | ||
b8de8283 | 1696 | CORE_ADDR |
7d9b040b | 1697 | gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) |
666e11c5 | 1698 | { |
8de9bdc4 | 1699 | gdb_assert (gdbarch != NULL); |
956ac328 | 1700 | gdb_assert (gdbarch->push_dummy_call != NULL); |
666e11c5 | 1701 | if (gdbarch_debug >= 2) |
b8de8283 | 1702 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n"); |
7d9b040b | 1703 | return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr); |
666e11c5 EZ |
1704 | } |
1705 | ||
1706 | void | |
b8de8283 AC |
1707 | set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, |
1708 | gdbarch_push_dummy_call_ftype push_dummy_call) | |
666e11c5 | 1709 | { |
b8de8283 | 1710 | gdbarch->push_dummy_call = push_dummy_call; |
666e11c5 EZ |
1711 | } |
1712 | ||
2649061d | 1713 | int |
b8de8283 | 1714 | gdbarch_call_dummy_location (struct gdbarch *gdbarch) |
2649061d | 1715 | { |
8de9bdc4 | 1716 | gdb_assert (gdbarch != NULL); |
b8de8283 AC |
1717 | /* Skip verify of call_dummy_location, invalid_p == 0 */ |
1718 | if (gdbarch_debug >= 2) | |
1719 | fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); | |
1720 | return gdbarch->call_dummy_location; | |
2649061d AC |
1721 | } |
1722 | ||
b8de8283 AC |
1723 | void |
1724 | set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, | |
1725 | int call_dummy_location) | |
1726 | { | |
1727 | gdbarch->call_dummy_location = call_dummy_location; | |
1728 | } | |
1729 | ||
0f71a2f6 | 1730 | int |
b8de8283 | 1731 | gdbarch_push_dummy_code_p (struct gdbarch *gdbarch) |
0f71a2f6 | 1732 | { |
8de9bdc4 | 1733 | gdb_assert (gdbarch != NULL); |
956ac328 | 1734 | return gdbarch->push_dummy_code != NULL; |
b8de8283 AC |
1735 | } |
1736 | ||
1737 | CORE_ADDR | |
e4fd649a | 1738 | gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache) |
b8de8283 AC |
1739 | { |
1740 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1741 | gdb_assert (gdbarch->push_dummy_code != NULL); |
0f71a2f6 | 1742 | if (gdbarch_debug >= 2) |
b8de8283 | 1743 | fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n"); |
e4fd649a | 1744 | return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache); |
0f71a2f6 JM |
1745 | } |
1746 | ||
1747 | void | |
b8de8283 AC |
1748 | set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, |
1749 | gdbarch_push_dummy_code_ftype push_dummy_code) | |
0f71a2f6 | 1750 | { |
b8de8283 | 1751 | gdbarch->push_dummy_code = push_dummy_code; |
0f71a2f6 JM |
1752 | } |
1753 | ||
b8de8283 AC |
1754 | void |
1755 | gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) | |
1756 | { | |
1757 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1758 | gdb_assert (gdbarch->print_registers_info != NULL); |
b8de8283 AC |
1759 | if (gdbarch_debug >= 2) |
1760 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n"); | |
1761 | gdbarch->print_registers_info (gdbarch, file, frame, regnum, all); | |
1762 | } | |
1763 | ||
1764 | void | |
1765 | set_gdbarch_print_registers_info (struct gdbarch *gdbarch, | |
1766 | gdbarch_print_registers_info_ftype print_registers_info) | |
1767 | { | |
1768 | gdbarch->print_registers_info = print_registers_info; | |
0f71a2f6 JM |
1769 | } |
1770 | ||
0f71a2f6 | 1771 | int |
b8de8283 AC |
1772 | gdbarch_print_float_info_p (struct gdbarch *gdbarch) |
1773 | { | |
1774 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1775 | return gdbarch->print_float_info != NULL; |
b8de8283 AC |
1776 | } |
1777 | ||
1778 | void | |
1779 | gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
0f71a2f6 | 1780 | { |
8de9bdc4 | 1781 | gdb_assert (gdbarch != NULL); |
956ac328 | 1782 | gdb_assert (gdbarch->print_float_info != NULL); |
0f71a2f6 | 1783 | if (gdbarch_debug >= 2) |
b8de8283 AC |
1784 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n"); |
1785 | gdbarch->print_float_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
1786 | } |
1787 | ||
1788 | void | |
b8de8283 AC |
1789 | set_gdbarch_print_float_info (struct gdbarch *gdbarch, |
1790 | gdbarch_print_float_info_ftype print_float_info) | |
0f71a2f6 | 1791 | { |
b8de8283 AC |
1792 | gdbarch->print_float_info = print_float_info; |
1793 | } | |
1794 | ||
1795 | int | |
1796 | gdbarch_print_vector_info_p (struct gdbarch *gdbarch) | |
1797 | { | |
1798 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1799 | return gdbarch->print_vector_info != NULL; |
b8de8283 AC |
1800 | } |
1801 | ||
1802 | void | |
1803 | gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args) | |
1804 | { | |
1805 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1806 | gdb_assert (gdbarch->print_vector_info != NULL); |
b8de8283 AC |
1807 | if (gdbarch_debug >= 2) |
1808 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n"); | |
1809 | gdbarch->print_vector_info (gdbarch, file, frame, args); | |
0f71a2f6 JM |
1810 | } |
1811 | ||
b8de8283 AC |
1812 | void |
1813 | set_gdbarch_print_vector_info (struct gdbarch *gdbarch, | |
1814 | gdbarch_print_vector_info_ftype print_vector_info) | |
ae45cd16 | 1815 | { |
b8de8283 | 1816 | gdbarch->print_vector_info = print_vector_info; |
ae45cd16 AC |
1817 | } |
1818 | ||
1819 | int | |
b8de8283 | 1820 | gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) |
0f71a2f6 | 1821 | { |
8de9bdc4 | 1822 | gdb_assert (gdbarch != NULL); |
956ac328 | 1823 | gdb_assert (gdbarch->register_sim_regno != NULL); |
0f71a2f6 | 1824 | if (gdbarch_debug >= 2) |
b8de8283 AC |
1825 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); |
1826 | return gdbarch->register_sim_regno (reg_nr); | |
0f71a2f6 JM |
1827 | } |
1828 | ||
1829 | void | |
b8de8283 AC |
1830 | set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, |
1831 | gdbarch_register_sim_regno_ftype register_sim_regno) | |
0f71a2f6 | 1832 | { |
b8de8283 | 1833 | gdbarch->register_sim_regno = register_sim_regno; |
0f71a2f6 JM |
1834 | } |
1835 | ||
0f71a2f6 | 1836 | int |
b8de8283 | 1837 | gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 1838 | { |
8de9bdc4 | 1839 | gdb_assert (gdbarch != NULL); |
956ac328 | 1840 | gdb_assert (gdbarch->cannot_fetch_register != NULL); |
b8de8283 AC |
1841 | if (gdbarch_debug >= 2) |
1842 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n"); | |
1843 | return gdbarch->cannot_fetch_register (regnum); | |
1844 | } | |
1845 | ||
1846 | void | |
1847 | set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, | |
1848 | gdbarch_cannot_fetch_register_ftype cannot_fetch_register) | |
1849 | { | |
1850 | gdbarch->cannot_fetch_register = cannot_fetch_register; | |
0f71a2f6 JM |
1851 | } |
1852 | ||
1853 | int | |
b8de8283 | 1854 | gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum) |
0f71a2f6 | 1855 | { |
8de9bdc4 | 1856 | gdb_assert (gdbarch != NULL); |
956ac328 | 1857 | gdb_assert (gdbarch->cannot_store_register != NULL); |
0f71a2f6 | 1858 | if (gdbarch_debug >= 2) |
b8de8283 AC |
1859 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n"); |
1860 | return gdbarch->cannot_store_register (regnum); | |
0f71a2f6 JM |
1861 | } |
1862 | ||
1863 | void | |
b8de8283 AC |
1864 | set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, |
1865 | gdbarch_cannot_store_register_ftype cannot_store_register) | |
0f71a2f6 | 1866 | { |
b8de8283 | 1867 | gdbarch->cannot_store_register = cannot_store_register; |
0f71a2f6 JM |
1868 | } |
1869 | ||
e8ab51f7 | 1870 | int |
b8de8283 | 1871 | gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch) |
e8ab51f7 AC |
1872 | { |
1873 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1874 | return gdbarch->get_longjmp_target != NULL; |
e8ab51f7 AC |
1875 | } |
1876 | ||
b8de8283 | 1877 | int |
60ade65d | 1878 | gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc) |
0f71a2f6 | 1879 | { |
8de9bdc4 | 1880 | gdb_assert (gdbarch != NULL); |
956ac328 | 1881 | gdb_assert (gdbarch->get_longjmp_target != NULL); |
0f71a2f6 | 1882 | if (gdbarch_debug >= 2) |
b8de8283 | 1883 | fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n"); |
60ade65d | 1884 | return gdbarch->get_longjmp_target (frame, pc); |
0f71a2f6 JM |
1885 | } |
1886 | ||
1887 | void | |
b8de8283 AC |
1888 | set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, |
1889 | gdbarch_get_longjmp_target_ftype get_longjmp_target) | |
0f71a2f6 | 1890 | { |
b8de8283 | 1891 | gdbarch->get_longjmp_target = get_longjmp_target; |
0f71a2f6 JM |
1892 | } |
1893 | ||
1894 | int | |
104c1213 | 1895 | gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) |
0f71a2f6 | 1896 | { |
8de9bdc4 | 1897 | gdb_assert (gdbarch != NULL); |
0f71a2f6 | 1898 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
1899 | fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n"); |
1900 | return gdbarch->believe_pcc_promotion; | |
1901 | } | |
1902 | ||
1903 | void | |
104c1213 JM |
1904 | set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, |
1905 | int believe_pcc_promotion) | |
0f71a2f6 JM |
1906 | { |
1907 | gdbarch->believe_pcc_promotion = believe_pcc_promotion; | |
1908 | } | |
1909 | ||
13d01224 | 1910 | int |
ff2e87ac | 1911 | gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) |
13d01224 AC |
1912 | { |
1913 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1914 | gdb_assert (gdbarch->convert_register_p != NULL); |
13d01224 AC |
1915 | if (gdbarch_debug >= 2) |
1916 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n"); | |
ff2e87ac | 1917 | return gdbarch->convert_register_p (regnum, type); |
13d01224 AC |
1918 | } |
1919 | ||
1920 | void | |
1921 | set_gdbarch_convert_register_p (struct gdbarch *gdbarch, | |
1922 | gdbarch_convert_register_p_ftype convert_register_p) | |
1923 | { | |
1924 | gdbarch->convert_register_p = convert_register_p; | |
1925 | } | |
1926 | ||
1927 | void | |
b60c417a | 1928 | gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf) |
13d01224 AC |
1929 | { |
1930 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1931 | gdb_assert (gdbarch->register_to_value != NULL); |
13d01224 AC |
1932 | if (gdbarch_debug >= 2) |
1933 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n"); | |
ff2e87ac | 1934 | gdbarch->register_to_value (frame, regnum, type, buf); |
13d01224 AC |
1935 | } |
1936 | ||
1937 | void | |
1938 | set_gdbarch_register_to_value (struct gdbarch *gdbarch, | |
1939 | gdbarch_register_to_value_ftype register_to_value) | |
1940 | { | |
1941 | gdbarch->register_to_value = register_to_value; | |
1942 | } | |
1943 | ||
1944 | void | |
b60c417a | 1945 | gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf) |
13d01224 AC |
1946 | { |
1947 | gdb_assert (gdbarch != NULL); | |
956ac328 | 1948 | gdb_assert (gdbarch->value_to_register != NULL); |
13d01224 AC |
1949 | if (gdbarch_debug >= 2) |
1950 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n"); | |
ff2e87ac | 1951 | gdbarch->value_to_register (frame, regnum, type, buf); |
13d01224 AC |
1952 | } |
1953 | ||
1954 | void | |
1955 | set_gdbarch_value_to_register (struct gdbarch *gdbarch, | |
1956 | gdbarch_value_to_register_ftype value_to_register) | |
1957 | { | |
1958 | gdbarch->value_to_register = value_to_register; | |
1959 | } | |
1960 | ||
9acbedc0 UW |
1961 | struct value * |
1962 | gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame) | |
1963 | { | |
1964 | gdb_assert (gdbarch != NULL); | |
1965 | gdb_assert (gdbarch->value_from_register != NULL); | |
1966 | if (gdbarch_debug >= 2) | |
1967 | fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n"); | |
1968 | return gdbarch->value_from_register (type, regnum, frame); | |
1969 | } | |
1970 | ||
1971 | void | |
1972 | set_gdbarch_value_from_register (struct gdbarch *gdbarch, | |
1973 | gdbarch_value_from_register_ftype value_from_register) | |
1974 | { | |
1975 | gdbarch->value_from_register = value_from_register; | |
1976 | } | |
1977 | ||
4478b372 | 1978 | CORE_ADDR |
b60c417a | 1979 | gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf) |
4478b372 | 1980 | { |
8de9bdc4 | 1981 | gdb_assert (gdbarch != NULL); |
956ac328 | 1982 | gdb_assert (gdbarch->pointer_to_address != NULL); |
4478b372 JB |
1983 | if (gdbarch_debug >= 2) |
1984 | fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); | |
1985 | return gdbarch->pointer_to_address (type, buf); | |
1986 | } | |
1987 | ||
1988 | void | |
1989 | set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, | |
1990 | gdbarch_pointer_to_address_ftype pointer_to_address) | |
1991 | { | |
1992 | gdbarch->pointer_to_address = pointer_to_address; | |
1993 | } | |
1994 | ||
1995 | void | |
b60c417a | 1996 | gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr) |
4478b372 | 1997 | { |
8de9bdc4 | 1998 | gdb_assert (gdbarch != NULL); |
956ac328 | 1999 | gdb_assert (gdbarch->address_to_pointer != NULL); |
4478b372 JB |
2000 | if (gdbarch_debug >= 2) |
2001 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); | |
2002 | gdbarch->address_to_pointer (type, buf, addr); | |
2003 | } | |
2004 | ||
2005 | void | |
2006 | set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, | |
2007 | gdbarch_address_to_pointer_ftype address_to_pointer) | |
2008 | { | |
2009 | gdbarch->address_to_pointer = address_to_pointer; | |
2010 | } | |
2011 | ||
fc0c74b1 AC |
2012 | int |
2013 | gdbarch_integer_to_address_p (struct gdbarch *gdbarch) | |
2014 | { | |
8de9bdc4 | 2015 | gdb_assert (gdbarch != NULL); |
956ac328 | 2016 | return gdbarch->integer_to_address != NULL; |
fc0c74b1 AC |
2017 | } |
2018 | ||
2019 | CORE_ADDR | |
fc1a4b47 | 2020 | gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf) |
fc0c74b1 | 2021 | { |
8de9bdc4 | 2022 | gdb_assert (gdbarch != NULL); |
956ac328 | 2023 | gdb_assert (gdbarch->integer_to_address != NULL); |
fc0c74b1 AC |
2024 | if (gdbarch_debug >= 2) |
2025 | fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); | |
79dd2d24 | 2026 | return gdbarch->integer_to_address (gdbarch, type, buf); |
fc0c74b1 AC |
2027 | } |
2028 | ||
2029 | void | |
2030 | set_gdbarch_integer_to_address (struct gdbarch *gdbarch, | |
2031 | gdbarch_integer_to_address_ftype integer_to_address) | |
2032 | { | |
2033 | gdbarch->integer_to_address = integer_to_address; | |
2034 | } | |
2035 | ||
92ad9cd9 AC |
2036 | int |
2037 | gdbarch_return_value_p (struct gdbarch *gdbarch) | |
2038 | { | |
2039 | gdb_assert (gdbarch != NULL); | |
750eb019 | 2040 | return gdbarch->return_value != legacy_return_value; |
92ad9cd9 AC |
2041 | } |
2042 | ||
2043 | enum return_value_convention | |
b60c417a | 2044 | gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) |
92ad9cd9 AC |
2045 | { |
2046 | gdb_assert (gdbarch != NULL); | |
2047 | gdb_assert (gdbarch->return_value != NULL); | |
750eb019 | 2048 | /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */ |
92ad9cd9 AC |
2049 | if (gdbarch_debug >= 2) |
2050 | fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n"); | |
963e2bb7 | 2051 | return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf); |
92ad9cd9 AC |
2052 | } |
2053 | ||
2054 | void | |
2055 | set_gdbarch_return_value (struct gdbarch *gdbarch, | |
2056 | gdbarch_return_value_ftype return_value) | |
2057 | { | |
2058 | gdbarch->return_value = return_value; | |
2059 | } | |
2060 | ||
0f71a2f6 | 2061 | void |
b60c417a | 2062 | gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf) |
ebba8386 AC |
2063 | { |
2064 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2065 | gdb_assert (gdbarch->extract_return_value != NULL); |
ebba8386 AC |
2066 | if (gdbarch_debug >= 2) |
2067 | fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); | |
2068 | gdbarch->extract_return_value (type, regcache, valbuf); | |
2069 | } | |
2070 | ||
2071 | void | |
2072 | set_gdbarch_extract_return_value (struct gdbarch *gdbarch, | |
2073 | gdbarch_extract_return_value_ftype extract_return_value) | |
2074 | { | |
2075 | gdbarch->extract_return_value = extract_return_value; | |
2076 | } | |
2077 | ||
2078 | void | |
b60c417a | 2079 | gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf) |
0f71a2f6 | 2080 | { |
8de9bdc4 | 2081 | gdb_assert (gdbarch != NULL); |
956ac328 | 2082 | gdb_assert (gdbarch->store_return_value != NULL); |
0f71a2f6 | 2083 | if (gdbarch_debug >= 2) |
0f71a2f6 | 2084 | fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); |
ebba8386 | 2085 | gdbarch->store_return_value (type, regcache, valbuf); |
0f71a2f6 JM |
2086 | } |
2087 | ||
2088 | void | |
104c1213 JM |
2089 | set_gdbarch_store_return_value (struct gdbarch *gdbarch, |
2090 | gdbarch_store_return_value_ftype store_return_value) | |
0f71a2f6 JM |
2091 | { |
2092 | gdbarch->store_return_value = store_return_value; | |
2093 | } | |
2094 | ||
92ad9cd9 | 2095 | int |
b5622e8d | 2096 | gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) |
92ad9cd9 AC |
2097 | { |
2098 | gdb_assert (gdbarch != NULL); | |
b5622e8d | 2099 | gdb_assert (gdbarch->deprecated_use_struct_convention != NULL); |
92ad9cd9 | 2100 | if (gdbarch_debug >= 2) |
b5622e8d AC |
2101 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n"); |
2102 | return gdbarch->deprecated_use_struct_convention (gcc_p, value_type); | |
92ad9cd9 AC |
2103 | } |
2104 | ||
2105 | void | |
b5622e8d AC |
2106 | set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, |
2107 | gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention) | |
92ad9cd9 | 2108 | { |
b5622e8d | 2109 | gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention; |
92ad9cd9 AC |
2110 | } |
2111 | ||
0f71a2f6 JM |
2112 | CORE_ADDR |
2113 | gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) | |
2114 | { | |
8de9bdc4 | 2115 | gdb_assert (gdbarch != NULL); |
956ac328 | 2116 | gdb_assert (gdbarch->skip_prologue != NULL); |
0f71a2f6 | 2117 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2118 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); |
2119 | return gdbarch->skip_prologue (ip); | |
2120 | } | |
2121 | ||
2122 | void | |
104c1213 JM |
2123 | set_gdbarch_skip_prologue (struct gdbarch *gdbarch, |
2124 | gdbarch_skip_prologue_ftype skip_prologue) | |
0f71a2f6 JM |
2125 | { |
2126 | gdbarch->skip_prologue = skip_prologue; | |
2127 | } | |
2128 | ||
2129 | int | |
2130 | gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) | |
2131 | { | |
8de9bdc4 | 2132 | gdb_assert (gdbarch != NULL); |
956ac328 | 2133 | gdb_assert (gdbarch->inner_than != NULL); |
0f71a2f6 | 2134 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2135 | fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); |
2136 | return gdbarch->inner_than (lhs, rhs); | |
2137 | } | |
2138 | ||
2139 | void | |
104c1213 JM |
2140 | set_gdbarch_inner_than (struct gdbarch *gdbarch, |
2141 | gdbarch_inner_than_ftype inner_than) | |
0f71a2f6 JM |
2142 | { |
2143 | gdbarch->inner_than = inner_than; | |
2144 | } | |
2145 | ||
fc1a4b47 | 2146 | const gdb_byte * |
adf40b2e | 2147 | gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
0f71a2f6 | 2148 | { |
8de9bdc4 | 2149 | gdb_assert (gdbarch != NULL); |
956ac328 | 2150 | gdb_assert (gdbarch->breakpoint_from_pc != NULL); |
0f71a2f6 | 2151 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2152 | fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); |
2153 | return gdbarch->breakpoint_from_pc (pcptr, lenptr); | |
2154 | } | |
2155 | ||
2156 | void | |
104c1213 JM |
2157 | set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, |
2158 | gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) | |
0f71a2f6 JM |
2159 | { |
2160 | gdbarch->breakpoint_from_pc = breakpoint_from_pc; | |
2161 | } | |
2162 | ||
a1131521 KB |
2163 | int |
2164 | gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch) | |
2165 | { | |
2166 | gdb_assert (gdbarch != NULL); | |
2167 | return gdbarch->adjust_breakpoint_address != NULL; | |
2168 | } | |
2169 | ||
2170 | CORE_ADDR | |
2171 | gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) | |
2172 | { | |
2173 | gdb_assert (gdbarch != NULL); | |
2174 | gdb_assert (gdbarch->adjust_breakpoint_address != NULL); | |
2175 | if (gdbarch_debug >= 2) | |
2176 | fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n"); | |
2177 | return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr); | |
2178 | } | |
2179 | ||
2180 | void | |
2181 | set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, | |
2182 | gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address) | |
2183 | { | |
2184 | gdbarch->adjust_breakpoint_address = adjust_breakpoint_address; | |
2185 | } | |
2186 | ||
917317f4 | 2187 | int |
8181d85f | 2188 | gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) |
917317f4 | 2189 | { |
8de9bdc4 | 2190 | gdb_assert (gdbarch != NULL); |
956ac328 | 2191 | gdb_assert (gdbarch->memory_insert_breakpoint != NULL); |
917317f4 | 2192 | if (gdbarch_debug >= 2) |
917317f4 | 2193 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); |
8181d85f | 2194 | return gdbarch->memory_insert_breakpoint (bp_tgt); |
917317f4 JM |
2195 | } |
2196 | ||
2197 | void | |
2198 | set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, | |
2199 | gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint) | |
2200 | { | |
2201 | gdbarch->memory_insert_breakpoint = memory_insert_breakpoint; | |
2202 | } | |
2203 | ||
2204 | int | |
8181d85f | 2205 | gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) |
917317f4 | 2206 | { |
8de9bdc4 | 2207 | gdb_assert (gdbarch != NULL); |
956ac328 | 2208 | gdb_assert (gdbarch->memory_remove_breakpoint != NULL); |
917317f4 | 2209 | if (gdbarch_debug >= 2) |
917317f4 | 2210 | fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); |
8181d85f | 2211 | return gdbarch->memory_remove_breakpoint (bp_tgt); |
917317f4 JM |
2212 | } |
2213 | ||
2214 | void | |
2215 | set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, | |
2216 | gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint) | |
2217 | { | |
2218 | gdbarch->memory_remove_breakpoint = memory_remove_breakpoint; | |
2219 | } | |
2220 | ||
0f71a2f6 | 2221 | CORE_ADDR |
104c1213 | 2222 | gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) |
0f71a2f6 | 2223 | { |
8de9bdc4 | 2224 | gdb_assert (gdbarch != NULL); |
71bd6bd4 | 2225 | /* Skip verify of decr_pc_after_break, invalid_p == 0 */ |
0f71a2f6 | 2226 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2227 | fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); |
2228 | return gdbarch->decr_pc_after_break; | |
2229 | } | |
2230 | ||
2231 | void | |
104c1213 JM |
2232 | set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, |
2233 | CORE_ADDR decr_pc_after_break) | |
0f71a2f6 JM |
2234 | { |
2235 | gdbarch->decr_pc_after_break = decr_pc_after_break; | |
2236 | } | |
2237 | ||
2238 | CORE_ADDR | |
782263ab | 2239 | gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch) |
0f71a2f6 | 2240 | { |
8de9bdc4 | 2241 | gdb_assert (gdbarch != NULL); |
782263ab | 2242 | /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */ |
0f71a2f6 | 2243 | if (gdbarch_debug >= 2) |
782263ab AC |
2244 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n"); |
2245 | return gdbarch->deprecated_function_start_offset; | |
0f71a2f6 JM |
2246 | } |
2247 | ||
2248 | void | |
782263ab AC |
2249 | set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, |
2250 | CORE_ADDR deprecated_function_start_offset) | |
0f71a2f6 | 2251 | { |
782263ab | 2252 | gdbarch->deprecated_function_start_offset = deprecated_function_start_offset; |
0f71a2f6 JM |
2253 | } |
2254 | ||
123dc839 DJ |
2255 | int |
2256 | gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno) | |
2257 | { | |
2258 | gdb_assert (gdbarch != NULL); | |
2259 | gdb_assert (gdbarch->remote_register_number != NULL); | |
2260 | if (gdbarch_debug >= 2) | |
2261 | fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n"); | |
2262 | return gdbarch->remote_register_number (gdbarch, regno); | |
2263 | } | |
2264 | ||
2265 | void | |
2266 | set_gdbarch_remote_register_number (struct gdbarch *gdbarch, | |
2267 | gdbarch_remote_register_number_ftype remote_register_number) | |
2268 | { | |
2269 | gdbarch->remote_register_number = remote_register_number; | |
2270 | } | |
2271 | ||
b2756930 KB |
2272 | int |
2273 | gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch) | |
2274 | { | |
2275 | gdb_assert (gdbarch != NULL); | |
2276 | return gdbarch->fetch_tls_load_module_address != NULL; | |
2277 | } | |
2278 | ||
2279 | CORE_ADDR | |
2280 | gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile) | |
2281 | { | |
2282 | gdb_assert (gdbarch != NULL); | |
2283 | gdb_assert (gdbarch->fetch_tls_load_module_address != NULL); | |
2284 | if (gdbarch_debug >= 2) | |
2285 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n"); | |
2286 | return gdbarch->fetch_tls_load_module_address (objfile); | |
2287 | } | |
2288 | ||
2289 | void | |
2290 | set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, | |
2291 | gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address) | |
2292 | { | |
2293 | gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address; | |
2294 | } | |
2295 | ||
0f71a2f6 | 2296 | CORE_ADDR |
104c1213 | 2297 | gdbarch_frame_args_skip (struct gdbarch *gdbarch) |
0f71a2f6 | 2298 | { |
8de9bdc4 | 2299 | gdb_assert (gdbarch != NULL); |
5867a2fb | 2300 | /* Skip verify of frame_args_skip, invalid_p == 0 */ |
0f71a2f6 | 2301 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2302 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); |
2303 | return gdbarch->frame_args_skip; | |
2304 | } | |
2305 | ||
2306 | void | |
104c1213 JM |
2307 | set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, |
2308 | CORE_ADDR frame_args_skip) | |
0f71a2f6 JM |
2309 | { |
2310 | gdbarch->frame_args_skip = frame_args_skip; | |
2311 | } | |
2312 | ||
12cc2063 AC |
2313 | int |
2314 | gdbarch_unwind_pc_p (struct gdbarch *gdbarch) | |
2315 | { | |
2316 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2317 | return gdbarch->unwind_pc != NULL; |
12cc2063 AC |
2318 | } |
2319 | ||
2320 | CORE_ADDR | |
2321 | gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
2322 | { | |
2323 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2324 | gdb_assert (gdbarch->unwind_pc != NULL); |
12cc2063 AC |
2325 | if (gdbarch_debug >= 2) |
2326 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n"); | |
2327 | return gdbarch->unwind_pc (gdbarch, next_frame); | |
2328 | } | |
2329 | ||
2330 | void | |
2331 | set_gdbarch_unwind_pc (struct gdbarch *gdbarch, | |
2332 | gdbarch_unwind_pc_ftype unwind_pc) | |
2333 | { | |
2334 | gdbarch->unwind_pc = unwind_pc; | |
2335 | } | |
2336 | ||
a9e5fdc2 AC |
2337 | int |
2338 | gdbarch_unwind_sp_p (struct gdbarch *gdbarch) | |
2339 | { | |
2340 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2341 | return gdbarch->unwind_sp != NULL; |
a9e5fdc2 AC |
2342 | } |
2343 | ||
2344 | CORE_ADDR | |
2345 | gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame) | |
2346 | { | |
2347 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2348 | gdb_assert (gdbarch->unwind_sp != NULL); |
a9e5fdc2 AC |
2349 | if (gdbarch_debug >= 2) |
2350 | fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n"); | |
2351 | return gdbarch->unwind_sp (gdbarch, next_frame); | |
2352 | } | |
2353 | ||
2354 | void | |
2355 | set_gdbarch_unwind_sp (struct gdbarch *gdbarch, | |
2356 | gdbarch_unwind_sp_ftype unwind_sp) | |
2357 | { | |
2358 | gdbarch->unwind_sp = unwind_sp; | |
2359 | } | |
2360 | ||
983a287a AC |
2361 | int |
2362 | gdbarch_frame_num_args_p (struct gdbarch *gdbarch) | |
2363 | { | |
2364 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2365 | return gdbarch->frame_num_args != NULL; |
983a287a AC |
2366 | } |
2367 | ||
0f71a2f6 JM |
2368 | int |
2369 | gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) | |
2370 | { | |
8de9bdc4 | 2371 | gdb_assert (gdbarch != NULL); |
956ac328 | 2372 | gdb_assert (gdbarch->frame_num_args != NULL); |
0f71a2f6 | 2373 | if (gdbarch_debug >= 2) |
0f71a2f6 JM |
2374 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); |
2375 | return gdbarch->frame_num_args (frame); | |
2376 | } | |
2377 | ||
2378 | void | |
104c1213 JM |
2379 | set_gdbarch_frame_num_args (struct gdbarch *gdbarch, |
2380 | gdbarch_frame_num_args_ftype frame_num_args) | |
0f71a2f6 JM |
2381 | { |
2382 | gdbarch->frame_num_args = frame_num_args; | |
2383 | } | |
2384 | ||
dc604539 AC |
2385 | int |
2386 | gdbarch_frame_align_p (struct gdbarch *gdbarch) | |
2387 | { | |
2388 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2389 | return gdbarch->frame_align != NULL; |
dc604539 AC |
2390 | } |
2391 | ||
2392 | CORE_ADDR | |
2393 | gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address) | |
2394 | { | |
2395 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2396 | gdb_assert (gdbarch->frame_align != NULL); |
dc604539 AC |
2397 | if (gdbarch_debug >= 2) |
2398 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n"); | |
2399 | return gdbarch->frame_align (gdbarch, address); | |
2400 | } | |
2401 | ||
2402 | void | |
2403 | set_gdbarch_frame_align (struct gdbarch *gdbarch, | |
2404 | gdbarch_frame_align_ftype frame_align) | |
2405 | { | |
2406 | gdbarch->frame_align = frame_align; | |
2407 | } | |
2408 | ||
d03e67c9 | 2409 | int |
88d89dbb | 2410 | gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch) |
d03e67c9 | 2411 | { |
8de9bdc4 | 2412 | gdb_assert (gdbarch != NULL); |
88d89dbb | 2413 | return gdbarch->deprecated_reg_struct_has_addr != NULL; |
d03e67c9 AC |
2414 | } |
2415 | ||
2416 | int | |
88d89dbb | 2417 | gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) |
d03e67c9 | 2418 | { |
8de9bdc4 | 2419 | gdb_assert (gdbarch != NULL); |
88d89dbb | 2420 | gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL); |
d03e67c9 | 2421 | if (gdbarch_debug >= 2) |
88d89dbb MK |
2422 | fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n"); |
2423 | return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type); | |
d03e67c9 AC |
2424 | } |
2425 | ||
2426 | void | |
88d89dbb MK |
2427 | set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, |
2428 | gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr) | |
d03e67c9 | 2429 | { |
88d89dbb | 2430 | gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr; |
d03e67c9 AC |
2431 | } |
2432 | ||
192cb3d4 MK |
2433 | int |
2434 | gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) | |
2435 | { | |
2436 | gdb_assert (gdbarch != NULL); | |
2437 | gdb_assert (gdbarch->stabs_argument_has_addr != NULL); | |
2438 | if (gdbarch_debug >= 2) | |
2439 | fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n"); | |
2440 | return gdbarch->stabs_argument_has_addr (gdbarch, type); | |
2441 | } | |
2442 | ||
2443 | void | |
2444 | set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, | |
2445 | gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr) | |
2446 | { | |
2447 | gdbarch->stabs_argument_has_addr = stabs_argument_has_addr; | |
2448 | } | |
2449 | ||
8b148df9 AC |
2450 | int |
2451 | gdbarch_frame_red_zone_size (struct gdbarch *gdbarch) | |
2452 | { | |
2453 | gdb_assert (gdbarch != NULL); | |
2454 | if (gdbarch_debug >= 2) | |
2455 | fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n"); | |
2456 | return gdbarch->frame_red_zone_size; | |
2457 | } | |
2458 | ||
2459 | void | |
2460 | set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, | |
2461 | int frame_red_zone_size) | |
2462 | { | |
2463 | gdbarch->frame_red_zone_size = frame_red_zone_size; | |
2464 | } | |
2465 | ||
f517ea4e | 2466 | CORE_ADDR |
e2d0e7eb | 2467 | gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ) |
f517ea4e | 2468 | { |
8de9bdc4 | 2469 | gdb_assert (gdbarch != NULL); |
956ac328 | 2470 | gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL); |
f517ea4e PS |
2471 | if (gdbarch_debug >= 2) |
2472 | fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); | |
e2d0e7eb | 2473 | return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ); |
f517ea4e PS |
2474 | } |
2475 | ||
2476 | void | |
2477 | set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, | |
2478 | gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr) | |
2479 | { | |
2480 | gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr; | |
2481 | } | |
2482 | ||
875e1767 AC |
2483 | CORE_ADDR |
2484 | gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2485 | { | |
8de9bdc4 | 2486 | gdb_assert (gdbarch != NULL); |
956ac328 | 2487 | gdb_assert (gdbarch->addr_bits_remove != NULL); |
875e1767 AC |
2488 | if (gdbarch_debug >= 2) |
2489 | fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n"); | |
2490 | return gdbarch->addr_bits_remove (addr); | |
2491 | } | |
2492 | ||
2493 | void | |
2494 | set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, | |
2495 | gdbarch_addr_bits_remove_ftype addr_bits_remove) | |
2496 | { | |
2497 | gdbarch->addr_bits_remove = addr_bits_remove; | |
2498 | } | |
2499 | ||
181c1381 RE |
2500 | CORE_ADDR |
2501 | gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2502 | { | |
8de9bdc4 | 2503 | gdb_assert (gdbarch != NULL); |
956ac328 | 2504 | gdb_assert (gdbarch->smash_text_address != NULL); |
181c1381 RE |
2505 | if (gdbarch_debug >= 2) |
2506 | fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n"); | |
2507 | return gdbarch->smash_text_address (addr); | |
2508 | } | |
2509 | ||
2510 | void | |
2511 | set_gdbarch_smash_text_address (struct gdbarch *gdbarch, | |
2512 | gdbarch_smash_text_address_ftype smash_text_address) | |
2513 | { | |
2514 | gdbarch->smash_text_address = smash_text_address; | |
2515 | } | |
2516 | ||
64c4637f AC |
2517 | int |
2518 | gdbarch_software_single_step_p (struct gdbarch *gdbarch) | |
2519 | { | |
8de9bdc4 | 2520 | gdb_assert (gdbarch != NULL); |
956ac328 | 2521 | return gdbarch->software_single_step != NULL; |
64c4637f AC |
2522 | } |
2523 | ||
e6590a1b | 2524 | int |
0b1b3e42 | 2525 | gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame) |
64c4637f | 2526 | { |
8de9bdc4 | 2527 | gdb_assert (gdbarch != NULL); |
956ac328 | 2528 | gdb_assert (gdbarch->software_single_step != NULL); |
64c4637f AC |
2529 | if (gdbarch_debug >= 2) |
2530 | fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n"); | |
0b1b3e42 | 2531 | return gdbarch->software_single_step (frame); |
64c4637f AC |
2532 | } |
2533 | ||
2534 | void | |
2535 | set_gdbarch_software_single_step (struct gdbarch *gdbarch, | |
2536 | gdbarch_software_single_step_ftype software_single_step) | |
2537 | { | |
2538 | gdbarch->software_single_step = software_single_step; | |
2539 | } | |
2540 | ||
3352ef37 AC |
2541 | int |
2542 | gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch) | |
2543 | { | |
2544 | gdb_assert (gdbarch != NULL); | |
2545 | return gdbarch->single_step_through_delay != NULL; | |
2546 | } | |
2547 | ||
2548 | int | |
2549 | gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame) | |
2550 | { | |
2551 | gdb_assert (gdbarch != NULL); | |
2552 | gdb_assert (gdbarch->single_step_through_delay != NULL); | |
2553 | if (gdbarch_debug >= 2) | |
2554 | fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n"); | |
2555 | return gdbarch->single_step_through_delay (gdbarch, frame); | |
2556 | } | |
2557 | ||
2558 | void | |
2559 | set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch, | |
2560 | gdbarch_single_step_through_delay_ftype single_step_through_delay) | |
2561 | { | |
2562 | gdbarch->single_step_through_delay = single_step_through_delay; | |
2563 | } | |
2564 | ||
2bf0cb65 | 2565 | int |
a89aa300 | 2566 | gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info) |
2bf0cb65 | 2567 | { |
8de9bdc4 | 2568 | gdb_assert (gdbarch != NULL); |
956ac328 | 2569 | gdb_assert (gdbarch->print_insn != NULL); |
2bf0cb65 EZ |
2570 | if (gdbarch_debug >= 2) |
2571 | fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n"); | |
2572 | return gdbarch->print_insn (vma, info); | |
2573 | } | |
2574 | ||
2575 | void | |
2576 | set_gdbarch_print_insn (struct gdbarch *gdbarch, | |
2577 | gdbarch_print_insn_ftype print_insn) | |
2578 | { | |
2579 | gdbarch->print_insn = print_insn; | |
2580 | } | |
2581 | ||
bdcd319a | 2582 | CORE_ADDR |
52f729a7 | 2583 | gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc) |
bdcd319a | 2584 | { |
8de9bdc4 | 2585 | gdb_assert (gdbarch != NULL); |
956ac328 | 2586 | gdb_assert (gdbarch->skip_trampoline_code != NULL); |
bdcd319a CV |
2587 | if (gdbarch_debug >= 2) |
2588 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n"); | |
52f729a7 | 2589 | return gdbarch->skip_trampoline_code (frame, pc); |
bdcd319a CV |
2590 | } |
2591 | ||
2592 | void | |
2593 | set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, | |
2594 | gdbarch_skip_trampoline_code_ftype skip_trampoline_code) | |
2595 | { | |
2596 | gdbarch->skip_trampoline_code = skip_trampoline_code; | |
2597 | } | |
2598 | ||
dea0c52f MK |
2599 | CORE_ADDR |
2600 | gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) | |
2601 | { | |
2602 | gdb_assert (gdbarch != NULL); | |
2603 | gdb_assert (gdbarch->skip_solib_resolver != NULL); | |
2604 | if (gdbarch_debug >= 2) | |
2605 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n"); | |
4c8c40e6 | 2606 | return gdbarch->skip_solib_resolver (gdbarch, pc); |
dea0c52f MK |
2607 | } |
2608 | ||
2609 | void | |
2610 | set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, | |
2611 | gdbarch_skip_solib_resolver_ftype skip_solib_resolver) | |
2612 | { | |
2613 | gdbarch->skip_solib_resolver = skip_solib_resolver; | |
2614 | } | |
2615 | ||
d50355b6 MS |
2616 | int |
2617 | gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name) | |
2618 | { | |
2619 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2620 | gdb_assert (gdbarch->in_solib_return_trampoline != NULL); |
d50355b6 MS |
2621 | if (gdbarch_debug >= 2) |
2622 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n"); | |
2623 | return gdbarch->in_solib_return_trampoline (pc, name); | |
2624 | } | |
2625 | ||
2626 | void | |
2627 | set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, | |
2628 | gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline) | |
2629 | { | |
2630 | gdbarch->in_solib_return_trampoline = in_solib_return_trampoline; | |
2631 | } | |
2632 | ||
c12260ac CV |
2633 | int |
2634 | gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr) | |
2635 | { | |
8de9bdc4 | 2636 | gdb_assert (gdbarch != NULL); |
956ac328 | 2637 | gdb_assert (gdbarch->in_function_epilogue_p != NULL); |
c12260ac CV |
2638 | if (gdbarch_debug >= 2) |
2639 | fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n"); | |
2640 | return gdbarch->in_function_epilogue_p (gdbarch, addr); | |
2641 | } | |
2642 | ||
2643 | void | |
2644 | set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, | |
2645 | gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p) | |
2646 | { | |
2647 | gdbarch->in_function_epilogue_p = in_function_epilogue_p; | |
2648 | } | |
2649 | ||
552c04a7 TT |
2650 | char * |
2651 | gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv) | |
2652 | { | |
8de9bdc4 | 2653 | gdb_assert (gdbarch != NULL); |
956ac328 | 2654 | gdb_assert (gdbarch->construct_inferior_arguments != NULL); |
552c04a7 TT |
2655 | if (gdbarch_debug >= 2) |
2656 | fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n"); | |
2657 | return gdbarch->construct_inferior_arguments (gdbarch, argc, argv); | |
2658 | } | |
2659 | ||
2660 | void | |
2661 | set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, | |
2662 | gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments) | |
2663 | { | |
2664 | gdbarch->construct_inferior_arguments = construct_inferior_arguments; | |
2665 | } | |
2666 | ||
a2cf933a EZ |
2667 | void |
2668 | gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym) | |
2669 | { | |
8de9bdc4 | 2670 | gdb_assert (gdbarch != NULL); |
956ac328 | 2671 | gdb_assert (gdbarch->elf_make_msymbol_special != NULL); |
a2cf933a EZ |
2672 | if (gdbarch_debug >= 2) |
2673 | fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n"); | |
2674 | gdbarch->elf_make_msymbol_special (sym, msym); | |
2675 | } | |
2676 | ||
2677 | void | |
2678 | set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, | |
2679 | gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special) | |
2680 | { | |
2681 | gdbarch->elf_make_msymbol_special = elf_make_msymbol_special; | |
2682 | } | |
2683 | ||
2684 | void | |
2685 | gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym) | |
2686 | { | |
8de9bdc4 | 2687 | gdb_assert (gdbarch != NULL); |
956ac328 | 2688 | gdb_assert (gdbarch->coff_make_msymbol_special != NULL); |
a2cf933a EZ |
2689 | if (gdbarch_debug >= 2) |
2690 | fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n"); | |
2691 | gdbarch->coff_make_msymbol_special (val, msym); | |
2692 | } | |
2693 | ||
2694 | void | |
2695 | set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, | |
2696 | gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special) | |
2697 | { | |
2698 | gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; | |
2699 | } | |
2700 | ||
5720643c JB |
2701 | const char * |
2702 | gdbarch_name_of_malloc (struct gdbarch *gdbarch) | |
2703 | { | |
2704 | gdb_assert (gdbarch != NULL); | |
2705 | /* Skip verify of name_of_malloc, invalid_p == 0 */ | |
2706 | if (gdbarch_debug >= 2) | |
2707 | fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n"); | |
2708 | return gdbarch->name_of_malloc; | |
2709 | } | |
2710 | ||
2711 | void | |
2712 | set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, | |
2713 | const char * name_of_malloc) | |
2714 | { | |
2715 | gdbarch->name_of_malloc = name_of_malloc; | |
2716 | } | |
2717 | ||
c4ed33b9 AC |
2718 | int |
2719 | gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch) | |
2720 | { | |
2721 | gdb_assert (gdbarch != NULL); | |
2722 | /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ | |
2723 | if (gdbarch_debug >= 2) | |
2724 | fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n"); | |
2725 | return gdbarch->cannot_step_breakpoint; | |
2726 | } | |
2727 | ||
2728 | void | |
2729 | set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, | |
2730 | int cannot_step_breakpoint) | |
2731 | { | |
2732 | gdbarch->cannot_step_breakpoint = cannot_step_breakpoint; | |
2733 | } | |
2734 | ||
f74fa174 MM |
2735 | int |
2736 | gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch) | |
2737 | { | |
2738 | gdb_assert (gdbarch != NULL); | |
2739 | /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ | |
2740 | if (gdbarch_debug >= 2) | |
2741 | fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n"); | |
2742 | return gdbarch->have_nonsteppable_watchpoint; | |
2743 | } | |
2744 | ||
2745 | void | |
2746 | set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, | |
967c0d83 | 2747 | int have_nonsteppable_watchpoint) |
f74fa174 MM |
2748 | { |
2749 | gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint; | |
2750 | } | |
2751 | ||
8b2dbe47 KB |
2752 | int |
2753 | gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch) | |
2754 | { | |
2755 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2756 | return gdbarch->address_class_type_flags != NULL; |
8b2dbe47 KB |
2757 | } |
2758 | ||
2759 | int | |
2760 | gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class) | |
2761 | { | |
2762 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2763 | gdb_assert (gdbarch->address_class_type_flags != NULL); |
8b2dbe47 KB |
2764 | if (gdbarch_debug >= 2) |
2765 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n"); | |
2766 | return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class); | |
2767 | } | |
2768 | ||
2769 | void | |
2770 | set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, | |
2771 | gdbarch_address_class_type_flags_ftype address_class_type_flags) | |
2772 | { | |
2773 | gdbarch->address_class_type_flags = address_class_type_flags; | |
2774 | } | |
2775 | ||
2776 | int | |
2777 | gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) | |
2778 | { | |
2779 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2780 | return gdbarch->address_class_type_flags_to_name != NULL; |
8b2dbe47 KB |
2781 | } |
2782 | ||
321432c0 | 2783 | const char * |
8b2dbe47 KB |
2784 | gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) |
2785 | { | |
2786 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2787 | gdb_assert (gdbarch->address_class_type_flags_to_name != NULL); |
8b2dbe47 KB |
2788 | if (gdbarch_debug >= 2) |
2789 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n"); | |
5f11f355 | 2790 | return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags); |
8b2dbe47 KB |
2791 | } |
2792 | ||
2793 | void | |
2794 | set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, | |
2795 | gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name) | |
2796 | { | |
2797 | gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name; | |
2798 | } | |
2799 | ||
2800 | int | |
2801 | gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) | |
2802 | { | |
2803 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2804 | return gdbarch->address_class_name_to_type_flags != NULL; |
8b2dbe47 KB |
2805 | } |
2806 | ||
2807 | int | |
321432c0 | 2808 | gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) |
8b2dbe47 KB |
2809 | { |
2810 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2811 | gdb_assert (gdbarch->address_class_name_to_type_flags != NULL); |
8b2dbe47 KB |
2812 | if (gdbarch_debug >= 2) |
2813 | fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n"); | |
5f11f355 | 2814 | return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr); |
8b2dbe47 KB |
2815 | } |
2816 | ||
2817 | void | |
2818 | set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, | |
2819 | gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags) | |
2820 | { | |
2821 | gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags; | |
2822 | } | |
2823 | ||
b59ff9d5 AC |
2824 | int |
2825 | gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup) | |
2826 | { | |
2827 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2828 | gdb_assert (gdbarch->register_reggroup_p != NULL); |
b59ff9d5 AC |
2829 | if (gdbarch_debug >= 2) |
2830 | fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n"); | |
2831 | return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup); | |
2832 | } | |
2833 | ||
2834 | void | |
2835 | set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, | |
2836 | gdbarch_register_reggroup_p_ftype register_reggroup_p) | |
2837 | { | |
2838 | gdbarch->register_reggroup_p = register_reggroup_p; | |
2839 | } | |
2840 | ||
143985b7 AF |
2841 | int |
2842 | gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch) | |
2843 | { | |
2844 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2845 | return gdbarch->fetch_pointer_argument != NULL; |
143985b7 AF |
2846 | } |
2847 | ||
2848 | CORE_ADDR | |
2849 | gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type) | |
2850 | { | |
2851 | gdb_assert (gdbarch != NULL); | |
956ac328 | 2852 | gdb_assert (gdbarch->fetch_pointer_argument != NULL); |
143985b7 AF |
2853 | if (gdbarch_debug >= 2) |
2854 | fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n"); | |
2855 | return gdbarch->fetch_pointer_argument (frame, argi, type); | |
2856 | } | |
2857 | ||
2858 | void | |
2859 | set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, | |
2860 | gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument) | |
2861 | { | |
2862 | gdbarch->fetch_pointer_argument = fetch_pointer_argument; | |
2863 | } | |
2864 | ||
6ce6d90f MK |
2865 | int |
2866 | gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch) | |
2867 | { | |
2868 | gdb_assert (gdbarch != NULL); | |
2869 | return gdbarch->regset_from_core_section != NULL; | |
2870 | } | |
2871 | ||
2872 | const struct regset * | |
2873 | gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) | |
2874 | { | |
2875 | gdb_assert (gdbarch != NULL); | |
2876 | gdb_assert (gdbarch->regset_from_core_section != NULL); | |
2877 | if (gdbarch_debug >= 2) | |
2878 | fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n"); | |
2879 | return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size); | |
2880 | } | |
2881 | ||
2882 | void | |
2883 | set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch, | |
2884 | gdbarch_regset_from_core_section_ftype regset_from_core_section) | |
2885 | { | |
2886 | gdbarch->regset_from_core_section = regset_from_core_section; | |
2887 | } | |
2888 | ||
0d5de010 DJ |
2889 | int |
2890 | gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch) | |
2891 | { | |
2892 | gdb_assert (gdbarch != NULL); | |
2893 | /* Skip verify of vtable_function_descriptors, invalid_p == 0 */ | |
2894 | if (gdbarch_debug >= 2) | |
2895 | fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n"); | |
2896 | return gdbarch->vtable_function_descriptors; | |
2897 | } | |
2898 | ||
2899 | void | |
2900 | set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, | |
2901 | int vtable_function_descriptors) | |
2902 | { | |
2903 | gdbarch->vtable_function_descriptors = vtable_function_descriptors; | |
2904 | } | |
2905 | ||
2906 | int | |
2907 | gdbarch_vbit_in_delta (struct gdbarch *gdbarch) | |
2908 | { | |
2909 | gdb_assert (gdbarch != NULL); | |
2910 | /* Skip verify of vbit_in_delta, invalid_p == 0 */ | |
2911 | if (gdbarch_debug >= 2) | |
2912 | fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n"); | |
2913 | return gdbarch->vbit_in_delta; | |
2914 | } | |
2915 | ||
2916 | void | |
2917 | set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, | |
2918 | int vbit_in_delta) | |
2919 | { | |
2920 | gdbarch->vbit_in_delta = vbit_in_delta; | |
2921 | } | |
2922 | ||
6d350bb5 UW |
2923 | int |
2924 | gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch) | |
2925 | { | |
2926 | gdb_assert (gdbarch != NULL); | |
2927 | return gdbarch->skip_permanent_breakpoint != NULL; | |
2928 | } | |
2929 | ||
2930 | void | |
2931 | gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache) | |
2932 | { | |
2933 | gdb_assert (gdbarch != NULL); | |
2934 | gdb_assert (gdbarch->skip_permanent_breakpoint != NULL); | |
2935 | if (gdbarch_debug >= 2) | |
2936 | fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n"); | |
2937 | gdbarch->skip_permanent_breakpoint (regcache); | |
2938 | } | |
2939 | ||
2940 | void | |
2941 | set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, | |
2942 | gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint) | |
2943 | { | |
2944 | gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint; | |
2945 | } | |
2946 | ||
1c772458 UW |
2947 | int |
2948 | gdbarch_overlay_update_p (struct gdbarch *gdbarch) | |
2949 | { | |
2950 | gdb_assert (gdbarch != NULL); | |
2951 | return gdbarch->overlay_update != NULL; | |
2952 | } | |
2953 | ||
2954 | void | |
2955 | gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect) | |
2956 | { | |
2957 | gdb_assert (gdbarch != NULL); | |
2958 | gdb_assert (gdbarch->overlay_update != NULL); | |
2959 | if (gdbarch_debug >= 2) | |
2960 | fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n"); | |
2961 | gdbarch->overlay_update (osect); | |
2962 | } | |
2963 | ||
2964 | void | |
2965 | set_gdbarch_overlay_update (struct gdbarch *gdbarch, | |
2966 | gdbarch_overlay_update_ftype overlay_update) | |
2967 | { | |
2968 | gdbarch->overlay_update = overlay_update; | |
2969 | } | |
2970 | ||
0f71a2f6 | 2971 | |
be5a57e1 | 2972 | /* Keep a registry of per-architecture data-pointers required by GDB |
0f71a2f6 JM |
2973 | modules. */ |
2974 | ||
2975 | struct gdbarch_data | |
2976 | { | |
95160752 | 2977 | unsigned index; |
76860b5f | 2978 | int init_p; |
030f20e1 AC |
2979 | gdbarch_data_pre_init_ftype *pre_init; |
2980 | gdbarch_data_post_init_ftype *post_init; | |
0f71a2f6 JM |
2981 | }; |
2982 | ||
2983 | struct gdbarch_data_registration | |
adf40b2e | 2984 | { |
adf40b2e JM |
2985 | struct gdbarch_data *data; |
2986 | struct gdbarch_data_registration *next; | |
2987 | }; | |
0f71a2f6 | 2988 | |
be5a57e1 | 2989 | struct gdbarch_data_registry |
adf40b2e | 2990 | { |
95160752 | 2991 | unsigned nr; |
adf40b2e JM |
2992 | struct gdbarch_data_registration *registrations; |
2993 | }; | |
0f71a2f6 | 2994 | |
be5a57e1 | 2995 | struct gdbarch_data_registry gdbarch_data_registry = |
0f71a2f6 JM |
2996 | { |
2997 | 0, NULL, | |
2998 | }; | |
2999 | ||
030f20e1 AC |
3000 | static struct gdbarch_data * |
3001 | gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init, | |
3002 | gdbarch_data_post_init_ftype *post_init) | |
0f71a2f6 JM |
3003 | { |
3004 | struct gdbarch_data_registration **curr; | |
76860b5f | 3005 | /* Append the new registraration. */ |
be5a57e1 | 3006 | for (curr = &gdbarch_data_registry.registrations; |
0f71a2f6 JM |
3007 | (*curr) != NULL; |
3008 | curr = &(*curr)->next); | |
3009 | (*curr) = XMALLOC (struct gdbarch_data_registration); | |
3010 | (*curr)->next = NULL; | |
0f71a2f6 | 3011 | (*curr)->data = XMALLOC (struct gdbarch_data); |
be5a57e1 | 3012 | (*curr)->data->index = gdbarch_data_registry.nr++; |
030f20e1 AC |
3013 | (*curr)->data->pre_init = pre_init; |
3014 | (*curr)->data->post_init = post_init; | |
76860b5f | 3015 | (*curr)->data->init_p = 1; |
0f71a2f6 JM |
3016 | return (*curr)->data; |
3017 | } | |
3018 | ||
030f20e1 AC |
3019 | struct gdbarch_data * |
3020 | gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init) | |
3021 | { | |
3022 | return gdbarch_data_register (pre_init, NULL); | |
3023 | } | |
3024 | ||
3025 | struct gdbarch_data * | |
3026 | gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init) | |
3027 | { | |
3028 | return gdbarch_data_register (NULL, post_init); | |
3029 | } | |
0f71a2f6 | 3030 | |
b3cc3077 | 3031 | /* Create/delete the gdbarch data vector. */ |
95160752 AC |
3032 | |
3033 | static void | |
b3cc3077 | 3034 | alloc_gdbarch_data (struct gdbarch *gdbarch) |
95160752 | 3035 | { |
b3cc3077 JB |
3036 | gdb_assert (gdbarch->data == NULL); |
3037 | gdbarch->nr_data = gdbarch_data_registry.nr; | |
aebd7893 | 3038 | gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *); |
0f71a2f6 JM |
3039 | } |
3040 | ||
76860b5f | 3041 | /* Initialize the current value of the specified per-architecture |
b3cc3077 JB |
3042 | data-pointer. */ |
3043 | ||
95160752 | 3044 | void |
030f20e1 AC |
3045 | deprecated_set_gdbarch_data (struct gdbarch *gdbarch, |
3046 | struct gdbarch_data *data, | |
3047 | void *pointer) | |
95160752 AC |
3048 | { |
3049 | gdb_assert (data->index < gdbarch->nr_data); | |
aebd7893 | 3050 | gdb_assert (gdbarch->data[data->index] == NULL); |
030f20e1 | 3051 | gdb_assert (data->pre_init == NULL); |
95160752 AC |
3052 | gdbarch->data[data->index] = pointer; |
3053 | } | |
3054 | ||
0f71a2f6 JM |
3055 | /* Return the current value of the specified per-architecture |
3056 | data-pointer. */ | |
3057 | ||
3058 | void * | |
451fbdda | 3059 | gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data) |
0f71a2f6 | 3060 | { |
451fbdda | 3061 | gdb_assert (data->index < gdbarch->nr_data); |
030f20e1 | 3062 | if (gdbarch->data[data->index] == NULL) |
76860b5f | 3063 | { |
030f20e1 AC |
3064 | /* The data-pointer isn't initialized, call init() to get a |
3065 | value. */ | |
3066 | if (data->pre_init != NULL) | |
3067 | /* Mid architecture creation: pass just the obstack, and not | |
3068 | the entire architecture, as that way it isn't possible for | |
3069 | pre-init code to refer to undefined architecture | |
3070 | fields. */ | |
3071 | gdbarch->data[data->index] = data->pre_init (gdbarch->obstack); | |
3072 | else if (gdbarch->initialized_p | |
3073 | && data->post_init != NULL) | |
3074 | /* Post architecture creation: pass the entire architecture | |
3075 | (as all fields are valid), but be careful to also detect | |
3076 | recursive references. */ | |
3077 | { | |
3078 | gdb_assert (data->init_p); | |
3079 | data->init_p = 0; | |
3080 | gdbarch->data[data->index] = data->post_init (gdbarch); | |
3081 | data->init_p = 1; | |
3082 | } | |
3083 | else | |
3084 | /* The architecture initialization hasn't completed - punt - | |
3085 | hope that the caller knows what they are doing. Once | |
3086 | deprecated_set_gdbarch_data has been initialized, this can be | |
3087 | changed to an internal error. */ | |
3088 | return NULL; | |
76860b5f AC |
3089 | gdb_assert (gdbarch->data[data->index] != NULL); |
3090 | } | |
451fbdda | 3091 | return gdbarch->data[data->index]; |
0f71a2f6 JM |
3092 | } |
3093 | ||
3094 | ||
be5a57e1 | 3095 | /* Keep a registry of the architectures known by GDB. */ |
0f71a2f6 | 3096 | |
4b9b3959 | 3097 | struct gdbarch_registration |
0f71a2f6 JM |
3098 | { |
3099 | enum bfd_architecture bfd_architecture; | |
3100 | gdbarch_init_ftype *init; | |
4b9b3959 | 3101 | gdbarch_dump_tdep_ftype *dump_tdep; |
0f71a2f6 | 3102 | struct gdbarch_list *arches; |
4b9b3959 | 3103 | struct gdbarch_registration *next; |
0f71a2f6 JM |
3104 | }; |
3105 | ||
be5a57e1 | 3106 | static struct gdbarch_registration *gdbarch_registry = NULL; |
0f71a2f6 | 3107 | |
b4a20239 AC |
3108 | static void |
3109 | append_name (const char ***buf, int *nr, const char *name) | |
3110 | { | |
3111 | *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1)); | |
3112 | (*buf)[*nr] = name; | |
3113 | *nr += 1; | |
3114 | } | |
3115 | ||
3116 | const char ** | |
3117 | gdbarch_printable_names (void) | |
3118 | { | |
7996bcec AC |
3119 | /* Accumulate a list of names based on the registed list of |
3120 | architectures. */ | |
3121 | enum bfd_architecture a; | |
3122 | int nr_arches = 0; | |
3123 | const char **arches = NULL; | |
3124 | struct gdbarch_registration *rego; | |
3125 | for (rego = gdbarch_registry; | |
3126 | rego != NULL; | |
3127 | rego = rego->next) | |
b4a20239 | 3128 | { |
7996bcec AC |
3129 | const struct bfd_arch_info *ap; |
3130 | ap = bfd_lookup_arch (rego->bfd_architecture, 0); | |
3131 | if (ap == NULL) | |
3132 | internal_error (__FILE__, __LINE__, | |
e2e0b3e5 | 3133 | _("gdbarch_architecture_names: multi-arch unknown")); |
7996bcec AC |
3134 | do |
3135 | { | |
3136 | append_name (&arches, &nr_arches, ap->printable_name); | |
3137 | ap = ap->next; | |
3138 | } | |
3139 | while (ap != NULL); | |
b4a20239 | 3140 | } |
7996bcec AC |
3141 | append_name (&arches, &nr_arches, NULL); |
3142 | return arches; | |
b4a20239 AC |
3143 | } |
3144 | ||
3145 | ||
0f71a2f6 | 3146 | void |
4b9b3959 AC |
3147 | gdbarch_register (enum bfd_architecture bfd_architecture, |
3148 | gdbarch_init_ftype *init, | |
3149 | gdbarch_dump_tdep_ftype *dump_tdep) | |
0f71a2f6 | 3150 | { |
4b9b3959 | 3151 | struct gdbarch_registration **curr; |
0f71a2f6 | 3152 | const struct bfd_arch_info *bfd_arch_info; |
ec3d358c | 3153 | /* Check that BFD recognizes this architecture */ |
0f71a2f6 JM |
3154 | bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); |
3155 | if (bfd_arch_info == NULL) | |
3156 | { | |
8e65ff28 | 3157 | internal_error (__FILE__, __LINE__, |
85c07804 | 3158 | _("gdbarch: Attempt to register unknown architecture (%d)"), |
8e65ff28 | 3159 | bfd_architecture); |
0f71a2f6 JM |
3160 | } |
3161 | /* Check that we haven't seen this architecture before */ | |
be5a57e1 | 3162 | for (curr = &gdbarch_registry; |
0f71a2f6 JM |
3163 | (*curr) != NULL; |
3164 | curr = &(*curr)->next) | |
3165 | { | |
3166 | if (bfd_architecture == (*curr)->bfd_architecture) | |
8e65ff28 | 3167 | internal_error (__FILE__, __LINE__, |
85c07804 | 3168 | _("gdbarch: Duplicate registraration of architecture (%s)"), |
8e65ff28 | 3169 | bfd_arch_info->printable_name); |
0f71a2f6 JM |
3170 | } |
3171 | /* log it */ | |
3172 | if (gdbarch_debug) | |
3173 | fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", | |
3174 | bfd_arch_info->printable_name, | |
3175 | (long) init); | |
3176 | /* Append it */ | |
4b9b3959 | 3177 | (*curr) = XMALLOC (struct gdbarch_registration); |
0f71a2f6 JM |
3178 | (*curr)->bfd_architecture = bfd_architecture; |
3179 | (*curr)->init = init; | |
4b9b3959 | 3180 | (*curr)->dump_tdep = dump_tdep; |
0f71a2f6 JM |
3181 | (*curr)->arches = NULL; |
3182 | (*curr)->next = NULL; | |
4b9b3959 AC |
3183 | } |
3184 | ||
3185 | void | |
3186 | register_gdbarch_init (enum bfd_architecture bfd_architecture, | |
3187 | gdbarch_init_ftype *init) | |
3188 | { | |
3189 | gdbarch_register (bfd_architecture, init, NULL); | |
0f71a2f6 | 3190 | } |
0f71a2f6 JM |
3191 | |
3192 | ||
424163ea | 3193 | /* Look for an architecture using gdbarch_info. */ |
0f71a2f6 JM |
3194 | |
3195 | struct gdbarch_list * | |
104c1213 JM |
3196 | gdbarch_list_lookup_by_info (struct gdbarch_list *arches, |
3197 | const struct gdbarch_info *info) | |
0f71a2f6 JM |
3198 | { |
3199 | for (; arches != NULL; arches = arches->next) | |
3200 | { | |
3201 | if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) | |
3202 | continue; | |
3203 | if (info->byte_order != arches->gdbarch->byte_order) | |
3204 | continue; | |
4be87837 DJ |
3205 | if (info->osabi != arches->gdbarch->osabi) |
3206 | continue; | |
424163ea DJ |
3207 | if (info->target_desc != arches->gdbarch->target_desc) |
3208 | continue; | |
0f71a2f6 JM |
3209 | return arches; |
3210 | } | |
3211 | return NULL; | |
3212 | } | |
3213 | ||
3214 | ||
ebdba546 AC |
3215 | /* Find an architecture that matches the specified INFO. Create a new |
3216 | architecture if needed. Return that new architecture. Assumes | |
3217 | that there is no current architecture. */ | |
0f71a2f6 | 3218 | |
ebdba546 | 3219 | static struct gdbarch * |
7a107747 | 3220 | find_arch_by_info (struct gdbarch_info info) |
0f71a2f6 JM |
3221 | { |
3222 | struct gdbarch *new_gdbarch; | |
4b9b3959 | 3223 | struct gdbarch_registration *rego; |
0f71a2f6 | 3224 | |
ebdba546 AC |
3225 | /* The existing architecture has been swapped out - all this code |
3226 | works from a clean slate. */ | |
3227 | gdb_assert (current_gdbarch == NULL); | |
3228 | ||
b732d07d | 3229 | /* Fill in missing parts of the INFO struct using a number of |
7a107747 DJ |
3230 | sources: "set ..."; INFOabfd supplied; and the global |
3231 | defaults. */ | |
3232 | gdbarch_info_fill (&info); | |
4be87837 | 3233 | |
b732d07d AC |
3234 | /* Must have found some sort of architecture. */ |
3235 | gdb_assert (info.bfd_arch_info != NULL); | |
0f71a2f6 JM |
3236 | |
3237 | if (gdbarch_debug) | |
3238 | { | |
0f71a2f6 | 3239 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 3240 | "find_arch_by_info: info.bfd_arch_info %s\n", |
0f71a2f6 JM |
3241 | (info.bfd_arch_info != NULL |
3242 | ? info.bfd_arch_info->printable_name | |
3243 | : "(null)")); | |
3244 | fprintf_unfiltered (gdb_stdlog, | |
ebdba546 | 3245 | "find_arch_by_info: info.byte_order %d (%s)\n", |
0f71a2f6 | 3246 | info.byte_order, |
d7449b42 | 3247 | (info.byte_order == BFD_ENDIAN_BIG ? "big" |
778eb05e | 3248 | : info.byte_order == BFD_ENDIAN_LITTLE ? "little" |
0f71a2f6 | 3249 | : "default")); |
4be87837 | 3250 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 3251 | "find_arch_by_info: info.osabi %d (%s)\n", |
4be87837 | 3252 | info.osabi, gdbarch_osabi_name (info.osabi)); |
0f71a2f6 | 3253 | fprintf_unfiltered (gdb_stdlog, |
ebdba546 | 3254 | "find_arch_by_info: info.abfd 0x%lx\n", |
0f71a2f6 JM |
3255 | (long) info.abfd); |
3256 | fprintf_unfiltered (gdb_stdlog, | |
ebdba546 | 3257 | "find_arch_by_info: info.tdep_info 0x%lx\n", |
0f71a2f6 JM |
3258 | (long) info.tdep_info); |
3259 | } | |
3260 | ||
ebdba546 | 3261 | /* Find the tdep code that knows about this architecture. */ |
b732d07d AC |
3262 | for (rego = gdbarch_registry; |
3263 | rego != NULL; | |
3264 | rego = rego->next) | |
3265 | if (rego->bfd_architecture == info.bfd_arch_info->arch) | |
3266 | break; | |
3267 | if (rego == NULL) | |
3268 | { | |
3269 | if (gdbarch_debug) | |
ebdba546 AC |
3270 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
3271 | "No matching architecture\n"); | |
b732d07d AC |
3272 | return 0; |
3273 | } | |
3274 | ||
ebdba546 | 3275 | /* Ask the tdep code for an architecture that matches "info". */ |
0f71a2f6 JM |
3276 | new_gdbarch = rego->init (info, rego->arches); |
3277 | ||
ebdba546 AC |
3278 | /* Did the tdep code like it? No. Reject the change and revert to |
3279 | the old architecture. */ | |
0f71a2f6 JM |
3280 | if (new_gdbarch == NULL) |
3281 | { | |
3282 | if (gdbarch_debug) | |
ebdba546 AC |
3283 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
3284 | "Target rejected architecture\n"); | |
3285 | return NULL; | |
0f71a2f6 JM |
3286 | } |
3287 | ||
ebdba546 AC |
3288 | /* Is this a pre-existing architecture (as determined by already |
3289 | being initialized)? Move it to the front of the architecture | |
3290 | list (keeping the list sorted Most Recently Used). */ | |
3291 | if (new_gdbarch->initialized_p) | |
0f71a2f6 | 3292 | { |
ebdba546 AC |
3293 | struct gdbarch_list **list; |
3294 | struct gdbarch_list *this; | |
0f71a2f6 | 3295 | if (gdbarch_debug) |
ebdba546 AC |
3296 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " |
3297 | "Previous architecture 0x%08lx (%s) selected\n", | |
0f71a2f6 JM |
3298 | (long) new_gdbarch, |
3299 | new_gdbarch->bfd_arch_info->printable_name); | |
ebdba546 AC |
3300 | /* Find the existing arch in the list. */ |
3301 | for (list = ®o->arches; | |
3302 | (*list) != NULL && (*list)->gdbarch != new_gdbarch; | |
3303 | list = &(*list)->next); | |
3304 | /* It had better be in the list of architectures. */ | |
3305 | gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch); | |
3306 | /* Unlink THIS. */ | |
3307 | this = (*list); | |
3308 | (*list) = this->next; | |
3309 | /* Insert THIS at the front. */ | |
3310 | this->next = rego->arches; | |
3311 | rego->arches = this; | |
3312 | /* Return it. */ | |
3313 | return new_gdbarch; | |
0f71a2f6 JM |
3314 | } |
3315 | ||
ebdba546 AC |
3316 | /* It's a new architecture. */ |
3317 | if (gdbarch_debug) | |
3318 | fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: " | |
3319 | "New architecture 0x%08lx (%s) selected\n", | |
3320 | (long) new_gdbarch, | |
3321 | new_gdbarch->bfd_arch_info->printable_name); | |
3322 | ||
3323 | /* Insert the new architecture into the front of the architecture | |
3324 | list (keep the list sorted Most Recently Used). */ | |
0f79675b AC |
3325 | { |
3326 | struct gdbarch_list *this = XMALLOC (struct gdbarch_list); | |
3327 | this->next = rego->arches; | |
3328 | this->gdbarch = new_gdbarch; | |
3329 | rego->arches = this; | |
3330 | } | |
0f71a2f6 | 3331 | |
4b9b3959 AC |
3332 | /* Check that the newly installed architecture is valid. Plug in |
3333 | any post init values. */ | |
3334 | new_gdbarch->dump_tdep = rego->dump_tdep; | |
0f71a2f6 | 3335 | verify_gdbarch (new_gdbarch); |
ebdba546 | 3336 | new_gdbarch->initialized_p = 1; |
0f71a2f6 | 3337 | |
4b9b3959 | 3338 | if (gdbarch_debug) |
ebdba546 | 3339 | gdbarch_dump (new_gdbarch, gdb_stdlog); |
4b9b3959 | 3340 | |
ebdba546 | 3341 | return new_gdbarch; |
0f71a2f6 | 3342 | } |
c906108c | 3343 | |
ebdba546 AC |
3344 | struct gdbarch * |
3345 | gdbarch_find_by_info (struct gdbarch_info info) | |
3346 | { | |
e487cc15 UW |
3347 | struct gdbarch *new_gdbarch; |
3348 | ||
ebdba546 AC |
3349 | /* Save the previously selected architecture, setting the global to |
3350 | NULL. This stops things like gdbarch->init() trying to use the | |
3351 | previous architecture's configuration. The previous architecture | |
3352 | may not even be of the same architecture family. The most recent | |
3353 | architecture of the same family is found at the head of the | |
3354 | rego->arches list. */ | |
e487cc15 UW |
3355 | struct gdbarch *old_gdbarch = current_gdbarch; |
3356 | current_gdbarch = NULL; | |
ebdba546 AC |
3357 | |
3358 | /* Find the specified architecture. */ | |
e487cc15 | 3359 | new_gdbarch = find_arch_by_info (info); |
ebdba546 AC |
3360 | |
3361 | /* Restore the existing architecture. */ | |
3362 | gdb_assert (current_gdbarch == NULL); | |
e487cc15 | 3363 | current_gdbarch = old_gdbarch; |
ebdba546 AC |
3364 | |
3365 | return new_gdbarch; | |
3366 | } | |
3367 | ||
e487cc15 | 3368 | /* Make the specified architecture current. */ |
ebdba546 AC |
3369 | |
3370 | void | |
3371 | deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch) | |
3372 | { | |
3373 | gdb_assert (new_gdbarch != NULL); | |
3374 | gdb_assert (current_gdbarch != NULL); | |
3375 | gdb_assert (new_gdbarch->initialized_p); | |
e487cc15 | 3376 | current_gdbarch = new_gdbarch; |
ebdba546 | 3377 | architecture_changed_event (); |
35f196d9 | 3378 | reinit_frame_cache (); |
ebdba546 | 3379 | } |
c906108c | 3380 | |
104c1213 | 3381 | extern void _initialize_gdbarch (void); |
b4a20239 | 3382 | |
c906108c | 3383 | void |
7c7651b2 | 3384 | _initialize_gdbarch (void) |
c906108c | 3385 | { |
5d161b24 DB |
3386 | struct cmd_list_element *c; |
3387 | ||
85c07804 AC |
3388 | add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\ |
3389 | Set architecture debugging."), _("\ | |
3390 | Show architecture debugging."), _("\ | |
3391 | When non-zero, architecture debugging is enabled."), | |
3392 | NULL, | |
920d2a44 | 3393 | show_gdbarch_debug, |
85c07804 | 3394 | &setdebuglist, &showdebuglist); |
c906108c | 3395 | } |