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