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