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