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