2003-05-15 Richard Sandiford <rsandifo@redhat.com>
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
CommitLineData
59233f88
AC
1/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
adf40b2e 3/* Dynamic architecture support for GDB, the GNU debugger.
79d45cd4
AC
4
5 Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
6 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
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, 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;
64
65
66/* Maintain the struct gdbarch object */
67
68struct gdbarch
adf40b2e 69{
76860b5f
AC
70 /* Has this architecture been fully initialized? */
71 int initialized_p;
aebd7893
AC
72
73 /* An obstack bound to the lifetime of the architecture. */
74 struct obstack *obstack;
75
adf40b2e
JM
76 /* basic architectural information */
77 const struct bfd_arch_info * bfd_arch_info;
78 int byte_order;
4be87837 79 enum gdb_osabi osabi;
0f71a2f6 80
adf40b2e
JM
81 /* target specific vector. */
82 struct gdbarch_tdep *tdep;
4b9b3959 83 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 84
adf40b2e 85 /* per-architecture data-pointers */
95160752 86 unsigned nr_data;
adf40b2e 87 void **data;
0f71a2f6 88
adf40b2e
JM
89 /* per-architecture swap-regions */
90 struct gdbarch_swap *swap;
0f71a2f6 91
adf40b2e 92 /* Multi-arch values.
0f71a2f6 93
adf40b2e 94 When extending this structure you must:
0f71a2f6 95
adf40b2e 96 Add the field below.
0f71a2f6 97
adf40b2e
JM
98 Declare set/get functions and define the corresponding
99 macro in gdbarch.h.
0f71a2f6 100
adf40b2e
JM
101 gdbarch_alloc(): If zero/NULL is not a suitable default,
102 initialize the new field.
0f71a2f6 103
adf40b2e
JM
104 verify_gdbarch(): Confirm that the target updated the field
105 correctly.
0f71a2f6 106
7e73cedf 107 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
adf40b2e 108 field is dumped out
0f71a2f6 109
c0e8c252 110 ``startup_gdbarch()'': Append an initial value to the static
adf40b2e 111 variable (base values on the host's c-type system).
0f71a2f6 112
adf40b2e
JM
113 get_gdbarch(): Implement the set/get functions (probably using
114 the macro's as shortcuts).
0f71a2f6
JM
115
116 */
117
adf40b2e
JM
118 int short_bit;
119 int int_bit;
120 int long_bit;
121 int long_long_bit;
122 int float_bit;
123 int double_bit;
124 int long_double_bit;
66b43ecb 125 int ptr_bit;
52204a0b 126 int addr_bit;
66b43ecb 127 int bfd_vma_bit;
4e409299 128 int char_signed;
adf40b2e
JM
129 gdbarch_read_pc_ftype *read_pc;
130 gdbarch_write_pc_ftype *write_pc;
adf40b2e 131 gdbarch_read_sp_ftype *read_sp;
39d4ef09 132 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
d8124050
AC
133 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
134 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
adf40b2e 135 int num_regs;
0aba1244 136 int num_pseudo_regs;
adf40b2e 137 int sp_regnum;
adf40b2e 138 int pc_regnum;
c2169756 139 int ps_regnum;
60054393 140 int fp0_regnum;
88c72b7d
AC
141 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
142 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
143 gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
144 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
145 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
adf40b2e 146 gdbarch_register_name_ftype *register_name;
9c04cab7
AC
147 gdbarch_register_type_ftype *register_type;
148 gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type;
b8b527c5 149 int deprecated_register_bytes;
9c04cab7
AC
150 gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
151 gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size;
152 gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size;
f3be58bc 153 gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
a59fe496 154 gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos;
f3be58bc
AC
155 int deprecated_fp_regnum;
156 gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp;
b8de8283
AC
157 gdbarch_push_dummy_call_ftype *push_dummy_call;
158 gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
b8de8283
AC
159 gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address;
160 gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp;
161 int deprecated_register_size;
adf40b2e 162 int call_dummy_location;
7043d8dc 163 gdbarch_push_dummy_code_ftype *push_dummy_code;
b8de8283
AC
164 gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
165 gdbarch_print_registers_info_ftype *print_registers_info;
166 gdbarch_print_float_info_ftype *print_float_info;
167 gdbarch_print_vector_info_ftype *print_vector_info;
168 gdbarch_register_sim_regno_ftype *register_sim_regno;
169 gdbarch_register_bytes_ok_ftype *register_bytes_ok;
170 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
171 gdbarch_cannot_store_register_ftype *cannot_store_register;
172 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
a5afb99f 173 gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
adf40b2e 174 int believe_pcc_promotion;
129c1cd6 175 gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
13d01224
AC
176 gdbarch_convert_register_p_ftype *convert_register_p;
177 gdbarch_register_to_value_ftype *register_to_value;
178 gdbarch_value_to_register_ftype *value_to_register;
4478b372
JB
179 gdbarch_pointer_to_address_ftype *pointer_to_address;
180 gdbarch_address_to_pointer_ftype *address_to_pointer;
fc0c74b1 181 gdbarch_integer_to_address_ftype *integer_to_address;
749b82f6 182 gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame;
4183d812 183 gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
92ad9cd9 184 gdbarch_return_value_ftype *return_value;
ebba8386 185 gdbarch_extract_return_value_ftype *extract_return_value;
adf40b2e 186 gdbarch_store_return_value_ftype *store_return_value;
ebba8386
AC
187 gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
188 gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
b5622e8d 189 gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
74055713 190 gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
f30ee0bc 191 gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs;
e9582e71 192 gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info;
adf40b2e
JM
193 gdbarch_skip_prologue_ftype *skip_prologue;
194 gdbarch_inner_than_ftype *inner_than;
195 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
a1131521 196 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
917317f4
JM
197 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
198 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
adf40b2e 199 CORE_ADDR decr_pc_after_break;
782263ab 200 CORE_ADDR deprecated_function_start_offset;
adf40b2e
JM
201 gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
202 CORE_ADDR frame_args_skip;
19772a2c 203 gdbarch_deprecated_frameless_function_invocation_ftype *deprecated_frameless_function_invocation;
618ce49f
AC
204 gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain;
205 gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid;
8bedc050 206 gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc;
12cc2063 207 gdbarch_unwind_pc_ftype *unwind_pc;
a9e5fdc2 208 gdbarch_unwind_sp_ftype *unwind_sp;
42efa47a
AC
209 gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address;
210 gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address;
6913c89a 211 gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call;
adf40b2e 212 gdbarch_frame_num_args_ftype *frame_num_args;
f27dd7fd 213 gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
dc604539 214 gdbarch_frame_align_ftype *frame_align;
88d89dbb 215 gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
192cb3d4 216 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
8b148df9 217 int frame_red_zone_size;
f0d4cc9e
AC
218 const struct floatformat * float_format;
219 const struct floatformat * double_format;
220 const struct floatformat * long_double_format;
f517ea4e 221 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
875e1767 222 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
181c1381 223 gdbarch_smash_text_address_ftype *smash_text_address;
64c4637f 224 gdbarch_software_single_step_ftype *software_single_step;
2bf0cb65 225 gdbarch_print_insn_ftype *print_insn;
bdcd319a 226 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
dea0c52f 227 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
68e9cc94 228 gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
d50355b6 229 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
c12260ac 230 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
552c04a7 231 gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
a2cf933a
EZ
232 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
233 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
5720643c 234 const char * name_of_malloc;
c4ed33b9 235 int cannot_step_breakpoint;
f74fa174 236 int have_nonsteppable_watchpoint;
8b2dbe47
KB
237 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
238 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
239 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
b59ff9d5 240 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
143985b7 241 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
6ce6d90f 242 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
adf40b2e 243};
0f71a2f6
JM
244
245
246/* The default architecture uses host values (for want of a better
247 choice). */
248
249extern const struct bfd_arch_info bfd_default_arch_struct;
250
4b9b3959
AC
251struct gdbarch startup_gdbarch =
252{
76860b5f 253 1, /* Always initialized. */
aebd7893 254 NULL, /* The obstack. */
0f71a2f6 255 /* basic architecture information */
ec5cbaec
AC
256 &bfd_default_arch_struct, /* bfd_arch_info */
257 BFD_ENDIAN_BIG, /* byte_order */
258 GDB_OSABI_UNKNOWN, /* osabi */
4b9b3959
AC
259 /* target specific vector and its dump routine */
260 NULL, NULL,
0f71a2f6
JM
261 /*per-architecture data-pointers and swap regions */
262 0, NULL, NULL,
263 /* Multi-arch values */
ec5cbaec
AC
264 8 * sizeof (short), /* short_bit */
265 8 * sizeof (int), /* int_bit */
266 8 * sizeof (long), /* long_bit */
267 8 * sizeof (LONGEST), /* long_long_bit */
268 8 * sizeof (float), /* float_bit */
269 8 * sizeof (double), /* double_bit */
270 8 * sizeof (long double), /* long_double_bit */
271 8 * sizeof (void*), /* ptr_bit */
272 8 * sizeof (void*), /* addr_bit */
273 8 * sizeof (void*), /* bfd_vma_bit */
274 1, /* char_signed */
275 0, /* read_pc */
276 0, /* write_pc */
ec5cbaec 277 0, /* read_sp */
ec5cbaec
AC
278 0, /* virtual_frame_pointer */
279 0, /* pseudo_register_read */
280 0, /* pseudo_register_write */
281 0, /* num_regs */
282 0, /* num_pseudo_regs */
283 -1, /* sp_regnum */
ec5cbaec
AC
284 -1, /* pc_regnum */
285 -1, /* ps_regnum */
286 0, /* fp0_regnum */
ec5cbaec
AC
287 0, /* stab_reg_to_regnum */
288 0, /* ecoff_reg_to_regnum */
289 0, /* dwarf_reg_to_regnum */
290 0, /* sdb_reg_to_regnum */
291 0, /* dwarf2_reg_to_regnum */
292 0, /* register_name */
9c04cab7
AC
293 0, /* register_type */
294 0, /* deprecated_register_virtual_type */
ec5cbaec 295 0, /* deprecated_register_bytes */
9c04cab7
AC
296 generic_register_byte, /* deprecated_register_byte */
297 generic_register_size, /* deprecated_register_raw_size */
298 generic_register_size, /* deprecated_register_virtual_size */
f3be58bc 299 0, /* unwind_dummy_id */
a59fe496 300 0, /* deprecated_save_dummy_frame_tos */
f3be58bc
AC
301 -1, /* deprecated_fp_regnum */
302 0, /* deprecated_target_read_fp */
b8de8283
AC
303 0, /* push_dummy_call */
304 0, /* deprecated_push_arguments */
b8de8283
AC
305 0, /* deprecated_push_return_address */
306 0, /* deprecated_dummy_write_sp */
307 0, /* deprecated_register_size */
ec5cbaec 308 0, /* call_dummy_location */
ec5cbaec 309 0, /* push_dummy_code */
b8de8283
AC
310 0, /* deprecated_do_registers_info */
311 default_print_registers_info, /* print_registers_info */
312 0, /* print_float_info */
313 0, /* print_vector_info */
314 0, /* register_sim_regno */
315 0, /* register_bytes_ok */
316 0, /* cannot_fetch_register */
317 0, /* cannot_store_register */
318 0, /* get_longjmp_target */
ec5cbaec
AC
319 0, /* deprecated_init_frame_pc */
320 0, /* believe_pcc_promotion */
ec5cbaec 321 0, /* deprecated_get_saved_register */
ec5cbaec
AC
322 0, /* convert_register_p */
323 0, /* register_to_value */
324 0, /* value_to_register */
325 0, /* pointer_to_address */
326 0, /* address_to_pointer */
327 0, /* integer_to_address */
ec5cbaec
AC
328 0, /* deprecated_pop_frame */
329 0, /* deprecated_store_struct_return */
92ad9cd9 330 0, /* return_value */
ec5cbaec
AC
331 0, /* extract_return_value */
332 0, /* store_return_value */
333 0, /* deprecated_extract_return_value */
334 0, /* deprecated_store_return_value */
b5622e8d 335 0, /* deprecated_use_struct_convention */
74055713 336 0, /* deprecated_extract_struct_value_address */
ec5cbaec
AC
337 0, /* deprecated_frame_init_saved_regs */
338 0, /* deprecated_init_extra_frame_info */
339 0, /* skip_prologue */
ec5cbaec
AC
340 0, /* inner_than */
341 0, /* breakpoint_from_pc */
a1131521 342 0, /* adjust_breakpoint_address */
ec5cbaec
AC
343 0, /* memory_insert_breakpoint */
344 0, /* memory_remove_breakpoint */
345 0, /* decr_pc_after_break */
782263ab 346 0, /* deprecated_function_start_offset */
ec5cbaec
AC
347 generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
348 0, /* frame_args_skip */
19772a2c 349 0, /* deprecated_frameless_function_invocation */
ec5cbaec
AC
350 0, /* deprecated_frame_chain */
351 0, /* deprecated_frame_chain_valid */
352 0, /* deprecated_frame_saved_pc */
353 0, /* unwind_pc */
a9e5fdc2 354 0, /* unwind_sp */
42efa47a
AC
355 get_frame_base, /* deprecated_frame_args_address */
356 get_frame_base, /* deprecated_frame_locals_address */
ec5cbaec
AC
357 0, /* deprecated_saved_pc_after_call */
358 0, /* frame_num_args */
f27dd7fd 359 0, /* deprecated_stack_align */
ec5cbaec 360 0, /* frame_align */
88d89dbb 361 0, /* deprecated_reg_struct_has_addr */
192cb3d4 362 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
8b148df9 363 0, /* frame_red_zone_size */
ec5cbaec
AC
364 0, /* float_format */
365 0, /* double_format */
366 0, /* long_double_format */
e2d0e7eb 367 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
ec5cbaec
AC
368 0, /* addr_bits_remove */
369 0, /* smash_text_address */
370 0, /* software_single_step */
371 0, /* print_insn */
372 0, /* skip_trampoline_code */
4c8c40e6 373 generic_skip_solib_resolver, /* skip_solib_resolver */
ec5cbaec
AC
374 0, /* in_solib_call_trampoline */
375 0, /* in_solib_return_trampoline */
ec5cbaec
AC
376 generic_in_function_epilogue_p, /* in_function_epilogue_p */
377 construct_inferior_arguments, /* construct_inferior_arguments */
ec5cbaec
AC
378 0, /* elf_make_msymbol_special */
379 0, /* coff_make_msymbol_special */
380 "malloc", /* name_of_malloc */
381 0, /* cannot_step_breakpoint */
382 0, /* have_nonsteppable_watchpoint */
383 0, /* address_class_type_flags */
384 0, /* address_class_type_flags_to_name */
385 0, /* address_class_name_to_type_flags */
386 default_register_reggroup_p, /* register_reggroup_p */
387 0, /* fetch_pointer_argument */
6ce6d90f 388 0, /* regset_from_core_section */
c0e8c252 389 /* startup_gdbarch() */
0f71a2f6 390};
4b9b3959 391
c0e8c252 392struct gdbarch *current_gdbarch = &startup_gdbarch;
0f71a2f6 393
66b43ecb 394/* Create a new ``struct gdbarch'' based on information provided by
0f71a2f6
JM
395 ``struct gdbarch_info''. */
396
397struct gdbarch *
104c1213
JM
398gdbarch_alloc (const struct gdbarch_info *info,
399 struct gdbarch_tdep *tdep)
0f71a2f6 400{
85de9627
AC
401 /* NOTE: The new architecture variable is named ``current_gdbarch''
402 so that macros such as TARGET_DOUBLE_BIT, when expanded, refer to
403 the current local architecture and not the previous global
404 architecture. This ensures that the new architectures initial
405 values are not influenced by the previous architecture. Once
406 everything is parameterised with gdbarch, this will go away. */
aebd7893
AC
407 struct gdbarch *current_gdbarch;
408
409 /* Create an obstack for allocating all the per-architecture memory,
410 then use that to allocate the architecture vector. */
411 struct obstack *obstack = XMALLOC (struct obstack);
412 obstack_init (obstack);
413 current_gdbarch = obstack_alloc (obstack, sizeof (*current_gdbarch));
85de9627 414 memset (current_gdbarch, 0, sizeof (*current_gdbarch));
aebd7893 415 current_gdbarch->obstack = obstack;
0f71a2f6 416
85de9627 417 alloc_gdbarch_data (current_gdbarch);
b3cc3077 418
85de9627 419 current_gdbarch->tdep = tdep;
0f71a2f6 420
85de9627
AC
421 current_gdbarch->bfd_arch_info = info->bfd_arch_info;
422 current_gdbarch->byte_order = info->byte_order;
4be87837 423 current_gdbarch->osabi = info->osabi;
0f71a2f6
JM
424
425 /* Force the explicit initialization of these. */
85de9627
AC
426 current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
427 current_gdbarch->int_bit = 4*TARGET_CHAR_BIT;
428 current_gdbarch->long_bit = 4*TARGET_CHAR_BIT;
429 current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
430 current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
431 current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
17ef5d92 432 current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
85de9627
AC
433 current_gdbarch->ptr_bit = TARGET_INT_BIT;
434 current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
4e409299 435 current_gdbarch->char_signed = -1;
85de9627 436 current_gdbarch->write_pc = generic_target_write_pc;
85de9627
AC
437 current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
438 current_gdbarch->num_regs = -1;
439 current_gdbarch->sp_regnum = -1;
85de9627 440 current_gdbarch->pc_regnum = -1;
c2169756 441 current_gdbarch->ps_regnum = -1;
85de9627 442 current_gdbarch->fp0_regnum = -1;
85de9627
AC
443 current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
444 current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
445 current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
446 current_gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
447 current_gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
9c04cab7
AC
448 current_gdbarch->deprecated_register_byte = generic_register_byte;
449 current_gdbarch->deprecated_register_raw_size = generic_register_size;
450 current_gdbarch->deprecated_register_virtual_size = generic_register_size;
f3be58bc 451 current_gdbarch->deprecated_fp_regnum = -1;
b99fa2d2 452 current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
b8de8283
AC
453 current_gdbarch->print_registers_info = default_print_registers_info;
454 current_gdbarch->register_sim_regno = legacy_register_sim_regno;
455 current_gdbarch->cannot_fetch_register = cannot_register_not;
456 current_gdbarch->cannot_store_register = cannot_register_not;
a1f4a1b6 457 current_gdbarch->convert_register_p = generic_convert_register_p;
85de9627
AC
458 current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
459 current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
750eb019 460 current_gdbarch->return_value = legacy_return_value;
ebba8386
AC
461 current_gdbarch->extract_return_value = legacy_extract_return_value;
462 current_gdbarch->store_return_value = legacy_store_return_value;
b5622e8d 463 current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
85de9627
AC
464 current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
465 current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
85de9627 466 current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
42efa47a
AC
467 current_gdbarch->deprecated_frame_args_address = get_frame_base;
468 current_gdbarch->deprecated_frame_locals_address = get_frame_base;
192cb3d4 469 current_gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
e2d0e7eb 470 current_gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
85de9627 471 current_gdbarch->addr_bits_remove = core_addr_identity;
181c1381 472 current_gdbarch->smash_text_address = core_addr_identity;
85de9627 473 current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
dea0c52f 474 current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
68e9cc94 475 current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
d50355b6 476 current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
c12260ac 477 current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
552c04a7 478 current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
a2cf933a
EZ
479 current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
480 current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
5720643c 481 current_gdbarch->name_of_malloc = "malloc";
b59ff9d5 482 current_gdbarch->register_reggroup_p = default_register_reggroup_p;
0f71a2f6
JM
483 /* gdbarch_alloc() */
484
85de9627 485 return current_gdbarch;
0f71a2f6
JM
486}
487
488
aebd7893
AC
489/* Allocate extra space using the per-architecture obstack. */
490
491void *
492gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
493{
494 void *data = obstack_alloc (arch->obstack, size);
495 memset (data, 0, size);
496 return data;
497}
498
499
058f20d5
JB
500/* Free a gdbarch struct. This should never happen in normal
501 operation --- once you've created a gdbarch, you keep it around.
502 However, if an architecture's init function encounters an error
503 building the structure, it may need to clean up a partially
504 constructed gdbarch. */
4b9b3959 505
058f20d5
JB
506void
507gdbarch_free (struct gdbarch *arch)
508{
aebd7893 509 struct obstack *obstack;
95160752 510 gdb_assert (arch != NULL);
aebd7893
AC
511 gdb_assert (!arch->initialized_p);
512 obstack = arch->obstack;
513 obstack_free (obstack, 0); /* Includes the ARCH. */
514 xfree (obstack);
058f20d5
JB
515}
516
517
db446970
AC
518/* Ensure that all values in a GDBARCH are reasonable. */
519
520/* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
521 just happens to match the global variable ``current_gdbarch''. That
522 way macros refering to that variable get the local and not the global
523 version - ulgh. Once everything is parameterised with gdbarch, this
524 will go away. */
0f71a2f6 525
0f71a2f6 526static void
db446970 527verify_gdbarch (struct gdbarch *current_gdbarch)
0f71a2f6 528{
f16a1923
AC
529 struct ui_file *log;
530 struct cleanup *cleanups;
531 long dummy;
532 char *buf;
f16a1923
AC
533 log = mem_fileopen ();
534 cleanups = make_cleanup_ui_file_delete (log);
0f71a2f6 535 /* fundamental */
db446970 536 if (current_gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
f16a1923 537 fprintf_unfiltered (log, "\n\tbyte-order");
db446970 538 if (current_gdbarch->bfd_arch_info == NULL)
f16a1923 539 fprintf_unfiltered (log, "\n\tbfd_arch_info");
0f71a2f6 540 /* Check those that need to be defined for the given multi-arch level. */
66b43ecb
AC
541 /* Skip verify of short_bit, invalid_p == 0 */
542 /* Skip verify of int_bit, invalid_p == 0 */
543 /* Skip verify of long_bit, invalid_p == 0 */
544 /* Skip verify of long_long_bit, invalid_p == 0 */
545 /* Skip verify of float_bit, invalid_p == 0 */
546 /* Skip verify of double_bit, invalid_p == 0 */
547 /* Skip verify of long_double_bit, invalid_p == 0 */
548 /* Skip verify of ptr_bit, invalid_p == 0 */
db446970
AC
549 if (current_gdbarch->addr_bit == 0)
550 current_gdbarch->addr_bit = TARGET_PTR_BIT;
c0e8c252 551 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
db446970
AC
552 if (current_gdbarch->char_signed == -1)
553 current_gdbarch->char_signed = 1;
cde9ea48 554 /* Skip verify of read_pc, has predicate */
be8dfb87 555 /* Skip verify of write_pc, invalid_p == 0 */
bd1ce8ba 556 /* Skip verify of read_sp, has predicate */
39d4ef09 557 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
d8124050
AC
558 /* Skip verify of pseudo_register_read, has predicate */
559 /* Skip verify of pseudo_register_write, has predicate */
50248794 560 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
db446970 561 && (current_gdbarch->num_regs == -1))
f16a1923 562 fprintf_unfiltered (log, "\n\tnum_regs");
0aba1244 563 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1200cd6e 564 /* Skip verify of sp_regnum, invalid_p == 0 */
1200cd6e 565 /* Skip verify of pc_regnum, invalid_p == 0 */
c2169756 566 /* Skip verify of ps_regnum, invalid_p == 0 */
60054393 567 /* Skip verify of fp0_regnum, invalid_p == 0 */
88c72b7d
AC
568 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
569 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
570 /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
571 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
572 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
9c04cab7
AC
573 /* Skip verify of register_type, has predicate */
574 /* Skip verify of deprecated_register_virtual_type, has predicate */
575 /* Skip verify of deprecated_register_byte, has predicate */
dadd712e
AC
576 /* Skip verify of deprecated_register_raw_size, has predicate */
577 /* Skip verify of deprecated_register_virtual_size, has predicate */
f3be58bc 578 /* Skip verify of unwind_dummy_id, has predicate */
a59fe496 579 /* Skip verify of deprecated_save_dummy_frame_tos, has predicate */
f3be58bc
AC
580 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
581 /* Skip verify of deprecated_target_read_fp, has predicate */
b8de8283
AC
582 /* Skip verify of push_dummy_call, has predicate */
583 /* Skip verify of deprecated_push_arguments, has predicate */
b8de8283
AC
584 /* Skip verify of deprecated_push_return_address, has predicate */
585 /* Skip verify of deprecated_dummy_write_sp, has predicate */
586 /* Skip verify of call_dummy_location, invalid_p == 0 */
b8de8283 587 /* Skip verify of push_dummy_code, has predicate */
903ad3a6 588 /* Skip verify of deprecated_do_registers_info, has predicate */
0ab7a791 589 /* Skip verify of print_registers_info, invalid_p == 0 */
23e3a7ac 590 /* Skip verify of print_float_info, has predicate */
e76f1f2e 591 /* Skip verify of print_vector_info, has predicate */
7c7651b2 592 /* Skip verify of register_sim_regno, invalid_p == 0 */
2649061d 593 /* Skip verify of register_bytes_ok, has predicate */
01fb7433
AC
594 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
595 /* Skip verify of cannot_store_register, invalid_p == 0 */
9df628e0 596 /* Skip verify of get_longjmp_target, has predicate */
a5afb99f 597 /* Skip verify of deprecated_init_frame_pc, has predicate */
129c1cd6 598 /* Skip verify of deprecated_get_saved_register, has predicate */
13d01224 599 /* Skip verify of convert_register_p, invalid_p == 0 */
4478b372
JB
600 /* Skip verify of pointer_to_address, invalid_p == 0 */
601 /* Skip verify of address_to_pointer, invalid_p == 0 */
fc0c74b1 602 /* Skip verify of integer_to_address, has predicate */
749b82f6 603 /* Skip verify of deprecated_pop_frame, has predicate */
4183d812 604 /* Skip verify of deprecated_store_struct_return, has predicate */
92ad9cd9 605 /* Skip verify of return_value, has predicate */
ebba8386
AC
606 /* Skip verify of extract_return_value, invalid_p == 0 */
607 /* Skip verify of store_return_value, invalid_p == 0 */
b5622e8d 608 /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
74055713 609 /* Skip verify of deprecated_extract_struct_value_address, has predicate */
f30ee0bc 610 /* Skip verify of deprecated_frame_init_saved_regs, has predicate */
e9582e71 611 /* Skip verify of deprecated_init_extra_frame_info, has predicate */
50248794 612 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
db446970 613 && (current_gdbarch->skip_prologue == 0))
f16a1923 614 fprintf_unfiltered (log, "\n\tskip_prologue");
50248794 615 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
db446970 616 && (current_gdbarch->inner_than == 0))
f16a1923 617 fprintf_unfiltered (log, "\n\tinner_than");
aaab4dba 618 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
db446970 619 && (current_gdbarch->breakpoint_from_pc == 0))
aaab4dba 620 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
a1131521 621 /* Skip verify of adjust_breakpoint_address, has predicate */
c0e8c252
AC
622 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
623 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
71bd6bd4 624 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
782263ab 625 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
c0e8c252 626 /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
5867a2fb 627 /* Skip verify of frame_args_skip, invalid_p == 0 */
19772a2c 628 /* Skip verify of deprecated_frameless_function_invocation, has predicate */
618ce49f
AC
629 /* Skip verify of deprecated_frame_chain, has predicate */
630 /* Skip verify of deprecated_frame_chain_valid, has predicate */
8bedc050 631 /* Skip verify of deprecated_frame_saved_pc, has predicate */
12cc2063 632 /* Skip verify of unwind_pc, has predicate */
a9e5fdc2 633 /* Skip verify of unwind_sp, has predicate */
42efa47a
AC
634 /* Skip verify of deprecated_frame_args_address, has predicate */
635 /* Skip verify of deprecated_frame_locals_address, has predicate */
6913c89a 636 /* Skip verify of deprecated_saved_pc_after_call, has predicate */
983a287a 637 /* Skip verify of frame_num_args, has predicate */
f27dd7fd 638 /* Skip verify of deprecated_stack_align, has predicate */
dc604539 639 /* Skip verify of frame_align, has predicate */
88d89dbb 640 /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
192cb3d4 641 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
db446970
AC
642 if (current_gdbarch->float_format == 0)
643 current_gdbarch->float_format = default_float_format (current_gdbarch);
644 if (current_gdbarch->double_format == 0)
645 current_gdbarch->double_format = default_double_format (current_gdbarch);
646 if (current_gdbarch->long_double_format == 0)
647 current_gdbarch->long_double_format = default_double_format (current_gdbarch);
f517ea4e 648 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
875e1767 649 /* Skip verify of addr_bits_remove, invalid_p == 0 */
181c1381 650 /* Skip verify of smash_text_address, invalid_p == 0 */
64c4637f 651 /* Skip verify of software_single_step, has predicate */
f6c40618 652 if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
db446970 653 && (current_gdbarch->print_insn == 0))
f6c40618 654 fprintf_unfiltered (log, "\n\tprint_insn");
bdcd319a 655 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
dea0c52f 656 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
68e9cc94 657 /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
d50355b6 658 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
c12260ac 659 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
552c04a7 660 /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
a2cf933a
EZ
661 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
662 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
5720643c 663 /* Skip verify of name_of_malloc, invalid_p == 0 */
c4ed33b9 664 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
f74fa174 665 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
8b2dbe47
KB
666 /* Skip verify of address_class_type_flags, has predicate */
667 /* Skip verify of address_class_type_flags_to_name, has predicate */
668 /* Skip verify of address_class_name_to_type_flags, has predicate */
7e20f3fb 669 /* Skip verify of register_reggroup_p, invalid_p == 0 */
143985b7 670 /* Skip verify of fetch_pointer_argument, has predicate */
6ce6d90f 671 /* Skip verify of regset_from_core_section, has predicate */
f16a1923
AC
672 buf = ui_file_xstrdup (log, &dummy);
673 make_cleanup (xfree, buf);
674 if (strlen (buf) > 0)
675 internal_error (__FILE__, __LINE__,
676 "verify_gdbarch: the following are invalid ...%s",
677 buf);
678 do_cleanups (cleanups);
0f71a2f6
JM
679}
680
681
682/* Print out the details of the current architecture. */
683
4b9b3959
AC
684/* NOTE/WARNING: The parameter is called ``current_gdbarch'' so that it
685 just happens to match the global variable ``current_gdbarch''. That
686 way macros refering to that variable get the local and not the global
687 version - ulgh. Once everything is parameterised with gdbarch, this
688 will go away. */
689
0f71a2f6 690void
db446970 691gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
0f71a2f6 692{
4b9b3959
AC
693 fprintf_unfiltered (file,
694 "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
695 GDB_MULTI_ARCH);
a2428dbe 696#ifdef TARGET_ADDR_BIT
e2d0e7eb 697 fprintf_unfiltered (file,
a2428dbe
AC
698 "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
699 XSTRING (TARGET_ADDR_BIT));
7996bcec 700 fprintf_unfiltered (file,
a2428dbe
AC
701 "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
702 TARGET_ADDR_BIT);
703#endif
704#ifdef ADDR_BITS_REMOVE
7996bcec 705 fprintf_unfiltered (file,
a2428dbe
AC
706 "gdbarch_dump: %s # %s\n",
707 "ADDR_BITS_REMOVE(addr)",
708 XSTRING (ADDR_BITS_REMOVE (addr)));
7996bcec 709 fprintf_unfiltered (file,
a2428dbe
AC
710 "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
711 (long) current_gdbarch->addr_bits_remove
712 /*ADDR_BITS_REMOVE ()*/);
713#endif
7996bcec
AC
714 fprintf_unfiltered (file,
715 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
716 gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
717 fprintf_unfiltered (file,
718 "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
719 (long) current_gdbarch->address_class_name_to_type_flags);
1e9f55d0
AC
720#ifdef ADDRESS_CLASS_TYPE_FLAGS_P
721 fprintf_unfiltered (file,
722 "gdbarch_dump: %s # %s\n",
723 "ADDRESS_CLASS_TYPE_FLAGS_P()",
724 XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
725 fprintf_unfiltered (file,
726 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n",
727 ADDRESS_CLASS_TYPE_FLAGS_P ());
728#endif
8b2dbe47
KB
729#ifdef ADDRESS_CLASS_TYPE_FLAGS
730 fprintf_unfiltered (file,
731 "gdbarch_dump: %s # %s\n",
732 "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
733 XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
7996bcec
AC
734 fprintf_unfiltered (file,
735 "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
736 (long) current_gdbarch->address_class_type_flags
737 /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
8b2dbe47 738#endif
7996bcec
AC
739 fprintf_unfiltered (file,
740 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
741 gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
742 fprintf_unfiltered (file,
743 "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
744 (long) current_gdbarch->address_class_type_flags_to_name);
08e45a40 745#ifdef ADDRESS_TO_POINTER
4b9b3959 746 fprintf_unfiltered (file,
08e45a40
AC
747 "gdbarch_dump: %s # %s\n",
748 "ADDRESS_TO_POINTER(type, buf, addr)",
749 XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
7996bcec
AC
750 fprintf_unfiltered (file,
751 "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
752 (long) current_gdbarch->address_to_pointer
753 /*ADDRESS_TO_POINTER ()*/);
5e74b15c 754#endif
a1131521
KB
755 fprintf_unfiltered (file,
756 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
757 gdbarch_adjust_breakpoint_address_p (current_gdbarch));
758 fprintf_unfiltered (file,
759 "gdbarch_dump: adjust_breakpoint_address = 0x%08lx\n",
760 (long) current_gdbarch->adjust_breakpoint_address);
08e45a40 761#ifdef BELIEVE_PCC_PROMOTION
4b9b3959 762 fprintf_unfiltered (file,
08e45a40
AC
763 "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
764 XSTRING (BELIEVE_PCC_PROMOTION));
765 fprintf_unfiltered (file,
06b25f14
AC
766 "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
767 BELIEVE_PCC_PROMOTION);
4b9b3959 768#endif
a2428dbe
AC
769#ifdef TARGET_ARCHITECTURE
770 fprintf_unfiltered (file,
771 "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
772 XSTRING (TARGET_ARCHITECTURE));
773 if (TARGET_ARCHITECTURE != NULL)
774 fprintf_unfiltered (file,
775 "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
776 TARGET_ARCHITECTURE->printable_name);
777#endif
778#ifdef TARGET_BFD_VMA_BIT
779 fprintf_unfiltered (file,
780 "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
781 XSTRING (TARGET_BFD_VMA_BIT));
782 fprintf_unfiltered (file,
783 "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
784 TARGET_BFD_VMA_BIT);
785#endif
08e45a40 786#ifdef BREAKPOINT_FROM_PC
4b9b3959 787 fprintf_unfiltered (file,
08e45a40
AC
788 "gdbarch_dump: %s # %s\n",
789 "BREAKPOINT_FROM_PC(pcptr, lenptr)",
790 XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
7996bcec
AC
791 fprintf_unfiltered (file,
792 "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
793 (long) current_gdbarch->breakpoint_from_pc
794 /*BREAKPOINT_FROM_PC ()*/);
4b9b3959 795#endif
a2428dbe
AC
796#ifdef TARGET_BYTE_ORDER
797 fprintf_unfiltered (file,
798 "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
799 XSTRING (TARGET_BYTE_ORDER));
800 fprintf_unfiltered (file,
801 "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
802 (long) TARGET_BYTE_ORDER);
803#endif
08e45a40 804#ifdef CALL_DUMMY_LOCATION
52204a0b 805 fprintf_unfiltered (file,
08e45a40
AC
806 "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
807 XSTRING (CALL_DUMMY_LOCATION));
808 fprintf_unfiltered (file,
06b25f14
AC
809 "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
810 CALL_DUMMY_LOCATION);
52204a0b 811#endif
08e45a40 812#ifdef CANNOT_FETCH_REGISTER
4b9b3959
AC
813 fprintf_unfiltered (file,
814 "gdbarch_dump: %s # %s\n",
08e45a40
AC
815 "CANNOT_FETCH_REGISTER(regnum)",
816 XSTRING (CANNOT_FETCH_REGISTER (regnum)));
7996bcec
AC
817 fprintf_unfiltered (file,
818 "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
819 (long) current_gdbarch->cannot_fetch_register
820 /*CANNOT_FETCH_REGISTER ()*/);
4b9b3959 821#endif
c4ed33b9
AC
822#ifdef CANNOT_STEP_BREAKPOINT
823 fprintf_unfiltered (file,
824 "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
825 XSTRING (CANNOT_STEP_BREAKPOINT));
826 fprintf_unfiltered (file,
827 "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
828 CANNOT_STEP_BREAKPOINT);
829#endif
08e45a40 830#ifdef CANNOT_STORE_REGISTER
4b9b3959
AC
831 fprintf_unfiltered (file,
832 "gdbarch_dump: %s # %s\n",
08e45a40
AC
833 "CANNOT_STORE_REGISTER(regnum)",
834 XSTRING (CANNOT_STORE_REGISTER (regnum)));
7996bcec
AC
835 fprintf_unfiltered (file,
836 "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
837 (long) current_gdbarch->cannot_store_register
838 /*CANNOT_STORE_REGISTER ()*/);
4b9b3959 839#endif
a2428dbe
AC
840#ifdef TARGET_CHAR_SIGNED
841 fprintf_unfiltered (file,
842 "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
843 XSTRING (TARGET_CHAR_SIGNED));
844 fprintf_unfiltered (file,
845 "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
846 TARGET_CHAR_SIGNED);
847#endif
a2cf933a 848#ifdef COFF_MAKE_MSYMBOL_SPECIAL
a2cf933a
EZ
849 fprintf_unfiltered (file,
850 "gdbarch_dump: %s # %s\n",
851 "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
852 XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
7996bcec
AC
853 fprintf_unfiltered (file,
854 "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
855 (long) current_gdbarch->coff_make_msymbol_special
856 /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
a2cf933a 857#endif
7996bcec
AC
858 fprintf_unfiltered (file,
859 "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
860 (long) current_gdbarch->construct_inferior_arguments);
a2428dbe
AC
861 fprintf_unfiltered (file,
862 "gdbarch_dump: convert_from_func_ptr_addr = 0x%08lx\n",
863 (long) current_gdbarch->convert_from_func_ptr_addr);
13d01224
AC
864#ifdef CONVERT_REGISTER_P
865 fprintf_unfiltered (file,
866 "gdbarch_dump: %s # %s\n",
ff2e87ac
AC
867 "CONVERT_REGISTER_P(regnum, type)",
868 XSTRING (CONVERT_REGISTER_P (regnum, type)));
7996bcec
AC
869 fprintf_unfiltered (file,
870 "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
871 (long) current_gdbarch->convert_register_p
872 /*CONVERT_REGISTER_P ()*/);
13d01224 873#endif
08e45a40 874#ifdef DECR_PC_AFTER_BREAK
4b9b3959 875 fprintf_unfiltered (file,
08e45a40
AC
876 "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
877 XSTRING (DECR_PC_AFTER_BREAK));
0aba1244 878 fprintf_unfiltered (file,
08e45a40
AC
879 "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
880 (long) DECR_PC_AFTER_BREAK);
0aba1244 881#endif
1e9f55d0
AC
882#ifdef DEPRECATED_DO_REGISTERS_INFO_P
883 fprintf_unfiltered (file,
884 "gdbarch_dump: %s # %s\n",
885 "DEPRECATED_DO_REGISTERS_INFO_P()",
886 XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
887 fprintf_unfiltered (file,
888 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n",
889 DEPRECATED_DO_REGISTERS_INFO_P ());
890#endif
903ad3a6 891#ifdef DEPRECATED_DO_REGISTERS_INFO
903ad3a6
AC
892 fprintf_unfiltered (file,
893 "gdbarch_dump: %s # %s\n",
894 "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
895 XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
7996bcec
AC
896 fprintf_unfiltered (file,
897 "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
898 (long) current_gdbarch->deprecated_do_registers_info
899 /*DEPRECATED_DO_REGISTERS_INFO ()*/);
903ad3a6 900#endif
6c0e89ed
AC
901#ifdef DEPRECATED_DUMMY_WRITE_SP_P
902 fprintf_unfiltered (file,
903 "gdbarch_dump: %s # %s\n",
904 "DEPRECATED_DUMMY_WRITE_SP_P()",
905 XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ()));
906 fprintf_unfiltered (file,
907 "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n",
908 DEPRECATED_DUMMY_WRITE_SP_P ());
909#endif
910#ifdef DEPRECATED_DUMMY_WRITE_SP
6c0e89ed
AC
911 fprintf_unfiltered (file,
912 "gdbarch_dump: %s # %s\n",
913 "DEPRECATED_DUMMY_WRITE_SP(val)",
914 XSTRING (DEPRECATED_DUMMY_WRITE_SP (val)));
7996bcec
AC
915 fprintf_unfiltered (file,
916 "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
917 (long) current_gdbarch->deprecated_dummy_write_sp
918 /*DEPRECATED_DUMMY_WRITE_SP ()*/);
6c0e89ed 919#endif
26e9b323 920#ifdef DEPRECATED_EXTRACT_RETURN_VALUE
26e9b323
AC
921 fprintf_unfiltered (file,
922 "gdbarch_dump: %s # %s\n",
923 "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
924 XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
7996bcec
AC
925 fprintf_unfiltered (file,
926 "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
927 (long) current_gdbarch->deprecated_extract_return_value
928 /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
26e9b323 929#endif
74055713
AC
930#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
931 fprintf_unfiltered (file,
932 "gdbarch_dump: %s # %s\n",
933 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
934 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
935 fprintf_unfiltered (file,
936 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
937 DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ());
938#endif
939#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
940 fprintf_unfiltered (file,
941 "gdbarch_dump: %s # %s\n",
942 "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
943 XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
944 fprintf_unfiltered (file,
945 "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
946 (long) current_gdbarch->deprecated_extract_struct_value_address
947 /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
948#endif
0ba6dca9
AC
949#ifdef DEPRECATED_FP_REGNUM
950 fprintf_unfiltered (file,
951 "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
952 XSTRING (DEPRECATED_FP_REGNUM));
953 fprintf_unfiltered (file,
954 "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n",
955 DEPRECATED_FP_REGNUM);
956#endif
42efa47a
AC
957#ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P
958 fprintf_unfiltered (file,
959 "gdbarch_dump: %s # %s\n",
960 "DEPRECATED_FRAME_ARGS_ADDRESS_P()",
961 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ()));
962 fprintf_unfiltered (file,
963 "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS_P() = %d\n",
964 DEPRECATED_FRAME_ARGS_ADDRESS_P ());
965#endif
966#ifdef DEPRECATED_FRAME_ARGS_ADDRESS
967 fprintf_unfiltered (file,
968 "gdbarch_dump: %s # %s\n",
969 "DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
970 XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
7996bcec
AC
971 fprintf_unfiltered (file,
972 "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
973 (long) current_gdbarch->deprecated_frame_args_address
974 /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
42efa47a 975#endif
618ce49f
AC
976#ifdef DEPRECATED_FRAME_CHAIN_P
977 fprintf_unfiltered (file,
978 "gdbarch_dump: %s # %s\n",
979 "DEPRECATED_FRAME_CHAIN_P()",
980 XSTRING (DEPRECATED_FRAME_CHAIN_P ()));
981 fprintf_unfiltered (file,
982 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_P() = %d\n",
983 DEPRECATED_FRAME_CHAIN_P ());
984#endif
985#ifdef DEPRECATED_FRAME_CHAIN
986 fprintf_unfiltered (file,
987 "gdbarch_dump: %s # %s\n",
988 "DEPRECATED_FRAME_CHAIN(frame)",
989 XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
7996bcec
AC
990 fprintf_unfiltered (file,
991 "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
992 (long) current_gdbarch->deprecated_frame_chain
993 /*DEPRECATED_FRAME_CHAIN ()*/);
618ce49f
AC
994#endif
995#ifdef DEPRECATED_FRAME_CHAIN_VALID_P
996 fprintf_unfiltered (file,
997 "gdbarch_dump: %s # %s\n",
998 "DEPRECATED_FRAME_CHAIN_VALID_P()",
999 XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ()));
1000 fprintf_unfiltered (file,
1001 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID_P() = %d\n",
1002 DEPRECATED_FRAME_CHAIN_VALID_P ());
1003#endif
1004#ifdef DEPRECATED_FRAME_CHAIN_VALID
1005 fprintf_unfiltered (file,
1006 "gdbarch_dump: %s # %s\n",
1007 "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
1008 XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
7996bcec
AC
1009 fprintf_unfiltered (file,
1010 "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
1011 (long) current_gdbarch->deprecated_frame_chain_valid
1012 /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
618ce49f 1013#endif
f30ee0bc
AC
1014#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
1015 fprintf_unfiltered (file,
1016 "gdbarch_dump: %s # %s\n",
1017 "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
1018 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n",
1021 DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
1022#endif
1023#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
f30ee0bc
AC
1024 fprintf_unfiltered (file,
1025 "gdbarch_dump: %s # %s\n",
1026 "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
1027 XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
7996bcec
AC
1028 fprintf_unfiltered (file,
1029 "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
1030 (long) current_gdbarch->deprecated_frame_init_saved_regs
1031 /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
f30ee0bc 1032#endif
42efa47a
AC
1033#ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
1034 fprintf_unfiltered (file,
1035 "gdbarch_dump: %s # %s\n",
1036 "DEPRECATED_FRAME_LOCALS_ADDRESS_P()",
1037 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()));
1038 fprintf_unfiltered (file,
1039 "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS_P() = %d\n",
1040 DEPRECATED_FRAME_LOCALS_ADDRESS_P ());
1041#endif
1042#ifdef DEPRECATED_FRAME_LOCALS_ADDRESS
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: %s # %s\n",
1045 "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
1046 XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
7996bcec
AC
1047 fprintf_unfiltered (file,
1048 "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
1049 (long) current_gdbarch->deprecated_frame_locals_address
1050 /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
42efa47a 1051#endif
8bedc050
AC
1052#ifdef DEPRECATED_FRAME_SAVED_PC_P
1053 fprintf_unfiltered (file,
1054 "gdbarch_dump: %s # %s\n",
1055 "DEPRECATED_FRAME_SAVED_PC_P()",
1056 XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
1057 fprintf_unfiltered (file,
1058 "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC_P() = %d\n",
1059 DEPRECATED_FRAME_SAVED_PC_P ());
1060#endif
1061#ifdef DEPRECATED_FRAME_SAVED_PC
1062 fprintf_unfiltered (file,
1063 "gdbarch_dump: %s # %s\n",
1064 "DEPRECATED_FRAME_SAVED_PC(fi)",
1065 XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
7996bcec
AC
1066 fprintf_unfiltered (file,
1067 "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
1068 (long) current_gdbarch->deprecated_frame_saved_pc
1069 /*DEPRECATED_FRAME_SAVED_PC ()*/);
8bedc050 1070#endif
a2428dbe
AC
1071#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P
1072 fprintf_unfiltered (file,
1073 "gdbarch_dump: %s # %s\n",
1074 "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P()",
1075 XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()));
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() = %d\n",
1078 DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ());
1079#endif
1080#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
1081 fprintf_unfiltered (file,
1082 "gdbarch_dump: %s # %s\n",
1083 "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi)",
1084 XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
1087 (long) current_gdbarch->deprecated_frameless_function_invocation
1088 /*DEPRECATED_FRAMELESS_FUNCTION_INVOCATION ()*/);
1089#endif
782263ab
AC
1090#ifdef DEPRECATED_FUNCTION_START_OFFSET
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
1093 XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
1094 fprintf_unfiltered (file,
1095 "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET = %ld\n",
1096 (long) DEPRECATED_FUNCTION_START_OFFSET);
1097#endif
129c1cd6
AC
1098#ifdef DEPRECATED_GET_SAVED_REGISTER_P
1099 fprintf_unfiltered (file,
1100 "gdbarch_dump: %s # %s\n",
1101 "DEPRECATED_GET_SAVED_REGISTER_P()",
1102 XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
1105 DEPRECATED_GET_SAVED_REGISTER_P ());
1106#endif
1107#ifdef DEPRECATED_GET_SAVED_REGISTER
129c1cd6
AC
1108 fprintf_unfiltered (file,
1109 "gdbarch_dump: %s # %s\n",
1110 "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1111 XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
7996bcec
AC
1112 fprintf_unfiltered (file,
1113 "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
1114 (long) current_gdbarch->deprecated_get_saved_register
1115 /*DEPRECATED_GET_SAVED_REGISTER ()*/);
129c1cd6 1116#endif
e9582e71
AC
1117#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: %s # %s\n",
1120 "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
1121 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
1122 fprintf_unfiltered (file,
1123 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n",
1124 DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
1125#endif
1126#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
e9582e71
AC
1127 fprintf_unfiltered (file,
1128 "gdbarch_dump: %s # %s\n",
1129 "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1130 XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
7996bcec
AC
1131 fprintf_unfiltered (file,
1132 "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
1133 (long) current_gdbarch->deprecated_init_extra_frame_info
1134 /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
e9582e71 1135#endif
a5afb99f
AC
1136#ifdef DEPRECATED_INIT_FRAME_PC_P
1137 fprintf_unfiltered (file,
1138 "gdbarch_dump: %s # %s\n",
1139 "DEPRECATED_INIT_FRAME_PC_P()",
1140 XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
1141 fprintf_unfiltered (file,
1142 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n",
1143 DEPRECATED_INIT_FRAME_PC_P ());
1144#endif
1145#ifdef DEPRECATED_INIT_FRAME_PC
1146 fprintf_unfiltered (file,
1147 "gdbarch_dump: %s # %s\n",
1148 "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
1149 XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
7996bcec
AC
1150 fprintf_unfiltered (file,
1151 "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
1152 (long) current_gdbarch->deprecated_init_frame_pc
1153 /*DEPRECATED_INIT_FRAME_PC ()*/);
a5afb99f 1154#endif
749b82f6
AC
1155#ifdef DEPRECATED_POP_FRAME_P
1156 fprintf_unfiltered (file,
1157 "gdbarch_dump: %s # %s\n",
1158 "DEPRECATED_POP_FRAME_P()",
1159 XSTRING (DEPRECATED_POP_FRAME_P ()));
1160 fprintf_unfiltered (file,
1161 "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
1162 DEPRECATED_POP_FRAME_P ());
1163#endif
1164#ifdef DEPRECATED_POP_FRAME
749b82f6
AC
1165 fprintf_unfiltered (file,
1166 "gdbarch_dump: %s # %s\n",
1167 "DEPRECATED_POP_FRAME(-)",
1168 XSTRING (DEPRECATED_POP_FRAME (-)));
7996bcec
AC
1169 fprintf_unfiltered (file,
1170 "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
1171 (long) current_gdbarch->deprecated_pop_frame
1172 /*DEPRECATED_POP_FRAME ()*/);
749b82f6 1173#endif
b81774d8
AC
1174#ifdef DEPRECATED_PUSH_ARGUMENTS_P
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: %s # %s\n",
1177 "DEPRECATED_PUSH_ARGUMENTS_P()",
1178 XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
1179 fprintf_unfiltered (file,
1180 "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS_P() = %d\n",
1181 DEPRECATED_PUSH_ARGUMENTS_P ());
1182#endif
1183#ifdef DEPRECATED_PUSH_ARGUMENTS
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: %s # %s\n",
1186 "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1187 XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
7996bcec
AC
1188 fprintf_unfiltered (file,
1189 "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
1190 (long) current_gdbarch->deprecated_push_arguments
1191 /*DEPRECATED_PUSH_ARGUMENTS ()*/);
b81774d8 1192#endif
28f617b3
AC
1193#ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P
1194 fprintf_unfiltered (file,
1195 "gdbarch_dump: %s # %s\n",
1196 "DEPRECATED_PUSH_RETURN_ADDRESS_P()",
1197 XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS_P ()));
1198 fprintf_unfiltered (file,
1199 "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS_P() = %d\n",
1200 DEPRECATED_PUSH_RETURN_ADDRESS_P ());
1201#endif
1202#ifdef DEPRECATED_PUSH_RETURN_ADDRESS
1203 fprintf_unfiltered (file,
1204 "gdbarch_dump: %s # %s\n",
1205 "DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)",
1206 XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp)));
7996bcec
AC
1207 fprintf_unfiltered (file,
1208 "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
1209 (long) current_gdbarch->deprecated_push_return_address
1210 /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
28f617b3 1211#endif
a2428dbe
AC
1212#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
1213 fprintf_unfiltered (file,
1214 "gdbarch_dump: %s # %s\n",
1215 "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
1216 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
1217 fprintf_unfiltered (file,
1218 "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR_P() = %d\n",
1219 DEPRECATED_REG_STRUCT_HAS_ADDR_P ());
1220#endif
1221#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
1222 fprintf_unfiltered (file,
1223 "gdbarch_dump: %s # %s\n",
1224 "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
1225 XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
1226 fprintf_unfiltered (file,
1227 "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
1228 (long) current_gdbarch->deprecated_reg_struct_has_addr
1229 /*DEPRECATED_REG_STRUCT_HAS_ADDR ()*/);
1230#endif
62700349
AC
1231#ifdef DEPRECATED_REGISTER_BYTE_P
1232 fprintf_unfiltered (file,
1233 "gdbarch_dump: %s # %s\n",
1234 "DEPRECATED_REGISTER_BYTE_P()",
1235 XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
1236 fprintf_unfiltered (file,
1237 "gdbarch_dump: DEPRECATED_REGISTER_BYTE_P() = %d\n",
1238 DEPRECATED_REGISTER_BYTE_P ());
1239#endif
1240#ifdef DEPRECATED_REGISTER_BYTE
1241 fprintf_unfiltered (file,
1242 "gdbarch_dump: %s # %s\n",
1243 "DEPRECATED_REGISTER_BYTE(reg_nr)",
1244 XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
1245 fprintf_unfiltered (file,
1246 "gdbarch_dump: DEPRECATED_REGISTER_BYTE = <0x%08lx>\n",
1247 (long) current_gdbarch->deprecated_register_byte
1248 /*DEPRECATED_REGISTER_BYTE ()*/);
1249#endif
b8b527c5
AC
1250#ifdef DEPRECATED_REGISTER_BYTES
1251 fprintf_unfiltered (file,
1252 "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
1253 XSTRING (DEPRECATED_REGISTER_BYTES));
1254 fprintf_unfiltered (file,
1255 "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
1256 DEPRECATED_REGISTER_BYTES);
1257#endif
12c266ea
AC
1258#ifdef DEPRECATED_REGISTER_RAW_SIZE_P
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: %s # %s\n",
1261 "DEPRECATED_REGISTER_RAW_SIZE_P()",
1262 XSTRING (DEPRECATED_REGISTER_RAW_SIZE_P ()));
1263 fprintf_unfiltered (file,
1264 "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE_P() = %d\n",
1265 DEPRECATED_REGISTER_RAW_SIZE_P ());
1266#endif
1267#ifdef DEPRECATED_REGISTER_RAW_SIZE
1268 fprintf_unfiltered (file,
1269 "gdbarch_dump: %s # %s\n",
1270 "DEPRECATED_REGISTER_RAW_SIZE(reg_nr)",
1271 XSTRING (DEPRECATED_REGISTER_RAW_SIZE (reg_nr)));
1272 fprintf_unfiltered (file,
1273 "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE = <0x%08lx>\n",
1274 (long) current_gdbarch->deprecated_register_raw_size
1275 /*DEPRECATED_REGISTER_RAW_SIZE ()*/);
1276#endif
b1e29e33
AC
1277#ifdef DEPRECATED_REGISTER_SIZE
1278 fprintf_unfiltered (file,
1279 "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
1280 XSTRING (DEPRECATED_REGISTER_SIZE));
1281 fprintf_unfiltered (file,
1282 "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
1283 DEPRECATED_REGISTER_SIZE);
1284#endif
f30992d4
AC
1285#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE_P
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: %s # %s\n",
1288 "DEPRECATED_REGISTER_VIRTUAL_SIZE_P()",
1289 XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE_P ()));
1290 fprintf_unfiltered (file,
1291 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE_P() = %d\n",
1292 DEPRECATED_REGISTER_VIRTUAL_SIZE_P ());
1293#endif
1294#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: %s # %s\n",
1297 "DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr)",
1298 XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr)));
1299 fprintf_unfiltered (file,
1300 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
1301 (long) current_gdbarch->deprecated_register_virtual_size
1302 /*DEPRECATED_REGISTER_VIRTUAL_SIZE ()*/);
1303#endif
2e092625
AC
1304#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE_P
1305 fprintf_unfiltered (file,
1306 "gdbarch_dump: %s # %s\n",
1307 "DEPRECATED_REGISTER_VIRTUAL_TYPE_P()",
1308 XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE_P ()));
1309 fprintf_unfiltered (file,
1310 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE_P() = %d\n",
1311 DEPRECATED_REGISTER_VIRTUAL_TYPE_P ());
1312#endif
1313#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE
1314 fprintf_unfiltered (file,
1315 "gdbarch_dump: %s # %s\n",
1316 "DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr)",
1317 XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr)));
1318 fprintf_unfiltered (file,
1319 "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
1320 (long) current_gdbarch->deprecated_register_virtual_type
1321 /*DEPRECATED_REGISTER_VIRTUAL_TYPE ()*/);
1322#endif
a2428dbe 1323#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P
88d89dbb
MK
1324 fprintf_unfiltered (file,
1325 "gdbarch_dump: %s # %s\n",
a2428dbe
AC
1326 "DEPRECATED_SAVE_DUMMY_FRAME_TOS_P()",
1327 XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()));
88d89dbb 1328 fprintf_unfiltered (file,
a2428dbe
AC
1329 "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() = %d\n",
1330 DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ());
88d89dbb 1331#endif
a2428dbe 1332#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS
88d89dbb
MK
1333 fprintf_unfiltered (file,
1334 "gdbarch_dump: %s # %s\n",
a2428dbe
AC
1335 "DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)",
1336 XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp)));
88d89dbb 1337 fprintf_unfiltered (file,
a2428dbe
AC
1338 "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
1339 (long) current_gdbarch->deprecated_save_dummy_frame_tos
1340 /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
88d89dbb 1341#endif
6913c89a
AC
1342#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
1343 fprintf_unfiltered (file,
1344 "gdbarch_dump: %s # %s\n",
1345 "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
1346 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
1347 fprintf_unfiltered (file,
1348 "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL_P() = %d\n",
1349 DEPRECATED_SAVED_PC_AFTER_CALL_P ());
1350#endif
1351#ifdef DEPRECATED_SAVED_PC_AFTER_CALL
1352 fprintf_unfiltered (file,
1353 "gdbarch_dump: %s # %s\n",
1354 "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
1355 XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
7996bcec
AC
1356 fprintf_unfiltered (file,
1357 "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
1358 (long) current_gdbarch->deprecated_saved_pc_after_call
1359 /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
6913c89a 1360#endif
f27dd7fd
AC
1361#ifdef DEPRECATED_STACK_ALIGN_P
1362 fprintf_unfiltered (file,
1363 "gdbarch_dump: %s # %s\n",
1364 "DEPRECATED_STACK_ALIGN_P()",
1365 XSTRING (DEPRECATED_STACK_ALIGN_P ()));
1366 fprintf_unfiltered (file,
1367 "gdbarch_dump: DEPRECATED_STACK_ALIGN_P() = %d\n",
1368 DEPRECATED_STACK_ALIGN_P ());
1369#endif
1370#ifdef DEPRECATED_STACK_ALIGN
1371 fprintf_unfiltered (file,
1372 "gdbarch_dump: %s # %s\n",
1373 "DEPRECATED_STACK_ALIGN(sp)",
1374 XSTRING (DEPRECATED_STACK_ALIGN (sp)));
1375 fprintf_unfiltered (file,
1376 "gdbarch_dump: DEPRECATED_STACK_ALIGN = <0x%08lx>\n",
1377 (long) current_gdbarch->deprecated_stack_align
1378 /*DEPRECATED_STACK_ALIGN ()*/);
1379#endif
ebba8386 1380#ifdef DEPRECATED_STORE_RETURN_VALUE
ebba8386
AC
1381 fprintf_unfiltered (file,
1382 "gdbarch_dump: %s # %s\n",
1383 "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1384 XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
7996bcec
AC
1385 fprintf_unfiltered (file,
1386 "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
1387 (long) current_gdbarch->deprecated_store_return_value
1388 /*DEPRECATED_STORE_RETURN_VALUE ()*/);
ebba8386 1389#endif
4183d812
AC
1390#ifdef DEPRECATED_STORE_STRUCT_RETURN_P
1391 fprintf_unfiltered (file,
1392 "gdbarch_dump: %s # %s\n",
1393 "DEPRECATED_STORE_STRUCT_RETURN_P()",
1394 XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
1395 fprintf_unfiltered (file,
1396 "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN_P() = %d\n",
1397 DEPRECATED_STORE_STRUCT_RETURN_P ());
1398#endif
1399#ifdef DEPRECATED_STORE_STRUCT_RETURN
4183d812
AC
1400 fprintf_unfiltered (file,
1401 "gdbarch_dump: %s # %s\n",
1402 "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
1403 XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
7996bcec
AC
1404 fprintf_unfiltered (file,
1405 "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
1406 (long) current_gdbarch->deprecated_store_struct_return
1407 /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
4183d812 1408#endif
0ba6dca9
AC
1409#ifdef DEPRECATED_TARGET_READ_FP_P
1410 fprintf_unfiltered (file,
1411 "gdbarch_dump: %s # %s\n",
1412 "DEPRECATED_TARGET_READ_FP_P()",
1413 XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
1414 fprintf_unfiltered (file,
1415 "gdbarch_dump: DEPRECATED_TARGET_READ_FP_P() = %d\n",
1416 DEPRECATED_TARGET_READ_FP_P ());
1417#endif
1418#ifdef DEPRECATED_TARGET_READ_FP
1419 fprintf_unfiltered (file,
1420 "gdbarch_dump: %s # %s\n",
1421 "DEPRECATED_TARGET_READ_FP()",
1422 XSTRING (DEPRECATED_TARGET_READ_FP ()));
7996bcec
AC
1423 fprintf_unfiltered (file,
1424 "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
1425 (long) current_gdbarch->deprecated_target_read_fp
1426 /*DEPRECATED_TARGET_READ_FP ()*/);
0ba6dca9 1427#endif
b5622e8d
AC
1428#ifdef DEPRECATED_USE_STRUCT_CONVENTION
1429 fprintf_unfiltered (file,
1430 "gdbarch_dump: %s # %s\n",
1431 "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1432 XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1433 fprintf_unfiltered (file,
1434 "gdbarch_dump: DEPRECATED_USE_STRUCT_CONVENTION = <0x%08lx>\n",
1435 (long) current_gdbarch->deprecated_use_struct_convention
1436 /*DEPRECATED_USE_STRUCT_CONVENTION ()*/);
1437#endif
a2428dbe
AC
1438#ifdef TARGET_DOUBLE_BIT
1439 fprintf_unfiltered (file,
1440 "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1441 XSTRING (TARGET_DOUBLE_BIT));
1442 fprintf_unfiltered (file,
1443 "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
1444 TARGET_DOUBLE_BIT);
1445#endif
1446#ifdef TARGET_DOUBLE_FORMAT
1447 fprintf_unfiltered (file,
1448 "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1449 XSTRING (TARGET_DOUBLE_FORMAT));
1450 fprintf_unfiltered (file,
1451 "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n",
1452 (TARGET_DOUBLE_FORMAT)->name);
1453#endif
08e45a40 1454#ifdef DWARF2_REG_TO_REGNUM
4b9b3959 1455 fprintf_unfiltered (file,
08e45a40
AC
1456 "gdbarch_dump: %s # %s\n",
1457 "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1458 XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
7996bcec
AC
1459 fprintf_unfiltered (file,
1460 "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
1461 (long) current_gdbarch->dwarf2_reg_to_regnum
1462 /*DWARF2_REG_TO_REGNUM ()*/);
4b9b3959 1463#endif
08e45a40 1464#ifdef DWARF_REG_TO_REGNUM
88c72b7d
AC
1465 fprintf_unfiltered (file,
1466 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1467 "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1468 XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
7996bcec
AC
1469 fprintf_unfiltered (file,
1470 "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
1471 (long) current_gdbarch->dwarf_reg_to_regnum
1472 /*DWARF_REG_TO_REGNUM ()*/);
88c72b7d
AC
1473#endif
1474#ifdef ECOFF_REG_TO_REGNUM
1475 fprintf_unfiltered (file,
1476 "gdbarch_dump: %s # %s\n",
1477 "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1478 XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
7996bcec
AC
1479 fprintf_unfiltered (file,
1480 "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
1481 (long) current_gdbarch->ecoff_reg_to_regnum
1482 /*ECOFF_REG_TO_REGNUM ()*/);
88c72b7d 1483#endif
a2cf933a 1484#ifdef ELF_MAKE_MSYMBOL_SPECIAL
a2cf933a
EZ
1485 fprintf_unfiltered (file,
1486 "gdbarch_dump: %s # %s\n",
1487 "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1488 XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
7996bcec
AC
1489 fprintf_unfiltered (file,
1490 "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
1491 (long) current_gdbarch->elf_make_msymbol_special
1492 /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
a2cf933a 1493#endif
049ee0e4 1494#ifdef EXTRACT_RETURN_VALUE
049ee0e4
AC
1495 fprintf_unfiltered (file,
1496 "gdbarch_dump: %s # %s\n",
1497 "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1498 XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
7996bcec
AC
1499 fprintf_unfiltered (file,
1500 "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
1501 (long) current_gdbarch->extract_return_value
1502 /*EXTRACT_RETURN_VALUE ()*/);
049ee0e4 1503#endif
143985b7
AF
1504#ifdef FETCH_POINTER_ARGUMENT_P
1505 fprintf_unfiltered (file,
1506 "gdbarch_dump: %s # %s\n",
1507 "FETCH_POINTER_ARGUMENT_P()",
1508 XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1509 fprintf_unfiltered (file,
1510 "gdbarch_dump: FETCH_POINTER_ARGUMENT_P() = %d\n",
1511 FETCH_POINTER_ARGUMENT_P ());
1512#endif
1513#ifdef FETCH_POINTER_ARGUMENT
1514 fprintf_unfiltered (file,
1515 "gdbarch_dump: %s # %s\n",
1516 "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1517 XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
7996bcec
AC
1518 fprintf_unfiltered (file,
1519 "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
1520 (long) current_gdbarch->fetch_pointer_argument
1521 /*FETCH_POINTER_ARGUMENT ()*/);
143985b7 1522#endif
a2428dbe
AC
1523#ifdef TARGET_FLOAT_BIT
1524 fprintf_unfiltered (file,
1525 "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1526 XSTRING (TARGET_FLOAT_BIT));
1527 fprintf_unfiltered (file,
1528 "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
1529 TARGET_FLOAT_BIT);
1530#endif
1531#ifdef TARGET_FLOAT_FORMAT
1532 fprintf_unfiltered (file,
1533 "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1534 XSTRING (TARGET_FLOAT_FORMAT));
1535 fprintf_unfiltered (file,
1536 "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n",
1537 (TARGET_FLOAT_FORMAT)->name);
1538#endif
08e45a40 1539#ifdef FP0_REGNUM
4b9b3959 1540 fprintf_unfiltered (file,
08e45a40
AC
1541 "gdbarch_dump: FP0_REGNUM # %s\n",
1542 XSTRING (FP0_REGNUM));
1543 fprintf_unfiltered (file,
06b25f14
AC
1544 "gdbarch_dump: FP0_REGNUM = %d\n",
1545 FP0_REGNUM);
4b9b3959 1546#endif
a2428dbe
AC
1547 fprintf_unfiltered (file,
1548 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1549 gdbarch_frame_align_p (current_gdbarch));
1550 fprintf_unfiltered (file,
1551 "gdbarch_dump: frame_align = 0x%08lx\n",
1552 (long) current_gdbarch->frame_align);
08e45a40 1553#ifdef FRAME_ARGS_SKIP
4b9b3959 1554 fprintf_unfiltered (file,
08e45a40
AC
1555 "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1556 XSTRING (FRAME_ARGS_SKIP));
4b9b3959 1557 fprintf_unfiltered (file,
08e45a40
AC
1558 "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1559 (long) FRAME_ARGS_SKIP);
4b9b3959 1560#endif
983a287a
AC
1561#ifdef FRAME_NUM_ARGS_P
1562 fprintf_unfiltered (file,
1563 "gdbarch_dump: %s # %s\n",
1564 "FRAME_NUM_ARGS_P()",
1565 XSTRING (FRAME_NUM_ARGS_P ()));
1566 fprintf_unfiltered (file,
1567 "gdbarch_dump: FRAME_NUM_ARGS_P() = %d\n",
1568 FRAME_NUM_ARGS_P ());
1569#endif
08e45a40 1570#ifdef FRAME_NUM_ARGS
01fb7433
AC
1571 fprintf_unfiltered (file,
1572 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1573 "FRAME_NUM_ARGS(frame)",
1574 XSTRING (FRAME_NUM_ARGS (frame)));
7996bcec
AC
1575 fprintf_unfiltered (file,
1576 "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
1577 (long) current_gdbarch->frame_num_args
1578 /*FRAME_NUM_ARGS ()*/);
01fb7433 1579#endif
8b148df9
AC
1580#ifdef FRAME_RED_ZONE_SIZE
1581 fprintf_unfiltered (file,
1582 "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1583 XSTRING (FRAME_RED_ZONE_SIZE));
1584 fprintf_unfiltered (file,
1585 "gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
1586 FRAME_RED_ZONE_SIZE);
1587#endif
1e9f55d0
AC
1588#ifdef GET_LONGJMP_TARGET_P
1589 fprintf_unfiltered (file,
1590 "gdbarch_dump: %s # %s\n",
1591 "GET_LONGJMP_TARGET_P()",
1592 XSTRING (GET_LONGJMP_TARGET_P ()));
1593 fprintf_unfiltered (file,
1594 "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n",
1595 GET_LONGJMP_TARGET_P ());
1596#endif
9df628e0
RE
1597#ifdef GET_LONGJMP_TARGET
1598 fprintf_unfiltered (file,
1599 "gdbarch_dump: %s # %s\n",
1600 "GET_LONGJMP_TARGET(pc)",
1601 XSTRING (GET_LONGJMP_TARGET (pc)));
7996bcec
AC
1602 fprintf_unfiltered (file,
1603 "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
1604 (long) current_gdbarch->get_longjmp_target
1605 /*GET_LONGJMP_TARGET ()*/);
9df628e0 1606#endif
967c0d83 1607#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
f74fa174 1608 fprintf_unfiltered (file,
967c0d83
MM
1609 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1610 XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
f74fa174 1611 fprintf_unfiltered (file,
967c0d83
MM
1612 "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
1613 HAVE_NONSTEPPABLE_WATCHPOINT);
f74fa174 1614#endif
a2428dbe
AC
1615 fprintf_unfiltered (file,
1616 "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
1617 (long) current_gdbarch->in_function_epilogue_p);
1618#ifdef IN_SOLIB_CALL_TRAMPOLINE
10312cc4
AC
1619 fprintf_unfiltered (file,
1620 "gdbarch_dump: %s # %s\n",
a2428dbe
AC
1621 "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1622 XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
7996bcec 1623 fprintf_unfiltered (file,
a2428dbe
AC
1624 "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
1625 (long) current_gdbarch->in_solib_call_trampoline
1626 /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
10312cc4 1627#endif
a2428dbe 1628#ifdef IN_SOLIB_RETURN_TRAMPOLINE
1e9f55d0
AC
1629 fprintf_unfiltered (file,
1630 "gdbarch_dump: %s # %s\n",
a2428dbe
AC
1631 "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1632 XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1e9f55d0 1633 fprintf_unfiltered (file,
a2428dbe
AC
1634 "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
1635 (long) current_gdbarch->in_solib_return_trampoline
1636 /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
1637#endif
1638#ifdef INNER_THAN
1639 fprintf_unfiltered (file,
1640 "gdbarch_dump: %s # %s\n",
1641 "INNER_THAN(lhs, rhs)",
1642 XSTRING (INNER_THAN (lhs, rhs)));
1643 fprintf_unfiltered (file,
1644 "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
1645 (long) current_gdbarch->inner_than
1646 /*INNER_THAN ()*/);
1647#endif
1648#ifdef TARGET_INT_BIT
1649 fprintf_unfiltered (file,
1650 "gdbarch_dump: TARGET_INT_BIT # %s\n",
1651 XSTRING (TARGET_INT_BIT));
1652 fprintf_unfiltered (file,
1653 "gdbarch_dump: TARGET_INT_BIT = %d\n",
1654 TARGET_INT_BIT);
1655#endif
1656#ifdef INTEGER_TO_ADDRESS_P
1657 fprintf_unfiltered (file,
1658 "gdbarch_dump: %s # %s\n",
1659 "INTEGER_TO_ADDRESS_P()",
1660 XSTRING (INTEGER_TO_ADDRESS_P ()));
1661 fprintf_unfiltered (file,
1662 "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n",
1e9f55d0
AC
1663 INTEGER_TO_ADDRESS_P ());
1664#endif
fc0c74b1
AC
1665#ifdef INTEGER_TO_ADDRESS
1666 fprintf_unfiltered (file,
1667 "gdbarch_dump: %s # %s\n",
1668 "INTEGER_TO_ADDRESS(type, buf)",
1669 XSTRING (INTEGER_TO_ADDRESS (type, buf)));
7996bcec
AC
1670 fprintf_unfiltered (file,
1671 "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
1672 (long) current_gdbarch->integer_to_address
1673 /*INTEGER_TO_ADDRESS ()*/);
fc0c74b1 1674#endif
a2428dbe 1675#ifdef TARGET_LONG_BIT
5e74b15c 1676 fprintf_unfiltered (file,
a2428dbe
AC
1677 "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1678 XSTRING (TARGET_LONG_BIT));
7996bcec 1679 fprintf_unfiltered (file,
a2428dbe
AC
1680 "gdbarch_dump: TARGET_LONG_BIT = %d\n",
1681 TARGET_LONG_BIT);
5e74b15c 1682#endif
a2428dbe 1683#ifdef TARGET_LONG_DOUBLE_BIT
d50355b6 1684 fprintf_unfiltered (file,
a2428dbe
AC
1685 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1686 XSTRING (TARGET_LONG_DOUBLE_BIT));
7996bcec 1687 fprintf_unfiltered (file,
a2428dbe
AC
1688 "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
1689 TARGET_LONG_DOUBLE_BIT);
1690#endif
1691#ifdef TARGET_LONG_DOUBLE_FORMAT
1692 fprintf_unfiltered (file,
1693 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1694 XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1695 fprintf_unfiltered (file,
1696 "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n",
1697 (TARGET_LONG_DOUBLE_FORMAT)->name);
1698#endif
1699#ifdef TARGET_LONG_LONG_BIT
1700 fprintf_unfiltered (file,
1701 "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1702 XSTRING (TARGET_LONG_LONG_BIT));
1703 fprintf_unfiltered (file,
1704 "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
1705 TARGET_LONG_LONG_BIT);
d50355b6 1706#endif
08e45a40 1707#ifdef MEMORY_INSERT_BREAKPOINT
4b9b3959
AC
1708 fprintf_unfiltered (file,
1709 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1710 "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1711 XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
7996bcec
AC
1712 fprintf_unfiltered (file,
1713 "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
1714 (long) current_gdbarch->memory_insert_breakpoint
1715 /*MEMORY_INSERT_BREAKPOINT ()*/);
4b9b3959 1716#endif
08e45a40 1717#ifdef MEMORY_REMOVE_BREAKPOINT
4b9b3959
AC
1718 fprintf_unfiltered (file,
1719 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1720 "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1721 XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
7996bcec
AC
1722 fprintf_unfiltered (file,
1723 "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
1724 (long) current_gdbarch->memory_remove_breakpoint
1725 /*MEMORY_REMOVE_BREAKPOINT ()*/);
4b9b3959 1726#endif
5720643c
JB
1727#ifdef NAME_OF_MALLOC
1728 fprintf_unfiltered (file,
1729 "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1730 XSTRING (NAME_OF_MALLOC));
1731 fprintf_unfiltered (file,
31deffe5
AC
1732 "gdbarch_dump: NAME_OF_MALLOC = %s\n",
1733 NAME_OF_MALLOC);
5720643c 1734#endif
08e45a40 1735#ifdef NUM_PSEUDO_REGS
4b9b3959 1736 fprintf_unfiltered (file,
08e45a40
AC
1737 "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1738 XSTRING (NUM_PSEUDO_REGS));
1739 fprintf_unfiltered (file,
06b25f14
AC
1740 "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1741 NUM_PSEUDO_REGS);
4b9b3959 1742#endif
08e45a40 1743#ifdef NUM_REGS
7f1b2585 1744 fprintf_unfiltered (file,
08e45a40
AC
1745 "gdbarch_dump: NUM_REGS # %s\n",
1746 XSTRING (NUM_REGS));
1747 fprintf_unfiltered (file,
06b25f14
AC
1748 "gdbarch_dump: NUM_REGS = %d\n",
1749 NUM_REGS);
7f1b2585 1750#endif
a2428dbe
AC
1751#ifdef TARGET_OSABI
1752 fprintf_unfiltered (file,
1753 "gdbarch_dump: TARGET_OSABI # %s\n",
1754 XSTRING (TARGET_OSABI));
1755 fprintf_unfiltered (file,
1756 "gdbarch_dump: TARGET_OSABI = %ld\n",
1757 (long) TARGET_OSABI);
1758#endif
08e45a40
AC
1759#ifdef PC_REGNUM
1760 fprintf_unfiltered (file,
1761 "gdbarch_dump: PC_REGNUM # %s\n",
1762 XSTRING (PC_REGNUM));
1763 fprintf_unfiltered (file,
06b25f14
AC
1764 "gdbarch_dump: PC_REGNUM = %d\n",
1765 PC_REGNUM);
7f1b2585 1766#endif
4b9b3959
AC
1767#ifdef POINTER_TO_ADDRESS
1768 fprintf_unfiltered (file,
1769 "gdbarch_dump: %s # %s\n",
1770 "POINTER_TO_ADDRESS(type, buf)",
1771 XSTRING (POINTER_TO_ADDRESS (type, buf)));
7996bcec
AC
1772 fprintf_unfiltered (file,
1773 "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
1774 (long) current_gdbarch->pointer_to_address
1775 /*POINTER_TO_ADDRESS ()*/);
5e74b15c 1776#endif
7996bcec
AC
1777 fprintf_unfiltered (file,
1778 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1779 gdbarch_print_float_info_p (current_gdbarch));
1780 fprintf_unfiltered (file,
1781 "gdbarch_dump: print_float_info = 0x%08lx\n",
1782 (long) current_gdbarch->print_float_info);
a2428dbe
AC
1783#ifdef TARGET_PRINT_INSN
1784 fprintf_unfiltered (file,
1785 "gdbarch_dump: %s # %s\n",
1786 "TARGET_PRINT_INSN(vma, info)",
1787 XSTRING (TARGET_PRINT_INSN (vma, info)));
1788 fprintf_unfiltered (file,
1789 "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
1790 (long) current_gdbarch->print_insn
1791 /*TARGET_PRINT_INSN ()*/);
1792#endif
7996bcec
AC
1793 fprintf_unfiltered (file,
1794 "gdbarch_dump: print_registers_info = 0x%08lx\n",
1795 (long) current_gdbarch->print_registers_info);
1796 fprintf_unfiltered (file,
1797 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1798 gdbarch_print_vector_info_p (current_gdbarch));
1799 fprintf_unfiltered (file,
1800 "gdbarch_dump: print_vector_info = 0x%08lx\n",
1801 (long) current_gdbarch->print_vector_info);
c2169756
AC
1802#ifdef PS_REGNUM
1803 fprintf_unfiltered (file,
1804 "gdbarch_dump: PS_REGNUM # %s\n",
1805 XSTRING (PS_REGNUM));
1806 fprintf_unfiltered (file,
1807 "gdbarch_dump: PS_REGNUM = %d\n",
1808 PS_REGNUM);
a2428dbe
AC
1809#endif
1810 fprintf_unfiltered (file,
1811 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1812 gdbarch_pseudo_register_read_p (current_gdbarch));
1813 fprintf_unfiltered (file,
1814 "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
1815 (long) current_gdbarch->pseudo_register_read);
1816 fprintf_unfiltered (file,
1817 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1818 gdbarch_pseudo_register_write_p (current_gdbarch));
1819 fprintf_unfiltered (file,
1820 "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
1821 (long) current_gdbarch->pseudo_register_write);
1822#ifdef TARGET_PTR_BIT
1823 fprintf_unfiltered (file,
1824 "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1825 XSTRING (TARGET_PTR_BIT));
1826 fprintf_unfiltered (file,
1827 "gdbarch_dump: TARGET_PTR_BIT = %d\n",
1828 TARGET_PTR_BIT);
c2169756 1829#endif
7996bcec
AC
1830 fprintf_unfiltered (file,
1831 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1832 gdbarch_push_dummy_call_p (current_gdbarch));
1833 fprintf_unfiltered (file,
1834 "gdbarch_dump: push_dummy_call = 0x%08lx\n",
1835 (long) current_gdbarch->push_dummy_call);
1836 fprintf_unfiltered (file,
1837 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1838 gdbarch_push_dummy_code_p (current_gdbarch));
1839 fprintf_unfiltered (file,
1840 "gdbarch_dump: push_dummy_code = 0x%08lx\n",
1841 (long) current_gdbarch->push_dummy_code);
a2428dbe
AC
1842#ifdef TARGET_READ_PC_P
1843 fprintf_unfiltered (file,
1844 "gdbarch_dump: %s # %s\n",
1845 "TARGET_READ_PC_P()",
1846 XSTRING (TARGET_READ_PC_P ()));
1847 fprintf_unfiltered (file,
1848 "gdbarch_dump: TARGET_READ_PC_P() = %d\n",
1849 TARGET_READ_PC_P ());
1850#endif
1851#ifdef TARGET_READ_PC
1852 fprintf_unfiltered (file,
1853 "gdbarch_dump: %s # %s\n",
1854 "TARGET_READ_PC(ptid)",
1855 XSTRING (TARGET_READ_PC (ptid)));
1856 fprintf_unfiltered (file,
1857 "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
1858 (long) current_gdbarch->read_pc
1859 /*TARGET_READ_PC ()*/);
1860#endif
1861#ifdef TARGET_READ_SP_P
1862 fprintf_unfiltered (file,
1863 "gdbarch_dump: %s # %s\n",
1864 "TARGET_READ_SP_P()",
1865 XSTRING (TARGET_READ_SP_P ()));
1866 fprintf_unfiltered (file,
1867 "gdbarch_dump: TARGET_READ_SP_P() = %d\n",
1868 TARGET_READ_SP_P ());
1869#endif
1870#ifdef TARGET_READ_SP
1871 fprintf_unfiltered (file,
1872 "gdbarch_dump: %s # %s\n",
1873 "TARGET_READ_SP()",
1874 XSTRING (TARGET_READ_SP ()));
1875 fprintf_unfiltered (file,
1876 "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
1877 (long) current_gdbarch->read_sp
1878 /*TARGET_READ_SP ()*/);
1879#endif
1e9f55d0
AC
1880#ifdef REGISTER_BYTES_OK_P
1881 fprintf_unfiltered (file,
1882 "gdbarch_dump: %s # %s\n",
1883 "REGISTER_BYTES_OK_P()",
1884 XSTRING (REGISTER_BYTES_OK_P ()));
1885 fprintf_unfiltered (file,
1886 "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n",
1887 REGISTER_BYTES_OK_P ());
1888#endif
08e45a40 1889#ifdef REGISTER_BYTES_OK
4b9b3959
AC
1890 fprintf_unfiltered (file,
1891 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1892 "REGISTER_BYTES_OK(nr_bytes)",
1893 XSTRING (REGISTER_BYTES_OK (nr_bytes)));
7996bcec
AC
1894 fprintf_unfiltered (file,
1895 "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
1896 (long) current_gdbarch->register_bytes_ok
1897 /*REGISTER_BYTES_OK ()*/);
4b9b3959 1898#endif
08e45a40 1899#ifdef REGISTER_NAME
4b9b3959
AC
1900 fprintf_unfiltered (file,
1901 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1902 "REGISTER_NAME(regnr)",
1903 XSTRING (REGISTER_NAME (regnr)));
7996bcec
AC
1904 fprintf_unfiltered (file,
1905 "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
1906 (long) current_gdbarch->register_name
1907 /*REGISTER_NAME ()*/);
4b9b3959 1908#endif
a2428dbe
AC
1909 fprintf_unfiltered (file,
1910 "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
1911 (long) current_gdbarch->register_reggroup_p);
08e45a40 1912#ifdef REGISTER_SIM_REGNO
4b9b3959
AC
1913 fprintf_unfiltered (file,
1914 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1915 "REGISTER_SIM_REGNO(reg_nr)",
1916 XSTRING (REGISTER_SIM_REGNO (reg_nr)));
7996bcec
AC
1917 fprintf_unfiltered (file,
1918 "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
1919 (long) current_gdbarch->register_sim_regno
1920 /*REGISTER_SIM_REGNO ()*/);
4b9b3959 1921#endif
13d01224 1922#ifdef REGISTER_TO_VALUE
13d01224
AC
1923 fprintf_unfiltered (file,
1924 "gdbarch_dump: %s # %s\n",
ff2e87ac
AC
1925 "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1926 XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
7996bcec
AC
1927 fprintf_unfiltered (file,
1928 "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
1929 (long) current_gdbarch->register_to_value
1930 /*REGISTER_TO_VALUE ()*/);
13d01224 1931#endif
7996bcec
AC
1932 fprintf_unfiltered (file,
1933 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1934 gdbarch_register_type_p (current_gdbarch));
1935 fprintf_unfiltered (file,
1936 "gdbarch_dump: register_type = 0x%08lx\n",
1937 (long) current_gdbarch->register_type);
a2428dbe
AC
1938 fprintf_unfiltered (file,
1939 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1940 gdbarch_regset_from_core_section_p (current_gdbarch));
1941 fprintf_unfiltered (file,
1942 "gdbarch_dump: regset_from_core_section = 0x%08lx\n",
1943 (long) current_gdbarch->regset_from_core_section);
7996bcec
AC
1944 fprintf_unfiltered (file,
1945 "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
1946 (long) current_gdbarch->remote_translate_xfer_address);
a2428dbe
AC
1947 fprintf_unfiltered (file,
1948 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1949 gdbarch_return_value_p (current_gdbarch));
1950 fprintf_unfiltered (file,
1951 "gdbarch_dump: return_value = 0x%08lx\n",
1952 (long) current_gdbarch->return_value);
08e45a40 1953#ifdef SDB_REG_TO_REGNUM
4b9b3959
AC
1954 fprintf_unfiltered (file,
1955 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1956 "SDB_REG_TO_REGNUM(sdb_regnr)",
1957 XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
7996bcec
AC
1958 fprintf_unfiltered (file,
1959 "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
1960 (long) current_gdbarch->sdb_reg_to_regnum
1961 /*SDB_REG_TO_REGNUM ()*/);
4b9b3959 1962#endif
a2428dbe
AC
1963#ifdef TARGET_SHORT_BIT
1964 fprintf_unfiltered (file,
1965 "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1966 XSTRING (TARGET_SHORT_BIT));
1967 fprintf_unfiltered (file,
1968 "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
1969 TARGET_SHORT_BIT);
1970#endif
08e45a40 1971#ifdef SKIP_PROLOGUE
4b9b3959
AC
1972 fprintf_unfiltered (file,
1973 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1974 "SKIP_PROLOGUE(ip)",
1975 XSTRING (SKIP_PROLOGUE (ip)));
7996bcec
AC
1976 fprintf_unfiltered (file,
1977 "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
1978 (long) current_gdbarch->skip_prologue
1979 /*SKIP_PROLOGUE ()*/);
4b9b3959 1980#endif
dea0c52f 1981 fprintf_unfiltered (file,
4c8c40e6
MK
1982 "gdbarch_dump: skip_solib_resolver = 0x%08lx\n",
1983 (long) current_gdbarch->skip_solib_resolver);
08e45a40 1984#ifdef SKIP_TRAMPOLINE_CODE
4b9b3959
AC
1985 fprintf_unfiltered (file,
1986 "gdbarch_dump: %s # %s\n",
08e45a40
AC
1987 "SKIP_TRAMPOLINE_CODE(pc)",
1988 XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
7996bcec
AC
1989 fprintf_unfiltered (file,
1990 "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
1991 (long) current_gdbarch->skip_trampoline_code
1992 /*SKIP_TRAMPOLINE_CODE ()*/);
4b9b3959 1993#endif
181c1381
RE
1994#ifdef SMASH_TEXT_ADDRESS
1995 fprintf_unfiltered (file,
1996 "gdbarch_dump: %s # %s\n",
1997 "SMASH_TEXT_ADDRESS(addr)",
1998 XSTRING (SMASH_TEXT_ADDRESS (addr)));
7996bcec
AC
1999 fprintf_unfiltered (file,
2000 "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
2001 (long) current_gdbarch->smash_text_address
2002 /*SMASH_TEXT_ADDRESS ()*/);
181c1381 2003#endif
1e9f55d0
AC
2004#ifdef SOFTWARE_SINGLE_STEP_P
2005 fprintf_unfiltered (file,
2006 "gdbarch_dump: %s # %s\n",
2007 "SOFTWARE_SINGLE_STEP_P()",
2008 XSTRING (SOFTWARE_SINGLE_STEP_P ()));
2009 fprintf_unfiltered (file,
2010 "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n",
2011 SOFTWARE_SINGLE_STEP_P ());
2012#endif
08e45a40 2013#ifdef SOFTWARE_SINGLE_STEP
4b9b3959
AC
2014 fprintf_unfiltered (file,
2015 "gdbarch_dump: %s # %s\n",
08e45a40
AC
2016 "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
2017 XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
7996bcec
AC
2018 fprintf_unfiltered (file,
2019 "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
2020 (long) current_gdbarch->software_single_step
2021 /*SOFTWARE_SINGLE_STEP ()*/);
08e45a40
AC
2022#endif
2023#ifdef SP_REGNUM
1dd4193b 2024 fprintf_unfiltered (file,
08e45a40
AC
2025 "gdbarch_dump: SP_REGNUM # %s\n",
2026 XSTRING (SP_REGNUM));
2027 fprintf_unfiltered (file,
06b25f14
AC
2028 "gdbarch_dump: SP_REGNUM = %d\n",
2029 SP_REGNUM);
1dd4193b 2030#endif
08e45a40 2031#ifdef STAB_REG_TO_REGNUM
4b9b3959
AC
2032 fprintf_unfiltered (file,
2033 "gdbarch_dump: %s # %s\n",
08e45a40
AC
2034 "STAB_REG_TO_REGNUM(stab_regnr)",
2035 XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
7996bcec
AC
2036 fprintf_unfiltered (file,
2037 "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
2038 (long) current_gdbarch->stab_reg_to_regnum
2039 /*STAB_REG_TO_REGNUM ()*/);
4b9b3959 2040#endif
a2428dbe
AC
2041 fprintf_unfiltered (file,
2042 "gdbarch_dump: stabs_argument_has_addr = 0x%08lx\n",
2043 (long) current_gdbarch->stabs_argument_has_addr);
08e45a40 2044#ifdef STORE_RETURN_VALUE
f517ea4e
PS
2045 fprintf_unfiltered (file,
2046 "gdbarch_dump: %s # %s\n",
ebba8386
AC
2047 "STORE_RETURN_VALUE(type, regcache, valbuf)",
2048 XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
7996bcec
AC
2049 fprintf_unfiltered (file,
2050 "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
2051 (long) current_gdbarch->store_return_value
2052 /*STORE_RETURN_VALUE ()*/);
875e1767 2053#endif
7996bcec 2054 fprintf_unfiltered (file,
a2428dbe
AC
2055 "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
2056 gdbarch_unwind_dummy_id_p (current_gdbarch));
cde9ea48 2057 fprintf_unfiltered (file,
a2428dbe
AC
2058 "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
2059 (long) current_gdbarch->unwind_dummy_id);
08e45a40 2060 fprintf_unfiltered (file,
a2428dbe
AC
2061 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
2062 gdbarch_unwind_pc_p (current_gdbarch));
7996bcec 2063 fprintf_unfiltered (file,
a2428dbe
AC
2064 "gdbarch_dump: unwind_pc = 0x%08lx\n",
2065 (long) current_gdbarch->unwind_pc);
bd1ce8ba 2066 fprintf_unfiltered (file,
a2428dbe
AC
2067 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
2068 gdbarch_unwind_sp_p (current_gdbarch));
bd1ce8ba 2069 fprintf_unfiltered (file,
a2428dbe
AC
2070 "gdbarch_dump: unwind_sp = 0x%08lx\n",
2071 (long) current_gdbarch->unwind_sp);
2072#ifdef VALUE_TO_REGISTER
08e45a40
AC
2073 fprintf_unfiltered (file,
2074 "gdbarch_dump: %s # %s\n",
a2428dbe
AC
2075 "VALUE_TO_REGISTER(frame, regnum, type, buf)",
2076 XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
08e45a40 2077 fprintf_unfiltered (file,
a2428dbe
AC
2078 "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
2079 (long) current_gdbarch->value_to_register
2080 /*VALUE_TO_REGISTER ()*/);
39d4ef09
AC
2081#endif
2082#ifdef TARGET_VIRTUAL_FRAME_POINTER
08e45a40
AC
2083 fprintf_unfiltered (file,
2084 "gdbarch_dump: %s # %s\n",
2085 "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2086 XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
7996bcec
AC
2087 fprintf_unfiltered (file,
2088 "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
2089 (long) current_gdbarch->virtual_frame_pointer
2090 /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
381323f4 2091#endif
08e45a40 2092#ifdef TARGET_WRITE_PC
4b9b3959 2093 fprintf_unfiltered (file,
08e45a40
AC
2094 "gdbarch_dump: %s # %s\n",
2095 "TARGET_WRITE_PC(val, ptid)",
2096 XSTRING (TARGET_WRITE_PC (val, ptid)));
7996bcec
AC
2097 fprintf_unfiltered (file,
2098 "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
2099 (long) current_gdbarch->write_pc
2100 /*TARGET_WRITE_PC ()*/);
381323f4 2101#endif
4b9b3959
AC
2102 if (current_gdbarch->dump_tdep != NULL)
2103 current_gdbarch->dump_tdep (current_gdbarch, file);
0f71a2f6
JM
2104}
2105
2106struct gdbarch_tdep *
104c1213 2107gdbarch_tdep (struct gdbarch *gdbarch)
0f71a2f6
JM
2108{
2109 if (gdbarch_debug >= 2)
0f71a2f6
JM
2110 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
2111 return gdbarch->tdep;
2112}
2113
2114
2115const struct bfd_arch_info *
104c1213 2116gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
0f71a2f6 2117{
8de9bdc4 2118 gdb_assert (gdbarch != NULL);
0f71a2f6 2119 if (gdbarch_debug >= 2)
0f71a2f6
JM
2120 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
2121 return gdbarch->bfd_arch_info;
2122}
2123
2124int
104c1213 2125gdbarch_byte_order (struct gdbarch *gdbarch)
0f71a2f6 2126{
8de9bdc4 2127 gdb_assert (gdbarch != NULL);
0f71a2f6 2128 if (gdbarch_debug >= 2)
0f71a2f6
JM
2129 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
2130 return gdbarch->byte_order;
2131}
2132
4be87837
DJ
2133enum gdb_osabi
2134gdbarch_osabi (struct gdbarch *gdbarch)
2135{
2136 gdb_assert (gdbarch != NULL);
2137 if (gdbarch_debug >= 2)
2138 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
2139 return gdbarch->osabi;
2140}
2141
0f71a2f6 2142int
104c1213 2143gdbarch_short_bit (struct gdbarch *gdbarch)
0f71a2f6 2144{
8de9bdc4 2145 gdb_assert (gdbarch != NULL);
66b43ecb 2146 /* Skip verify of short_bit, invalid_p == 0 */
0f71a2f6 2147 if (gdbarch_debug >= 2)
0f71a2f6
JM
2148 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
2149 return gdbarch->short_bit;
2150}
2151
2152void
104c1213
JM
2153set_gdbarch_short_bit (struct gdbarch *gdbarch,
2154 int short_bit)
0f71a2f6
JM
2155{
2156 gdbarch->short_bit = short_bit;
2157}
2158
2159int
104c1213 2160gdbarch_int_bit (struct gdbarch *gdbarch)
0f71a2f6 2161{
8de9bdc4 2162 gdb_assert (gdbarch != NULL);
66b43ecb 2163 /* Skip verify of int_bit, invalid_p == 0 */
0f71a2f6 2164 if (gdbarch_debug >= 2)
0f71a2f6
JM
2165 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
2166 return gdbarch->int_bit;
2167}
2168
2169void
104c1213
JM
2170set_gdbarch_int_bit (struct gdbarch *gdbarch,
2171 int int_bit)
0f71a2f6
JM
2172{
2173 gdbarch->int_bit = int_bit;
2174}
2175
2176int
104c1213 2177gdbarch_long_bit (struct gdbarch *gdbarch)
0f71a2f6 2178{
8de9bdc4 2179 gdb_assert (gdbarch != NULL);
66b43ecb 2180 /* Skip verify of long_bit, invalid_p == 0 */
0f71a2f6 2181 if (gdbarch_debug >= 2)
0f71a2f6
JM
2182 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
2183 return gdbarch->long_bit;
2184}
2185
2186void
104c1213
JM
2187set_gdbarch_long_bit (struct gdbarch *gdbarch,
2188 int long_bit)
0f71a2f6
JM
2189{
2190 gdbarch->long_bit = long_bit;
2191}
2192
2193int
104c1213 2194gdbarch_long_long_bit (struct gdbarch *gdbarch)
0f71a2f6 2195{
8de9bdc4 2196 gdb_assert (gdbarch != NULL);
66b43ecb 2197 /* Skip verify of long_long_bit, invalid_p == 0 */
0f71a2f6 2198 if (gdbarch_debug >= 2)
0f71a2f6
JM
2199 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
2200 return gdbarch->long_long_bit;
2201}
2202
2203void
104c1213
JM
2204set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
2205 int long_long_bit)
0f71a2f6
JM
2206{
2207 gdbarch->long_long_bit = long_long_bit;
2208}
2209
2210int
104c1213 2211gdbarch_float_bit (struct gdbarch *gdbarch)
0f71a2f6 2212{
8de9bdc4 2213 gdb_assert (gdbarch != NULL);
66b43ecb 2214 /* Skip verify of float_bit, invalid_p == 0 */
0f71a2f6 2215 if (gdbarch_debug >= 2)
0f71a2f6
JM
2216 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
2217 return gdbarch->float_bit;
2218}
2219
2220void
104c1213
JM
2221set_gdbarch_float_bit (struct gdbarch *gdbarch,
2222 int float_bit)
0f71a2f6
JM
2223{
2224 gdbarch->float_bit = float_bit;
2225}
2226
2227int
104c1213 2228gdbarch_double_bit (struct gdbarch *gdbarch)
0f71a2f6 2229{
8de9bdc4 2230 gdb_assert (gdbarch != NULL);
66b43ecb 2231 /* Skip verify of double_bit, invalid_p == 0 */
0f71a2f6 2232 if (gdbarch_debug >= 2)
0f71a2f6
JM
2233 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
2234 return gdbarch->double_bit;
2235}
2236
2237void
104c1213
JM
2238set_gdbarch_double_bit (struct gdbarch *gdbarch,
2239 int double_bit)
0f71a2f6
JM
2240{
2241 gdbarch->double_bit = double_bit;
2242}
2243
2244int
104c1213 2245gdbarch_long_double_bit (struct gdbarch *gdbarch)
0f71a2f6 2246{
8de9bdc4 2247 gdb_assert (gdbarch != NULL);
66b43ecb 2248 /* Skip verify of long_double_bit, invalid_p == 0 */
0f71a2f6 2249 if (gdbarch_debug >= 2)
0f71a2f6
JM
2250 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
2251 return gdbarch->long_double_bit;
2252}
2253
2254void
104c1213
JM
2255set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
2256 int long_double_bit)
0f71a2f6
JM
2257{
2258 gdbarch->long_double_bit = long_double_bit;
2259}
2260
66b43ecb
AC
2261int
2262gdbarch_ptr_bit (struct gdbarch *gdbarch)
2263{
8de9bdc4 2264 gdb_assert (gdbarch != NULL);
66b43ecb
AC
2265 /* Skip verify of ptr_bit, invalid_p == 0 */
2266 if (gdbarch_debug >= 2)
2267 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
2268 return gdbarch->ptr_bit;
2269}
2270
2271void
2272set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
2273 int ptr_bit)
2274{
2275 gdbarch->ptr_bit = ptr_bit;
2276}
2277
52204a0b
DT
2278int
2279gdbarch_addr_bit (struct gdbarch *gdbarch)
2280{
8de9bdc4 2281 gdb_assert (gdbarch != NULL);
956ac328
AC
2282 /* Check variable changed from pre-default. */
2283 gdb_assert (gdbarch->addr_bit != 0);
52204a0b
DT
2284 if (gdbarch_debug >= 2)
2285 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
2286 return gdbarch->addr_bit;
2287}
2288
2289void
2290set_gdbarch_addr_bit (struct gdbarch *gdbarch,
2291 int addr_bit)
2292{
2293 gdbarch->addr_bit = addr_bit;
2294}
2295
66b43ecb
AC
2296int
2297gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
2298{
8de9bdc4 2299 gdb_assert (gdbarch != NULL);
66b43ecb
AC
2300 /* Skip verify of bfd_vma_bit, invalid_p == 0 */
2301 if (gdbarch_debug >= 2)
2302 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
2303 return gdbarch->bfd_vma_bit;
2304}
2305
2306void
2307set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
2308 int bfd_vma_bit)
2309{
2310 gdbarch->bfd_vma_bit = bfd_vma_bit;
2311}
2312
4e409299
JB
2313int
2314gdbarch_char_signed (struct gdbarch *gdbarch)
2315{
8de9bdc4 2316 gdb_assert (gdbarch != NULL);
956ac328
AC
2317 /* Check variable changed from pre-default. */
2318 gdb_assert (gdbarch->char_signed != -1);
4e409299
JB
2319 if (gdbarch_debug >= 2)
2320 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
2321 return gdbarch->char_signed;
2322}
2323
2324void
2325set_gdbarch_char_signed (struct gdbarch *gdbarch,
2326 int char_signed)
2327{
2328 gdbarch->char_signed = char_signed;
2329}
2330
cde9ea48
AC
2331int
2332gdbarch_read_pc_p (struct gdbarch *gdbarch)
2333{
2334 gdb_assert (gdbarch != NULL);
956ac328 2335 return gdbarch->read_pc != NULL;
cde9ea48
AC
2336}
2337
0f71a2f6 2338CORE_ADDR
39f77062 2339gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
0f71a2f6 2340{
8de9bdc4 2341 gdb_assert (gdbarch != NULL);
956ac328 2342 gdb_assert (gdbarch->read_pc != NULL);
0f71a2f6 2343 if (gdbarch_debug >= 2)
0f71a2f6 2344 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
39f77062 2345 return gdbarch->read_pc (ptid);
0f71a2f6
JM
2346}
2347
2348void
104c1213
JM
2349set_gdbarch_read_pc (struct gdbarch *gdbarch,
2350 gdbarch_read_pc_ftype read_pc)
0f71a2f6
JM
2351{
2352 gdbarch->read_pc = read_pc;
2353}
2354
2355void
39f77062 2356gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
0f71a2f6 2357{
8de9bdc4 2358 gdb_assert (gdbarch != NULL);
956ac328 2359 gdb_assert (gdbarch->write_pc != NULL);
0f71a2f6 2360 if (gdbarch_debug >= 2)
0f71a2f6 2361 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
39f77062 2362 gdbarch->write_pc (val, ptid);
0f71a2f6
JM
2363}
2364
2365void
104c1213
JM
2366set_gdbarch_write_pc (struct gdbarch *gdbarch,
2367 gdbarch_write_pc_ftype write_pc)
0f71a2f6
JM
2368{
2369 gdbarch->write_pc = write_pc;
2370}
2371
bd1ce8ba
AC
2372int
2373gdbarch_read_sp_p (struct gdbarch *gdbarch)
2374{
2375 gdb_assert (gdbarch != NULL);
956ac328 2376 return gdbarch->read_sp != NULL;
bd1ce8ba
AC
2377}
2378
0f71a2f6
JM
2379CORE_ADDR
2380gdbarch_read_sp (struct gdbarch *gdbarch)
2381{
8de9bdc4 2382 gdb_assert (gdbarch != NULL);
956ac328 2383 gdb_assert (gdbarch->read_sp != NULL);
0f71a2f6 2384 if (gdbarch_debug >= 2)
0f71a2f6
JM
2385 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n");
2386 return gdbarch->read_sp ();
2387}
2388
2389void
104c1213
JM
2390set_gdbarch_read_sp (struct gdbarch *gdbarch,
2391 gdbarch_read_sp_ftype read_sp)
0f71a2f6
JM
2392{
2393 gdbarch->read_sp = read_sp;
2394}
2395
39d4ef09
AC
2396void
2397gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
2398{
8de9bdc4 2399 gdb_assert (gdbarch != NULL);
956ac328 2400 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
39d4ef09
AC
2401 if (gdbarch_debug >= 2)
2402 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
2403 gdbarch->virtual_frame_pointer (pc, frame_regnum, frame_offset);
2404}
2405
2406void
2407set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
2408 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
2409{
2410 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
2411}
2412
61a0eb5b 2413int
d8124050 2414gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
61a0eb5b 2415{
8de9bdc4 2416 gdb_assert (gdbarch != NULL);
956ac328 2417 return gdbarch->pseudo_register_read != NULL;
61a0eb5b
AC
2418}
2419
2420void
d8124050 2421gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, void *buf)
61a0eb5b 2422{
8de9bdc4 2423 gdb_assert (gdbarch != NULL);
956ac328 2424 gdb_assert (gdbarch->pseudo_register_read != NULL);
61a0eb5b 2425 if (gdbarch_debug >= 2)
d8124050
AC
2426 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
2427 gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
61a0eb5b
AC
2428}
2429
2430void
d8124050
AC
2431set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
2432 gdbarch_pseudo_register_read_ftype pseudo_register_read)
61a0eb5b 2433{
d8124050 2434 gdbarch->pseudo_register_read = pseudo_register_read;
61a0eb5b
AC
2435}
2436
2437int
d8124050 2438gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
61a0eb5b 2439{
8de9bdc4 2440 gdb_assert (gdbarch != NULL);
956ac328 2441 return gdbarch->pseudo_register_write != NULL;
61a0eb5b
AC
2442}
2443
2444void
d8124050 2445gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const void *buf)
61a0eb5b 2446{
8de9bdc4 2447 gdb_assert (gdbarch != NULL);
956ac328 2448 gdb_assert (gdbarch->pseudo_register_write != NULL);
61a0eb5b 2449 if (gdbarch_debug >= 2)
d8124050
AC
2450 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
2451 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
61a0eb5b
AC
2452}
2453
2454void
d8124050
AC
2455set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
2456 gdbarch_pseudo_register_write_ftype pseudo_register_write)
61a0eb5b 2457{
d8124050 2458 gdbarch->pseudo_register_write = pseudo_register_write;
61a0eb5b
AC
2459}
2460
0f71a2f6 2461int
104c1213 2462gdbarch_num_regs (struct gdbarch *gdbarch)
0f71a2f6 2463{
8de9bdc4 2464 gdb_assert (gdbarch != NULL);
956ac328
AC
2465 /* Check variable changed from pre-default. */
2466 gdb_assert (gdbarch->num_regs != -1);
0f71a2f6 2467 if (gdbarch_debug >= 2)
0f71a2f6
JM
2468 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
2469 return gdbarch->num_regs;
2470}
2471
2472void
104c1213
JM
2473set_gdbarch_num_regs (struct gdbarch *gdbarch,
2474 int num_regs)
0f71a2f6
JM
2475{
2476 gdbarch->num_regs = num_regs;
2477}
2478
0aba1244
EZ
2479int
2480gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2481{
8de9bdc4 2482 gdb_assert (gdbarch != NULL);
0aba1244
EZ
2483 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2484 if (gdbarch_debug >= 2)
2485 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2486 return gdbarch->num_pseudo_regs;
2487}
2488
2489void
2490set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2491 int num_pseudo_regs)
2492{
2493 gdbarch->num_pseudo_regs = num_pseudo_regs;
2494}
2495
0f71a2f6 2496int
104c1213 2497gdbarch_sp_regnum (struct gdbarch *gdbarch)
0f71a2f6 2498{
8de9bdc4 2499 gdb_assert (gdbarch != NULL);
1200cd6e 2500 /* Skip verify of sp_regnum, invalid_p == 0 */
0f71a2f6 2501 if (gdbarch_debug >= 2)
0f71a2f6
JM
2502 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2503 return gdbarch->sp_regnum;
2504}
2505
2506void
104c1213
JM
2507set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2508 int sp_regnum)
0f71a2f6
JM
2509{
2510 gdbarch->sp_regnum = sp_regnum;
2511}
2512
0f71a2f6 2513int
104c1213 2514gdbarch_pc_regnum (struct gdbarch *gdbarch)
0f71a2f6 2515{
8de9bdc4 2516 gdb_assert (gdbarch != NULL);
1200cd6e 2517 /* Skip verify of pc_regnum, invalid_p == 0 */
0f71a2f6 2518 if (gdbarch_debug >= 2)
0f71a2f6
JM
2519 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2520 return gdbarch->pc_regnum;
2521}
2522
2523void
104c1213
JM
2524set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2525 int pc_regnum)
0f71a2f6
JM
2526{
2527 gdbarch->pc_regnum = pc_regnum;
2528}
2529
c2169756
AC
2530int
2531gdbarch_ps_regnum (struct gdbarch *gdbarch)
2532{
8de9bdc4 2533 gdb_assert (gdbarch != NULL);
c2169756
AC
2534 /* Skip verify of ps_regnum, invalid_p == 0 */
2535 if (gdbarch_debug >= 2)
2536 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2537 return gdbarch->ps_regnum;
2538}
2539
2540void
2541set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2542 int ps_regnum)
2543{
2544 gdbarch->ps_regnum = ps_regnum;
2545}
2546
60054393
MS
2547int
2548gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2549{
8de9bdc4 2550 gdb_assert (gdbarch != NULL);
60054393
MS
2551 /* Skip verify of fp0_regnum, invalid_p == 0 */
2552 if (gdbarch_debug >= 2)
2553 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2554 return gdbarch->fp0_regnum;
2555}
2556
2557void
2558set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2559 int fp0_regnum)
2560{
2561 gdbarch->fp0_regnum = fp0_regnum;
2562}
2563
88c72b7d
AC
2564int
2565gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2566{
8de9bdc4 2567 gdb_assert (gdbarch != NULL);
956ac328 2568 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
88c72b7d
AC
2569 if (gdbarch_debug >= 2)
2570 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
2571 return gdbarch->stab_reg_to_regnum (stab_regnr);
2572}
2573
2574void
2575set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2576 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2577{
2578 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2579}
2580
2581int
2582gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2583{
8de9bdc4 2584 gdb_assert (gdbarch != NULL);
956ac328 2585 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
88c72b7d
AC
2586 if (gdbarch_debug >= 2)
2587 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
2588 return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
2589}
2590
2591void
2592set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2593 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2594{
2595 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2596}
2597
2598int
2599gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
2600{
8de9bdc4 2601 gdb_assert (gdbarch != NULL);
956ac328 2602 gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
88c72b7d
AC
2603 if (gdbarch_debug >= 2)
2604 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
2605 return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
2606}
2607
2608void
2609set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
2610 gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
2611{
2612 gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
2613}
2614
2615int
2616gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2617{
8de9bdc4 2618 gdb_assert (gdbarch != NULL);
956ac328 2619 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
88c72b7d
AC
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
2622 return gdbarch->sdb_reg_to_regnum (sdb_regnr);
2623}
2624
2625void
2626set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2627 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2628{
2629 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2630}
2631
2632int
2633gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2634{
8de9bdc4 2635 gdb_assert (gdbarch != NULL);
956ac328 2636 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
88c72b7d
AC
2637 if (gdbarch_debug >= 2)
2638 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
2639 return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
2640}
2641
2642void
2643set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2644 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2645{
2646 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2647}
2648
fa88f677 2649const char *
0f71a2f6
JM
2650gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2651{
8de9bdc4 2652 gdb_assert (gdbarch != NULL);
956ac328 2653 gdb_assert (gdbarch->register_name != NULL);
0f71a2f6 2654 if (gdbarch_debug >= 2)
0f71a2f6
JM
2655 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
2656 return gdbarch->register_name (regnr);
2657}
2658
2659void
104c1213
JM
2660set_gdbarch_register_name (struct gdbarch *gdbarch,
2661 gdbarch_register_name_ftype register_name)
0f71a2f6
JM
2662{
2663 gdbarch->register_name = register_name;
2664}
2665
0f71a2f6 2666int
9c04cab7 2667gdbarch_register_type_p (struct gdbarch *gdbarch)
0f71a2f6 2668{
8de9bdc4 2669 gdb_assert (gdbarch != NULL);
956ac328 2670 return gdbarch->register_type != NULL;
9c04cab7
AC
2671}
2672
2673struct type *
2674gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2675{
2676 gdb_assert (gdbarch != NULL);
956ac328 2677 gdb_assert (gdbarch->register_type != NULL);
0f71a2f6 2678 if (gdbarch_debug >= 2)
9c04cab7
AC
2679 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2680 return gdbarch->register_type (gdbarch, reg_nr);
0f71a2f6
JM
2681}
2682
2683void
9c04cab7
AC
2684set_gdbarch_register_type (struct gdbarch *gdbarch,
2685 gdbarch_register_type_ftype register_type)
0f71a2f6 2686{
9c04cab7 2687 gdbarch->register_type = register_type;
0f71a2f6
JM
2688}
2689
46654a5b 2690int
9c04cab7 2691gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch)
46654a5b
AC
2692{
2693 gdb_assert (gdbarch != NULL);
956ac328 2694 return gdbarch->deprecated_register_virtual_type != NULL;
46654a5b
AC
2695}
2696
9c04cab7
AC
2697struct type *
2698gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 2699{
8de9bdc4 2700 gdb_assert (gdbarch != NULL);
956ac328 2701 gdb_assert (gdbarch->deprecated_register_virtual_type != NULL);
0f71a2f6 2702 if (gdbarch_debug >= 2)
9c04cab7
AC
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_type called\n");
2704 return gdbarch->deprecated_register_virtual_type (reg_nr);
0f71a2f6
JM
2705}
2706
2707void
9c04cab7
AC
2708set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch,
2709 gdbarch_deprecated_register_virtual_type_ftype deprecated_register_virtual_type)
0f71a2f6 2710{
9c04cab7 2711 gdbarch->deprecated_register_virtual_type = deprecated_register_virtual_type;
0f71a2f6
JM
2712}
2713
2714int
9c04cab7 2715gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch)
0f71a2f6 2716{
8de9bdc4 2717 gdb_assert (gdbarch != NULL);
0f71a2f6 2718 if (gdbarch_debug >= 2)
9c04cab7
AC
2719 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_bytes called\n");
2720 return gdbarch->deprecated_register_bytes;
0f71a2f6
JM
2721}
2722
2723void
9c04cab7
AC
2724set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch,
2725 int deprecated_register_bytes)
0f71a2f6 2726{
9c04cab7 2727 gdbarch->deprecated_register_bytes = deprecated_register_bytes;
0f71a2f6
JM
2728}
2729
2730int
9c04cab7 2731gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
a0ed5532
AC
2732{
2733 gdb_assert (gdbarch != NULL);
9c04cab7 2734 return gdbarch->deprecated_register_byte != generic_register_byte;
a0ed5532
AC
2735}
2736
2737int
9c04cab7 2738gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 2739{
8de9bdc4 2740 gdb_assert (gdbarch != NULL);
956ac328
AC
2741 gdb_assert (gdbarch->deprecated_register_byte != NULL);
2742 /* Do not check predicate: gdbarch->deprecated_register_byte != generic_register_byte, allow call. */
0f71a2f6 2743 if (gdbarch_debug >= 2)
9c04cab7
AC
2744 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_byte called\n");
2745 return gdbarch->deprecated_register_byte (reg_nr);
0f71a2f6
JM
2746}
2747
2748void
9c04cab7
AC
2749set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch,
2750 gdbarch_deprecated_register_byte_ftype deprecated_register_byte)
0f71a2f6 2751{
9c04cab7 2752 gdbarch->deprecated_register_byte = deprecated_register_byte;
0f71a2f6
JM
2753}
2754
dadd712e
AC
2755int
2756gdbarch_deprecated_register_raw_size_p (struct gdbarch *gdbarch)
2757{
2758 gdb_assert (gdbarch != NULL);
2759 return gdbarch->deprecated_register_raw_size != generic_register_size;
2760}
2761
0f71a2f6 2762int
9c04cab7 2763gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 2764{
8de9bdc4 2765 gdb_assert (gdbarch != NULL);
956ac328
AC
2766 gdb_assert (gdbarch->deprecated_register_raw_size != NULL);
2767 /* Do not check predicate: gdbarch->deprecated_register_raw_size != generic_register_size, allow call. */
0f71a2f6 2768 if (gdbarch_debug >= 2)
9c04cab7
AC
2769 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_raw_size called\n");
2770 return gdbarch->deprecated_register_raw_size (reg_nr);
0f71a2f6
JM
2771}
2772
2773void
9c04cab7
AC
2774set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch,
2775 gdbarch_deprecated_register_raw_size_ftype deprecated_register_raw_size)
0f71a2f6 2776{
9c04cab7 2777 gdbarch->deprecated_register_raw_size = deprecated_register_raw_size;
0f71a2f6
JM
2778}
2779
dadd712e
AC
2780int
2781gdbarch_deprecated_register_virtual_size_p (struct gdbarch *gdbarch)
2782{
2783 gdb_assert (gdbarch != NULL);
2784 return gdbarch->deprecated_register_virtual_size != generic_register_size;
2785}
2786
0f71a2f6 2787int
9c04cab7 2788gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 2789{
8de9bdc4 2790 gdb_assert (gdbarch != NULL);
956ac328
AC
2791 gdb_assert (gdbarch->deprecated_register_virtual_size != NULL);
2792 /* Do not check predicate: gdbarch->deprecated_register_virtual_size != generic_register_size, allow call. */
0f71a2f6 2793 if (gdbarch_debug >= 2)
9c04cab7
AC
2794 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_virtual_size called\n");
2795 return gdbarch->deprecated_register_virtual_size (reg_nr);
0f71a2f6
JM
2796}
2797
2798void
9c04cab7
AC
2799set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch,
2800 gdbarch_deprecated_register_virtual_size_ftype deprecated_register_virtual_size)
0f71a2f6 2801{
9c04cab7 2802 gdbarch->deprecated_register_virtual_size = deprecated_register_virtual_size;
0f71a2f6
JM
2803}
2804
f3be58bc
AC
2805int
2806gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
2807{
2808 gdb_assert (gdbarch != NULL);
956ac328 2809 return gdbarch->unwind_dummy_id != NULL;
f3be58bc
AC
2810}
2811
2812struct frame_id
2813gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *info)
2814{
2815 gdb_assert (gdbarch != NULL);
956ac328 2816 gdb_assert (gdbarch->unwind_dummy_id != NULL);
f3be58bc
AC
2817 if (gdbarch_debug >= 2)
2818 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_dummy_id called\n");
2819 return gdbarch->unwind_dummy_id (gdbarch, info);
2820}
2821
2822void
2823set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch,
2824 gdbarch_unwind_dummy_id_ftype unwind_dummy_id)
2825{
2826 gdbarch->unwind_dummy_id = unwind_dummy_id;
2827}
2828
2829int
a59fe496 2830gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
f3be58bc
AC
2831{
2832 gdb_assert (gdbarch != NULL);
956ac328 2833 return gdbarch->deprecated_save_dummy_frame_tos != NULL;
f3be58bc
AC
2834}
2835
2836void
a59fe496 2837gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
f3be58bc
AC
2838{
2839 gdb_assert (gdbarch != NULL);
956ac328 2840 gdb_assert (gdbarch->deprecated_save_dummy_frame_tos != NULL);
f3be58bc 2841 if (gdbarch_debug >= 2)
a59fe496
AC
2842 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_save_dummy_frame_tos called\n");
2843 gdbarch->deprecated_save_dummy_frame_tos (sp);
f3be58bc
AC
2844}
2845
2846void
a59fe496
AC
2847set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch,
2848 gdbarch_deprecated_save_dummy_frame_tos_ftype deprecated_save_dummy_frame_tos)
f3be58bc 2849{
a59fe496 2850 gdbarch->deprecated_save_dummy_frame_tos = deprecated_save_dummy_frame_tos;
f3be58bc
AC
2851}
2852
2853int
2854gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2855{
2856 gdb_assert (gdbarch != NULL);
2857 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2858 if (gdbarch_debug >= 2)
2859 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2860 return gdbarch->deprecated_fp_regnum;
2861}
2862
2863void
2864set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2865 int deprecated_fp_regnum)
2866{
2867 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2868}
2869
2870int
2871gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch)
2872{
2873 gdb_assert (gdbarch != NULL);
956ac328 2874 return gdbarch->deprecated_target_read_fp != NULL;
f3be58bc
AC
2875}
2876
2877CORE_ADDR
2878gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch)
2879{
2880 gdb_assert (gdbarch != NULL);
956ac328 2881 gdb_assert (gdbarch->deprecated_target_read_fp != NULL);
f3be58bc
AC
2882 if (gdbarch_debug >= 2)
2883 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_target_read_fp called\n");
2884 return gdbarch->deprecated_target_read_fp ();
2885}
2886
2887void
2888set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch,
2889 gdbarch_deprecated_target_read_fp_ftype deprecated_target_read_fp)
2890{
2891 gdbarch->deprecated_target_read_fp = deprecated_target_read_fp;
2892}
2893
0ab7a791 2894int
b8de8283 2895gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
0ab7a791
AC
2896{
2897 gdb_assert (gdbarch != NULL);
956ac328 2898 return gdbarch->push_dummy_call != NULL;
0ab7a791
AC
2899}
2900
b8de8283 2901CORE_ADDR
7d9b040b 2902gdbarch_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 2903{
8de9bdc4 2904 gdb_assert (gdbarch != NULL);
956ac328 2905 gdb_assert (gdbarch->push_dummy_call != NULL);
666e11c5 2906 if (gdbarch_debug >= 2)
b8de8283 2907 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
7d9b040b 2908 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
666e11c5
EZ
2909}
2910
2911void
b8de8283
AC
2912set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2913 gdbarch_push_dummy_call_ftype push_dummy_call)
666e11c5 2914{
b8de8283 2915 gdbarch->push_dummy_call = push_dummy_call;
666e11c5
EZ
2916}
2917
b8de8283
AC
2918int
2919gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch)
0ab7a791
AC
2920{
2921 gdb_assert (gdbarch != NULL);
956ac328 2922 return gdbarch->deprecated_push_arguments != NULL;
b8de8283
AC
2923}
2924
2925CORE_ADDR
2926gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
2927{
2928 gdb_assert (gdbarch != NULL);
956ac328 2929 gdb_assert (gdbarch->deprecated_push_arguments != NULL);
0ab7a791 2930 if (gdbarch_debug >= 2)
b8de8283
AC
2931 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_arguments called\n");
2932 return gdbarch->deprecated_push_arguments (nargs, args, sp, struct_return, struct_addr);
0ab7a791
AC
2933}
2934
2935void
b8de8283
AC
2936set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch,
2937 gdbarch_deprecated_push_arguments_ftype deprecated_push_arguments)
0ab7a791 2938{
b8de8283 2939 gdbarch->deprecated_push_arguments = deprecated_push_arguments;
0ab7a791
AC
2940}
2941
b8de8283
AC
2942int
2943gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch)
5e74b15c 2944{
8de9bdc4 2945 gdb_assert (gdbarch != NULL);
956ac328 2946 return gdbarch->deprecated_push_return_address != NULL;
b8de8283
AC
2947}
2948
2949CORE_ADDR
2950gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
2951{
2952 gdb_assert (gdbarch != NULL);
956ac328 2953 gdb_assert (gdbarch->deprecated_push_return_address != NULL);
5e74b15c 2954 if (gdbarch_debug >= 2)
b8de8283
AC
2955 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_return_address called\n");
2956 return gdbarch->deprecated_push_return_address (pc, sp);
5e74b15c
RE
2957}
2958
2959void
b8de8283
AC
2960set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch,
2961 gdbarch_deprecated_push_return_address_ftype deprecated_push_return_address)
5e74b15c 2962{
b8de8283 2963 gdbarch->deprecated_push_return_address = deprecated_push_return_address;
5e74b15c
RE
2964}
2965
e76f1f2e 2966int
b8de8283 2967gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch)
e76f1f2e
AC
2968{
2969 gdb_assert (gdbarch != NULL);
956ac328 2970 return gdbarch->deprecated_dummy_write_sp != NULL;
e76f1f2e
AC
2971}
2972
2973void
b8de8283 2974gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
e76f1f2e
AC
2975{
2976 gdb_assert (gdbarch != NULL);
956ac328 2977 gdb_assert (gdbarch->deprecated_dummy_write_sp != NULL);
e76f1f2e 2978 if (gdbarch_debug >= 2)
b8de8283
AC
2979 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_dummy_write_sp called\n");
2980 gdbarch->deprecated_dummy_write_sp (val);
e76f1f2e
AC
2981}
2982
2983void
b8de8283
AC
2984set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch,
2985 gdbarch_deprecated_dummy_write_sp_ftype deprecated_dummy_write_sp)
e76f1f2e 2986{
b8de8283 2987 gdbarch->deprecated_dummy_write_sp = deprecated_dummy_write_sp;
e76f1f2e
AC
2988}
2989
7c7651b2 2990int
b8de8283 2991gdbarch_deprecated_register_size (struct gdbarch *gdbarch)
7c7651b2 2992{
8de9bdc4 2993 gdb_assert (gdbarch != NULL);
7c7651b2 2994 if (gdbarch_debug >= 2)
b8de8283
AC
2995 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_size called\n");
2996 return gdbarch->deprecated_register_size;
7c7651b2
AC
2997}
2998
2999void
b8de8283
AC
3000set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch,
3001 int deprecated_register_size)
7c7651b2 3002{
b8de8283 3003 gdbarch->deprecated_register_size = deprecated_register_size;
7c7651b2
AC
3004}
3005
2649061d 3006int
b8de8283 3007gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2649061d 3008{
8de9bdc4 3009 gdb_assert (gdbarch != NULL);
b8de8283
AC
3010 /* Skip verify of call_dummy_location, invalid_p == 0 */
3011 if (gdbarch_debug >= 2)
3012 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
3013 return gdbarch->call_dummy_location;
2649061d
AC
3014}
3015
b8de8283
AC
3016void
3017set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
3018 int call_dummy_location)
3019{
3020 gdbarch->call_dummy_location = call_dummy_location;
3021}
3022
0f71a2f6 3023int
b8de8283 3024gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
0f71a2f6 3025{
8de9bdc4 3026 gdb_assert (gdbarch != NULL);
956ac328 3027 return gdbarch->push_dummy_code != NULL;
b8de8283
AC
3028}
3029
3030CORE_ADDR
3031gdbarch_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)
3032{
3033 gdb_assert (gdbarch != NULL);
956ac328 3034 gdb_assert (gdbarch->push_dummy_code != NULL);
0f71a2f6 3035 if (gdbarch_debug >= 2)
b8de8283
AC
3036 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
3037 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr);
0f71a2f6
JM
3038}
3039
3040void
b8de8283
AC
3041set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
3042 gdbarch_push_dummy_code_ftype push_dummy_code)
0f71a2f6 3043{
b8de8283 3044 gdbarch->push_dummy_code = push_dummy_code;
0f71a2f6
JM
3045}
3046
b8de8283
AC
3047int
3048gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch)
0f71a2f6 3049{
8de9bdc4 3050 gdb_assert (gdbarch != NULL);
956ac328 3051 return gdbarch->deprecated_do_registers_info != NULL;
b8de8283
AC
3052}
3053
3054void
3055gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
3056{
3057 gdb_assert (gdbarch != NULL);
956ac328 3058 gdb_assert (gdbarch->deprecated_do_registers_info != NULL);
0f71a2f6 3059 if (gdbarch_debug >= 2)
b8de8283
AC
3060 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_do_registers_info called\n");
3061 gdbarch->deprecated_do_registers_info (reg_nr, fpregs);
0f71a2f6
JM
3062}
3063
3064void
b8de8283
AC
3065set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch,
3066 gdbarch_deprecated_do_registers_info_ftype deprecated_do_registers_info)
0f71a2f6 3067{
b8de8283
AC
3068 gdbarch->deprecated_do_registers_info = deprecated_do_registers_info;
3069}
3070
3071void
3072gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
3073{
3074 gdb_assert (gdbarch != NULL);
956ac328 3075 gdb_assert (gdbarch->print_registers_info != NULL);
b8de8283
AC
3076 if (gdbarch_debug >= 2)
3077 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
3078 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
3079}
3080
3081void
3082set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
3083 gdbarch_print_registers_info_ftype print_registers_info)
3084{
3085 gdbarch->print_registers_info = print_registers_info;
0f71a2f6
JM
3086}
3087
0f71a2f6 3088int
b8de8283
AC
3089gdbarch_print_float_info_p (struct gdbarch *gdbarch)
3090{
3091 gdb_assert (gdbarch != NULL);
956ac328 3092 return gdbarch->print_float_info != NULL;
b8de8283
AC
3093}
3094
3095void
3096gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
0f71a2f6 3097{
8de9bdc4 3098 gdb_assert (gdbarch != NULL);
956ac328 3099 gdb_assert (gdbarch->print_float_info != NULL);
0f71a2f6 3100 if (gdbarch_debug >= 2)
b8de8283
AC
3101 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
3102 gdbarch->print_float_info (gdbarch, file, frame, args);
0f71a2f6
JM
3103}
3104
3105void
b8de8283
AC
3106set_gdbarch_print_float_info (struct gdbarch *gdbarch,
3107 gdbarch_print_float_info_ftype print_float_info)
0f71a2f6 3108{
b8de8283
AC
3109 gdbarch->print_float_info = print_float_info;
3110}
3111
3112int
3113gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
3114{
3115 gdb_assert (gdbarch != NULL);
956ac328 3116 return gdbarch->print_vector_info != NULL;
b8de8283
AC
3117}
3118
3119void
3120gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
3121{
3122 gdb_assert (gdbarch != NULL);
956ac328 3123 gdb_assert (gdbarch->print_vector_info != NULL);
b8de8283
AC
3124 if (gdbarch_debug >= 2)
3125 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
3126 gdbarch->print_vector_info (gdbarch, file, frame, args);
0f71a2f6
JM
3127}
3128
b8de8283
AC
3129void
3130set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
3131 gdbarch_print_vector_info_ftype print_vector_info)
ae45cd16 3132{
b8de8283 3133 gdbarch->print_vector_info = print_vector_info;
ae45cd16
AC
3134}
3135
3136int
b8de8283 3137gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 3138{
8de9bdc4 3139 gdb_assert (gdbarch != NULL);
956ac328 3140 gdb_assert (gdbarch->register_sim_regno != NULL);
0f71a2f6 3141 if (gdbarch_debug >= 2)
b8de8283
AC
3142 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
3143 return gdbarch->register_sim_regno (reg_nr);
0f71a2f6
JM
3144}
3145
3146void
b8de8283
AC
3147set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
3148 gdbarch_register_sim_regno_ftype register_sim_regno)
0f71a2f6 3149{
b8de8283 3150 gdbarch->register_sim_regno = register_sim_regno;
0f71a2f6
JM
3151}
3152
b8de8283
AC
3153int
3154gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
0f71a2f6 3155{
8de9bdc4 3156 gdb_assert (gdbarch != NULL);
956ac328 3157 return gdbarch->register_bytes_ok != NULL;
0f71a2f6
JM
3158}
3159
3160int
b8de8283 3161gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
0f71a2f6 3162{
8de9bdc4 3163 gdb_assert (gdbarch != NULL);
956ac328 3164 gdb_assert (gdbarch->register_bytes_ok != NULL);
0f71a2f6 3165 if (gdbarch_debug >= 2)
b8de8283
AC
3166 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n");
3167 return gdbarch->register_bytes_ok (nr_bytes);
0f71a2f6
JM
3168}
3169
3170void
b8de8283
AC
3171set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
3172 gdbarch_register_bytes_ok_ftype register_bytes_ok)
0f71a2f6 3173{
b8de8283 3174 gdbarch->register_bytes_ok = register_bytes_ok;
0f71a2f6
JM
3175}
3176
3177int
b8de8283 3178gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
0f71a2f6 3179{
8de9bdc4 3180 gdb_assert (gdbarch != NULL);
956ac328 3181 gdb_assert (gdbarch->cannot_fetch_register != NULL);
b8de8283
AC
3182 if (gdbarch_debug >= 2)
3183 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
3184 return gdbarch->cannot_fetch_register (regnum);
3185}
3186
3187void
3188set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
3189 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
3190{
3191 gdbarch->cannot_fetch_register = cannot_fetch_register;
0f71a2f6
JM
3192}
3193
3194int
b8de8283 3195gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
0f71a2f6 3196{
8de9bdc4 3197 gdb_assert (gdbarch != NULL);
956ac328 3198 gdb_assert (gdbarch->cannot_store_register != NULL);
0f71a2f6 3199 if (gdbarch_debug >= 2)
b8de8283
AC
3200 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
3201 return gdbarch->cannot_store_register (regnum);
0f71a2f6
JM
3202}
3203
3204void
b8de8283
AC
3205set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
3206 gdbarch_cannot_store_register_ftype cannot_store_register)
0f71a2f6 3207{
b8de8283 3208 gdbarch->cannot_store_register = cannot_store_register;
0f71a2f6
JM
3209}
3210
e8ab51f7 3211int
b8de8283 3212gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
e8ab51f7
AC
3213{
3214 gdb_assert (gdbarch != NULL);
956ac328 3215 return gdbarch->get_longjmp_target != NULL;
e8ab51f7
AC
3216}
3217
b8de8283
AC
3218int
3219gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
0f71a2f6 3220{
8de9bdc4 3221 gdb_assert (gdbarch != NULL);
956ac328 3222 gdb_assert (gdbarch->get_longjmp_target != NULL);
0f71a2f6 3223 if (gdbarch_debug >= 2)
b8de8283
AC
3224 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
3225 return gdbarch->get_longjmp_target (pc);
0f71a2f6
JM
3226}
3227
3228void
b8de8283
AC
3229set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
3230 gdbarch_get_longjmp_target_ftype get_longjmp_target)
0f71a2f6 3231{
b8de8283 3232 gdbarch->get_longjmp_target = get_longjmp_target;
0f71a2f6
JM
3233}
3234
a5afb99f
AC
3235int
3236gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch)
3237{
3238 gdb_assert (gdbarch != NULL);
956ac328 3239 return gdbarch->deprecated_init_frame_pc != NULL;
a5afb99f
AC
3240}
3241
97f46953 3242CORE_ADDR
a5afb99f 3243gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
10312cc4 3244{
8de9bdc4 3245 gdb_assert (gdbarch != NULL);
956ac328 3246 gdb_assert (gdbarch->deprecated_init_frame_pc != NULL);
10312cc4 3247 if (gdbarch_debug >= 2)
a5afb99f
AC
3248 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc called\n");
3249 return gdbarch->deprecated_init_frame_pc (fromleaf, prev);
10312cc4
AC
3250}
3251
3252void
a5afb99f
AC
3253set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch,
3254 gdbarch_deprecated_init_frame_pc_ftype deprecated_init_frame_pc)
10312cc4 3255{
a5afb99f 3256 gdbarch->deprecated_init_frame_pc = deprecated_init_frame_pc;
10312cc4
AC
3257}
3258
0f71a2f6 3259int
104c1213 3260gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
0f71a2f6 3261{
8de9bdc4 3262 gdb_assert (gdbarch != NULL);
0f71a2f6 3263 if (gdbarch_debug >= 2)
0f71a2f6
JM
3264 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
3265 return gdbarch->believe_pcc_promotion;
3266}
3267
3268void
104c1213
JM
3269set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
3270 int believe_pcc_promotion)
0f71a2f6
JM
3271{
3272 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
3273}
3274
a216a322 3275int
129c1cd6 3276gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch)
a216a322
AC
3277{
3278 gdb_assert (gdbarch != NULL);
956ac328 3279 return gdbarch->deprecated_get_saved_register != NULL;
a216a322
AC
3280}
3281
0f71a2f6 3282void
129c1cd6 3283gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
0f71a2f6 3284{
8de9bdc4 3285 gdb_assert (gdbarch != NULL);
956ac328 3286 gdb_assert (gdbarch->deprecated_get_saved_register != NULL);
0f71a2f6 3287 if (gdbarch_debug >= 2)
129c1cd6
AC
3288 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_get_saved_register called\n");
3289 gdbarch->deprecated_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
0f71a2f6
JM
3290}
3291
3292void
129c1cd6
AC
3293set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
3294 gdbarch_deprecated_get_saved_register_ftype deprecated_get_saved_register)
0f71a2f6 3295{
129c1cd6 3296 gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
0f71a2f6
JM
3297}
3298
13d01224 3299int
ff2e87ac 3300gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
13d01224
AC
3301{
3302 gdb_assert (gdbarch != NULL);
956ac328 3303 gdb_assert (gdbarch->convert_register_p != NULL);
13d01224
AC
3304 if (gdbarch_debug >= 2)
3305 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
ff2e87ac 3306 return gdbarch->convert_register_p (regnum, type);
13d01224
AC
3307}
3308
3309void
3310set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
3311 gdbarch_convert_register_p_ftype convert_register_p)
3312{
3313 gdbarch->convert_register_p = convert_register_p;
3314}
3315
3316void
ff2e87ac 3317gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf)
13d01224
AC
3318{
3319 gdb_assert (gdbarch != NULL);
956ac328 3320 gdb_assert (gdbarch->register_to_value != NULL);
13d01224
AC
3321 if (gdbarch_debug >= 2)
3322 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
ff2e87ac 3323 gdbarch->register_to_value (frame, regnum, type, buf);
13d01224
AC
3324}
3325
3326void
3327set_gdbarch_register_to_value (struct gdbarch *gdbarch,
3328 gdbarch_register_to_value_ftype register_to_value)
3329{
3330 gdbarch->register_to_value = register_to_value;
3331}
3332
3333void
ff2e87ac 3334gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf)
13d01224
AC
3335{
3336 gdb_assert (gdbarch != NULL);
956ac328 3337 gdb_assert (gdbarch->value_to_register != NULL);
13d01224
AC
3338 if (gdbarch_debug >= 2)
3339 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
ff2e87ac 3340 gdbarch->value_to_register (frame, regnum, type, buf);
13d01224
AC
3341}
3342
3343void
3344set_gdbarch_value_to_register (struct gdbarch *gdbarch,
3345 gdbarch_value_to_register_ftype value_to_register)
3346{
3347 gdbarch->value_to_register = value_to_register;
3348}
3349
4478b372 3350CORE_ADDR
66140c26 3351gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf)
4478b372 3352{
8de9bdc4 3353 gdb_assert (gdbarch != NULL);
956ac328 3354 gdb_assert (gdbarch->pointer_to_address != NULL);
4478b372
JB
3355 if (gdbarch_debug >= 2)
3356 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
3357 return gdbarch->pointer_to_address (type, buf);
3358}
3359
3360void
3361set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
3362 gdbarch_pointer_to_address_ftype pointer_to_address)
3363{
3364 gdbarch->pointer_to_address = pointer_to_address;
3365}
3366
3367void
ac2e2ef7 3368gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
4478b372 3369{
8de9bdc4 3370 gdb_assert (gdbarch != NULL);
956ac328 3371 gdb_assert (gdbarch->address_to_pointer != NULL);
4478b372
JB
3372 if (gdbarch_debug >= 2)
3373 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
3374 gdbarch->address_to_pointer (type, buf, addr);
3375}
3376
3377void
3378set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
3379 gdbarch_address_to_pointer_ftype address_to_pointer)
3380{
3381 gdbarch->address_to_pointer = address_to_pointer;
3382}
3383
fc0c74b1
AC
3384int
3385gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
3386{
8de9bdc4 3387 gdb_assert (gdbarch != NULL);
956ac328 3388 return gdbarch->integer_to_address != NULL;
fc0c74b1
AC
3389}
3390
3391CORE_ADDR
3392gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
3393{
8de9bdc4 3394 gdb_assert (gdbarch != NULL);
956ac328 3395 gdb_assert (gdbarch->integer_to_address != NULL);
fc0c74b1
AC
3396 if (gdbarch_debug >= 2)
3397 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
3398 return gdbarch->integer_to_address (type, buf);
3399}
3400
3401void
3402set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
3403 gdbarch_integer_to_address_ftype integer_to_address)
3404{
3405 gdbarch->integer_to_address = integer_to_address;
3406}
3407
dedc2a2b 3408int
749b82f6 3409gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch)
dedc2a2b
AC
3410{
3411 gdb_assert (gdbarch != NULL);
956ac328 3412 return gdbarch->deprecated_pop_frame != NULL;
dedc2a2b
AC
3413}
3414
0f71a2f6 3415void
749b82f6 3416gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch)
0f71a2f6 3417{
8de9bdc4 3418 gdb_assert (gdbarch != NULL);
956ac328 3419 gdb_assert (gdbarch->deprecated_pop_frame != NULL);
0f71a2f6 3420 if (gdbarch_debug >= 2)
749b82f6
AC
3421 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pop_frame called\n");
3422 gdbarch->deprecated_pop_frame ();
0f71a2f6
JM
3423}
3424
3425void
749b82f6
AC
3426set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch,
3427 gdbarch_deprecated_pop_frame_ftype deprecated_pop_frame)
0f71a2f6 3428{
749b82f6 3429 gdbarch->deprecated_pop_frame = deprecated_pop_frame;
0f71a2f6
JM
3430}
3431
4183d812
AC
3432int
3433gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch)
3434{
3435 gdb_assert (gdbarch != NULL);
956ac328 3436 return gdbarch->deprecated_store_struct_return != NULL;
4183d812
AC
3437}
3438
0f71a2f6 3439void
4183d812 3440gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
0f71a2f6 3441{
8de9bdc4 3442 gdb_assert (gdbarch != NULL);
956ac328 3443 gdb_assert (gdbarch->deprecated_store_struct_return != NULL);
0f71a2f6 3444 if (gdbarch_debug >= 2)
4183d812
AC
3445 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_struct_return called\n");
3446 gdbarch->deprecated_store_struct_return (addr, sp);
0f71a2f6
JM
3447}
3448
3449void
4183d812
AC
3450set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
3451 gdbarch_deprecated_store_struct_return_ftype deprecated_store_struct_return)
0f71a2f6 3452{
4183d812 3453 gdbarch->deprecated_store_struct_return = deprecated_store_struct_return;
0f71a2f6
JM
3454}
3455
92ad9cd9
AC
3456int
3457gdbarch_return_value_p (struct gdbarch *gdbarch)
3458{
3459 gdb_assert (gdbarch != NULL);
750eb019 3460 return gdbarch->return_value != legacy_return_value;
92ad9cd9
AC
3461}
3462
3463enum return_value_convention
963e2bb7 3464gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf)
92ad9cd9
AC
3465{
3466 gdb_assert (gdbarch != NULL);
3467 gdb_assert (gdbarch->return_value != NULL);
750eb019 3468 /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call. */
92ad9cd9
AC
3469 if (gdbarch_debug >= 2)
3470 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
963e2bb7 3471 return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
92ad9cd9
AC
3472}
3473
3474void
3475set_gdbarch_return_value (struct gdbarch *gdbarch,
3476 gdbarch_return_value_ftype return_value)
3477{
3478 gdbarch->return_value = return_value;
3479}
3480
0f71a2f6 3481void
ebba8386
AC
3482gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
3483{
3484 gdb_assert (gdbarch != NULL);
956ac328 3485 gdb_assert (gdbarch->extract_return_value != NULL);
ebba8386
AC
3486 if (gdbarch_debug >= 2)
3487 fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
3488 gdbarch->extract_return_value (type, regcache, valbuf);
3489}
3490
3491void
3492set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
3493 gdbarch_extract_return_value_ftype extract_return_value)
3494{
3495 gdbarch->extract_return_value = extract_return_value;
3496}
3497
3498void
3499gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
0f71a2f6 3500{
8de9bdc4 3501 gdb_assert (gdbarch != NULL);
956ac328 3502 gdb_assert (gdbarch->store_return_value != NULL);
0f71a2f6 3503 if (gdbarch_debug >= 2)
0f71a2f6 3504 fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
ebba8386 3505 gdbarch->store_return_value (type, regcache, valbuf);
0f71a2f6
JM
3506}
3507
3508void
104c1213
JM
3509set_gdbarch_store_return_value (struct gdbarch *gdbarch,
3510 gdbarch_store_return_value_ftype store_return_value)
0f71a2f6
JM
3511{
3512 gdbarch->store_return_value = store_return_value;
3513}
3514
ebba8386
AC
3515void
3516gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
3517{
3518 gdb_assert (gdbarch != NULL);
956ac328 3519 gdb_assert (gdbarch->deprecated_extract_return_value != NULL);
ebba8386
AC
3520 if (gdbarch_debug >= 2)
3521 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
3522 gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
3523}
3524
3525void
3526set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
3527 gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
3528{
3529 gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
3530}
3531
3532void
3533gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
3534{
3535 gdb_assert (gdbarch != NULL);
956ac328 3536 gdb_assert (gdbarch->deprecated_store_return_value != NULL);
ebba8386
AC
3537 if (gdbarch_debug >= 2)
3538 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
3539 gdbarch->deprecated_store_return_value (type, valbuf);
3540}
3541
3542void
3543set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
3544 gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
3545{
3546 gdbarch->deprecated_store_return_value = deprecated_store_return_value;
3547}
3548
92ad9cd9 3549int
b5622e8d 3550gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
92ad9cd9
AC
3551{
3552 gdb_assert (gdbarch != NULL);
b5622e8d 3553 gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
92ad9cd9 3554 if (gdbarch_debug >= 2)
b5622e8d
AC
3555 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
3556 return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
92ad9cd9
AC
3557}
3558
3559void
b5622e8d
AC
3560set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
3561 gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
92ad9cd9 3562{
b5622e8d 3563 gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
92ad9cd9
AC
3564}
3565
049ee0e4 3566int
74055713 3567gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch)
049ee0e4
AC
3568{
3569 gdb_assert (gdbarch != NULL);
74055713 3570 return gdbarch->deprecated_extract_struct_value_address != NULL;
049ee0e4
AC
3571}
3572
3573CORE_ADDR
74055713 3574gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
049ee0e4
AC
3575{
3576 gdb_assert (gdbarch != NULL);
74055713 3577 gdb_assert (gdbarch->deprecated_extract_struct_value_address != NULL);
049ee0e4 3578 if (gdbarch_debug >= 2)
74055713
AC
3579 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_struct_value_address called\n");
3580 return gdbarch->deprecated_extract_struct_value_address (regcache);
049ee0e4
AC
3581}
3582
3583void
74055713
AC
3584set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch,
3585 gdbarch_deprecated_extract_struct_value_address_ftype deprecated_extract_struct_value_address)
049ee0e4 3586{
74055713 3587 gdbarch->deprecated_extract_struct_value_address = deprecated_extract_struct_value_address;
049ee0e4
AC
3588}
3589
8f871025 3590int
f30ee0bc 3591gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch)
8f871025
AC
3592{
3593 gdb_assert (gdbarch != NULL);
956ac328 3594 return gdbarch->deprecated_frame_init_saved_regs != NULL;
8f871025
AC
3595}
3596
0f71a2f6 3597void
f30ee0bc 3598gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
0f71a2f6 3599{
8de9bdc4 3600 gdb_assert (gdbarch != NULL);
956ac328 3601 gdb_assert (gdbarch->deprecated_frame_init_saved_regs != NULL);
0f71a2f6 3602 if (gdbarch_debug >= 2)
f30ee0bc
AC
3603 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_init_saved_regs called\n");
3604 gdbarch->deprecated_frame_init_saved_regs (frame);
0f71a2f6
JM
3605}
3606
3607void
f30ee0bc
AC
3608set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch,
3609 gdbarch_deprecated_frame_init_saved_regs_ftype deprecated_frame_init_saved_regs)
0f71a2f6 3610{
f30ee0bc 3611 gdbarch->deprecated_frame_init_saved_regs = deprecated_frame_init_saved_regs;
0f71a2f6
JM
3612}
3613
5fdff426 3614int
e9582e71 3615gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch)
5fdff426 3616{
8de9bdc4 3617 gdb_assert (gdbarch != NULL);
956ac328 3618 return gdbarch->deprecated_init_extra_frame_info != NULL;
5fdff426
AC
3619}
3620
0f71a2f6 3621void
e9582e71 3622gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
0f71a2f6 3623{
8de9bdc4 3624 gdb_assert (gdbarch != NULL);
956ac328 3625 gdb_assert (gdbarch->deprecated_init_extra_frame_info != NULL);
0f71a2f6 3626 if (gdbarch_debug >= 2)
e9582e71
AC
3627 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_extra_frame_info called\n");
3628 gdbarch->deprecated_init_extra_frame_info (fromleaf, frame);
0f71a2f6
JM
3629}
3630
3631void
e9582e71
AC
3632set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch,
3633 gdbarch_deprecated_init_extra_frame_info_ftype deprecated_init_extra_frame_info)
0f71a2f6 3634{
e9582e71 3635 gdbarch->deprecated_init_extra_frame_info = deprecated_init_extra_frame_info;
0f71a2f6
JM
3636}
3637
3638CORE_ADDR
3639gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
3640{
8de9bdc4 3641 gdb_assert (gdbarch != NULL);
956ac328 3642 gdb_assert (gdbarch->skip_prologue != NULL);
0f71a2f6 3643 if (gdbarch_debug >= 2)
0f71a2f6
JM
3644 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
3645 return gdbarch->skip_prologue (ip);
3646}
3647
3648void
104c1213
JM
3649set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
3650 gdbarch_skip_prologue_ftype skip_prologue)
0f71a2f6
JM
3651{
3652 gdbarch->skip_prologue = skip_prologue;
3653}
3654
3655int
3656gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
3657{
8de9bdc4 3658 gdb_assert (gdbarch != NULL);
956ac328 3659 gdb_assert (gdbarch->inner_than != NULL);
0f71a2f6 3660 if (gdbarch_debug >= 2)
0f71a2f6
JM
3661 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
3662 return gdbarch->inner_than (lhs, rhs);
3663}
3664
3665void
104c1213
JM
3666set_gdbarch_inner_than (struct gdbarch *gdbarch,
3667 gdbarch_inner_than_ftype inner_than)
0f71a2f6
JM
3668{
3669 gdbarch->inner_than = inner_than;
3670}
3671
f4f9705a 3672const unsigned char *
adf40b2e 3673gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
0f71a2f6 3674{
8de9bdc4 3675 gdb_assert (gdbarch != NULL);
956ac328 3676 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
0f71a2f6 3677 if (gdbarch_debug >= 2)
0f71a2f6
JM
3678 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
3679 return gdbarch->breakpoint_from_pc (pcptr, lenptr);
3680}
3681
3682void
104c1213
JM
3683set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
3684 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
0f71a2f6
JM
3685{
3686 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
3687}
3688
a1131521
KB
3689int
3690gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
3691{
3692 gdb_assert (gdbarch != NULL);
3693 return gdbarch->adjust_breakpoint_address != NULL;
3694}
3695
3696CORE_ADDR
3697gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
3698{
3699 gdb_assert (gdbarch != NULL);
3700 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
3701 if (gdbarch_debug >= 2)
3702 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
3703 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
3704}
3705
3706void
3707set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
3708 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
3709{
3710 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
3711}
3712
917317f4
JM
3713int
3714gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3715{
8de9bdc4 3716 gdb_assert (gdbarch != NULL);
956ac328 3717 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
917317f4 3718 if (gdbarch_debug >= 2)
917317f4
JM
3719 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
3720 return gdbarch->memory_insert_breakpoint (addr, contents_cache);
3721}
3722
3723void
3724set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
3725 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
3726{
3727 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
3728}
3729
3730int
3731gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
3732{
8de9bdc4 3733 gdb_assert (gdbarch != NULL);
956ac328 3734 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
917317f4 3735 if (gdbarch_debug >= 2)
917317f4
JM
3736 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
3737 return gdbarch->memory_remove_breakpoint (addr, contents_cache);
3738}
3739
3740void
3741set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
3742 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
3743{
3744 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
3745}
3746
0f71a2f6 3747CORE_ADDR
104c1213 3748gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
0f71a2f6 3749{
8de9bdc4 3750 gdb_assert (gdbarch != NULL);
71bd6bd4 3751 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
0f71a2f6 3752 if (gdbarch_debug >= 2)
0f71a2f6
JM
3753 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
3754 return gdbarch->decr_pc_after_break;
3755}
3756
3757void
104c1213
JM
3758set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
3759 CORE_ADDR decr_pc_after_break)
0f71a2f6
JM
3760{
3761 gdbarch->decr_pc_after_break = decr_pc_after_break;
3762}
3763
3764CORE_ADDR
782263ab 3765gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
0f71a2f6 3766{
8de9bdc4 3767 gdb_assert (gdbarch != NULL);
782263ab 3768 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
0f71a2f6 3769 if (gdbarch_debug >= 2)
782263ab
AC
3770 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
3771 return gdbarch->deprecated_function_start_offset;
0f71a2f6
JM
3772}
3773
3774void
782263ab
AC
3775set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
3776 CORE_ADDR deprecated_function_start_offset)
0f71a2f6 3777{
782263ab 3778 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
0f71a2f6
JM
3779}
3780
3781void
f6684c31 3782gdbarch_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 3783{
8de9bdc4 3784 gdb_assert (gdbarch != NULL);
956ac328 3785 gdb_assert (gdbarch->remote_translate_xfer_address != NULL);
0f71a2f6 3786 if (gdbarch_debug >= 2)
0f71a2f6 3787 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n");
f6684c31 3788 gdbarch->remote_translate_xfer_address (gdbarch, regcache, gdb_addr, gdb_len, rem_addr, rem_len);
0f71a2f6
JM
3789}
3790
3791void
104c1213
JM
3792set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
3793 gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address)
0f71a2f6
JM
3794{
3795 gdbarch->remote_translate_xfer_address = remote_translate_xfer_address;
3796}
3797
3798CORE_ADDR
104c1213 3799gdbarch_frame_args_skip (struct gdbarch *gdbarch)
0f71a2f6 3800{
8de9bdc4 3801 gdb_assert (gdbarch != NULL);
5867a2fb 3802 /* Skip verify of frame_args_skip, invalid_p == 0 */
0f71a2f6 3803 if (gdbarch_debug >= 2)
0f71a2f6
JM
3804 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
3805 return gdbarch->frame_args_skip;
3806}
3807
3808void
104c1213
JM
3809set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
3810 CORE_ADDR frame_args_skip)
0f71a2f6
JM
3811{
3812 gdbarch->frame_args_skip = frame_args_skip;
3813}
3814
3815int
19772a2c
AC
3816gdbarch_deprecated_frameless_function_invocation_p (struct gdbarch *gdbarch)
3817{
3818 gdb_assert (gdbarch != NULL);
3819 return gdbarch->deprecated_frameless_function_invocation != NULL;
3820}
3821
3822int
3823gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
0f71a2f6 3824{
8de9bdc4 3825 gdb_assert (gdbarch != NULL);
19772a2c 3826 gdb_assert (gdbarch->deprecated_frameless_function_invocation != NULL);
0f71a2f6 3827 if (gdbarch_debug >= 2)
19772a2c
AC
3828 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frameless_function_invocation called\n");
3829 return gdbarch->deprecated_frameless_function_invocation (fi);
0f71a2f6
JM
3830}
3831
3832void
19772a2c
AC
3833set_gdbarch_deprecated_frameless_function_invocation (struct gdbarch *gdbarch,
3834 gdbarch_deprecated_frameless_function_invocation_ftype deprecated_frameless_function_invocation)
0f71a2f6 3835{
19772a2c 3836 gdbarch->deprecated_frameless_function_invocation = deprecated_frameless_function_invocation;
0f71a2f6
JM
3837}
3838
d62d1979 3839int
618ce49f 3840gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch)
d62d1979
AC
3841{
3842 gdb_assert (gdbarch != NULL);
956ac328 3843 return gdbarch->deprecated_frame_chain != NULL;
d62d1979
AC
3844}
3845
0f71a2f6 3846CORE_ADDR
618ce49f 3847gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
0f71a2f6 3848{
8de9bdc4 3849 gdb_assert (gdbarch != NULL);
956ac328 3850 gdb_assert (gdbarch->deprecated_frame_chain != NULL);
0f71a2f6 3851 if (gdbarch_debug >= 2)
618ce49f
AC
3852 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain called\n");
3853 return gdbarch->deprecated_frame_chain (frame);
0f71a2f6
JM
3854}
3855
3856void
618ce49f
AC
3857set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch,
3858 gdbarch_deprecated_frame_chain_ftype deprecated_frame_chain)
0f71a2f6 3859{
618ce49f 3860 gdbarch->deprecated_frame_chain = deprecated_frame_chain;
0f71a2f6
JM
3861}
3862
51603483 3863int
618ce49f 3864gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch)
51603483
DJ
3865{
3866 gdb_assert (gdbarch != NULL);
956ac328 3867 return gdbarch->deprecated_frame_chain_valid != NULL;
51603483
DJ
3868}
3869
0f71a2f6 3870int
618ce49f 3871gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
0f71a2f6 3872{
8de9bdc4 3873 gdb_assert (gdbarch != NULL);
956ac328 3874 gdb_assert (gdbarch->deprecated_frame_chain_valid != NULL);
0f71a2f6 3875 if (gdbarch_debug >= 2)
618ce49f
AC
3876 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_chain_valid called\n");
3877 return gdbarch->deprecated_frame_chain_valid (chain, thisframe);
0f71a2f6
JM
3878}
3879
3880void
618ce49f
AC
3881set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch,
3882 gdbarch_deprecated_frame_chain_valid_ftype deprecated_frame_chain_valid)
0f71a2f6 3883{
618ce49f 3884 gdbarch->deprecated_frame_chain_valid = deprecated_frame_chain_valid;
0f71a2f6
JM
3885}
3886
d62d1979 3887int
8bedc050 3888gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch)
d62d1979
AC
3889{
3890 gdb_assert (gdbarch != NULL);
956ac328 3891 return gdbarch->deprecated_frame_saved_pc != NULL;
d62d1979
AC
3892}
3893
0f71a2f6 3894CORE_ADDR
8bedc050 3895gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
0f71a2f6 3896{
8de9bdc4 3897 gdb_assert (gdbarch != NULL);
956ac328 3898 gdb_assert (gdbarch->deprecated_frame_saved_pc != NULL);
0f71a2f6 3899 if (gdbarch_debug >= 2)
8bedc050
AC
3900 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n");
3901 return gdbarch->deprecated_frame_saved_pc (fi);
0f71a2f6
JM
3902}
3903
3904void
8bedc050
AC
3905set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch,
3906 gdbarch_deprecated_frame_saved_pc_ftype deprecated_frame_saved_pc)
0f71a2f6 3907{
8bedc050 3908 gdbarch->deprecated_frame_saved_pc = deprecated_frame_saved_pc;
0f71a2f6
JM
3909}
3910
12cc2063
AC
3911int
3912gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
3913{
3914 gdb_assert (gdbarch != NULL);
956ac328 3915 return gdbarch->unwind_pc != NULL;
12cc2063
AC
3916}
3917
3918CORE_ADDR
3919gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
3920{
3921 gdb_assert (gdbarch != NULL);
956ac328 3922 gdb_assert (gdbarch->unwind_pc != NULL);
12cc2063
AC
3923 if (gdbarch_debug >= 2)
3924 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
3925 return gdbarch->unwind_pc (gdbarch, next_frame);
3926}
3927
3928void
3929set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
3930 gdbarch_unwind_pc_ftype unwind_pc)
3931{
3932 gdbarch->unwind_pc = unwind_pc;
3933}
3934
a9e5fdc2
AC
3935int
3936gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
3937{
3938 gdb_assert (gdbarch != NULL);
956ac328 3939 return gdbarch->unwind_sp != NULL;
a9e5fdc2
AC
3940}
3941
3942CORE_ADDR
3943gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
3944{
3945 gdb_assert (gdbarch != NULL);
956ac328 3946 gdb_assert (gdbarch->unwind_sp != NULL);
a9e5fdc2
AC
3947 if (gdbarch_debug >= 2)
3948 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
3949 return gdbarch->unwind_sp (gdbarch, next_frame);
3950}
3951
3952void
3953set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
3954 gdbarch_unwind_sp_ftype unwind_sp)
3955{
3956 gdbarch->unwind_sp = unwind_sp;
3957}
3958
42efa47a
AC
3959int
3960gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch)
3961{
3962 gdb_assert (gdbarch != NULL);
3963 return gdbarch->deprecated_frame_args_address != get_frame_base;
3964}
3965
0f71a2f6 3966CORE_ADDR
42efa47a 3967gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
0f71a2f6 3968{
8de9bdc4 3969 gdb_assert (gdbarch != NULL);
956ac328
AC
3970 gdb_assert (gdbarch->deprecated_frame_args_address != NULL);
3971 /* Do not check predicate: gdbarch->deprecated_frame_args_address != get_frame_base, allow call. */
0f71a2f6 3972 if (gdbarch_debug >= 2)
42efa47a
AC
3973 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_args_address called\n");
3974 return gdbarch->deprecated_frame_args_address (fi);
0f71a2f6
JM
3975}
3976
3977void
42efa47a
AC
3978set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch,
3979 gdbarch_deprecated_frame_args_address_ftype deprecated_frame_args_address)
0f71a2f6 3980{
42efa47a
AC
3981 gdbarch->deprecated_frame_args_address = deprecated_frame_args_address;
3982}
3983
3984int
3985gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch)
3986{
3987 gdb_assert (gdbarch != NULL);
3988 return gdbarch->deprecated_frame_locals_address != get_frame_base;
0f71a2f6
JM
3989}
3990
3991CORE_ADDR
42efa47a 3992gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
0f71a2f6 3993{
8de9bdc4 3994 gdb_assert (gdbarch != NULL);
956ac328
AC
3995 gdb_assert (gdbarch->deprecated_frame_locals_address != NULL);
3996 /* Do not check predicate: gdbarch->deprecated_frame_locals_address != get_frame_base, allow call. */
0f71a2f6 3997 if (gdbarch_debug >= 2)
42efa47a
AC
3998 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_locals_address called\n");
3999 return gdbarch->deprecated_frame_locals_address (fi);
0f71a2f6
JM
4000}
4001
4002void
42efa47a
AC
4003set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch,
4004 gdbarch_deprecated_frame_locals_address_ftype deprecated_frame_locals_address)
0f71a2f6 4005{
42efa47a 4006 gdbarch->deprecated_frame_locals_address = deprecated_frame_locals_address;
0f71a2f6
JM
4007}
4008
4443bd83 4009int
6913c89a 4010gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch)
4443bd83
AC
4011{
4012 gdb_assert (gdbarch != NULL);
956ac328 4013 return gdbarch->deprecated_saved_pc_after_call != NULL;
4443bd83
AC
4014}
4015
0f71a2f6 4016CORE_ADDR
6913c89a 4017gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
0f71a2f6 4018{
8de9bdc4 4019 gdb_assert (gdbarch != NULL);
956ac328 4020 gdb_assert (gdbarch->deprecated_saved_pc_after_call != NULL);
0f71a2f6 4021 if (gdbarch_debug >= 2)
6913c89a
AC
4022 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_saved_pc_after_call called\n");
4023 return gdbarch->deprecated_saved_pc_after_call (frame);
0f71a2f6
JM
4024}
4025
4026void
6913c89a
AC
4027set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
4028 gdbarch_deprecated_saved_pc_after_call_ftype deprecated_saved_pc_after_call)
0f71a2f6 4029{
6913c89a 4030 gdbarch->deprecated_saved_pc_after_call = deprecated_saved_pc_after_call;
0f71a2f6
JM
4031}
4032
983a287a
AC
4033int
4034gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
4035{
4036 gdb_assert (gdbarch != NULL);
956ac328 4037 return gdbarch->frame_num_args != NULL;
983a287a
AC
4038}
4039
0f71a2f6
JM
4040int
4041gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
4042{
8de9bdc4 4043 gdb_assert (gdbarch != NULL);
956ac328 4044 gdb_assert (gdbarch->frame_num_args != NULL);
0f71a2f6 4045 if (gdbarch_debug >= 2)
0f71a2f6
JM
4046 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
4047 return gdbarch->frame_num_args (frame);
4048}
4049
4050void
104c1213
JM
4051set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
4052 gdbarch_frame_num_args_ftype frame_num_args)
0f71a2f6
JM
4053{
4054 gdbarch->frame_num_args = frame_num_args;
4055}
4056
2ada493a 4057int
f27dd7fd 4058gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
2ada493a 4059{
8de9bdc4 4060 gdb_assert (gdbarch != NULL);
f27dd7fd 4061 return gdbarch->deprecated_stack_align != NULL;
2ada493a
AC
4062}
4063
4064CORE_ADDR
f27dd7fd 4065gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
2ada493a 4066{
8de9bdc4 4067 gdb_assert (gdbarch != NULL);
f27dd7fd 4068 gdb_assert (gdbarch->deprecated_stack_align != NULL);
2ada493a 4069 if (gdbarch_debug >= 2)
f27dd7fd
AC
4070 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
4071 return gdbarch->deprecated_stack_align (sp);
2ada493a
AC
4072}
4073
4074void
f27dd7fd
AC
4075set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
4076 gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
2ada493a 4077{
f27dd7fd 4078 gdbarch->deprecated_stack_align = deprecated_stack_align;
2ada493a
AC
4079}
4080
dc604539
AC
4081int
4082gdbarch_frame_align_p (struct gdbarch *gdbarch)
4083{
4084 gdb_assert (gdbarch != NULL);
956ac328 4085 return gdbarch->frame_align != NULL;
dc604539
AC
4086}
4087
4088CORE_ADDR
4089gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
4090{
4091 gdb_assert (gdbarch != NULL);
956ac328 4092 gdb_assert (gdbarch->frame_align != NULL);
dc604539
AC
4093 if (gdbarch_debug >= 2)
4094 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
4095 return gdbarch->frame_align (gdbarch, address);
4096}
4097
4098void
4099set_gdbarch_frame_align (struct gdbarch *gdbarch,
4100 gdbarch_frame_align_ftype frame_align)
4101{
4102 gdbarch->frame_align = frame_align;
4103}
4104
d03e67c9 4105int
88d89dbb 4106gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
d03e67c9 4107{
8de9bdc4 4108 gdb_assert (gdbarch != NULL);
88d89dbb 4109 return gdbarch->deprecated_reg_struct_has_addr != NULL;
d03e67c9
AC
4110}
4111
4112int
88d89dbb 4113gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
d03e67c9 4114{
8de9bdc4 4115 gdb_assert (gdbarch != NULL);
88d89dbb 4116 gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
d03e67c9 4117 if (gdbarch_debug >= 2)
88d89dbb
MK
4118 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
4119 return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
d03e67c9
AC
4120}
4121
4122void
88d89dbb
MK
4123set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
4124 gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
d03e67c9 4125{
88d89dbb 4126 gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
d03e67c9
AC
4127}
4128
192cb3d4
MK
4129int
4130gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
4131{
4132 gdb_assert (gdbarch != NULL);
4133 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
4134 if (gdbarch_debug >= 2)
4135 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
4136 return gdbarch->stabs_argument_has_addr (gdbarch, type);
4137}
4138
4139void
4140set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
4141 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
4142{
4143 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
4144}
4145
8b148df9
AC
4146int
4147gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
4148{
4149 gdb_assert (gdbarch != NULL);
4150 if (gdbarch_debug >= 2)
4151 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
4152 return gdbarch->frame_red_zone_size;
4153}
4154
4155void
4156set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
4157 int frame_red_zone_size)
4158{
4159 gdbarch->frame_red_zone_size = frame_red_zone_size;
4160}
4161
f0d4cc9e
AC
4162const struct floatformat *
4163gdbarch_float_format (struct gdbarch *gdbarch)
4164{
8de9bdc4 4165 gdb_assert (gdbarch != NULL);
f0d4cc9e
AC
4166 if (gdbarch_debug >= 2)
4167 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
4168 return gdbarch->float_format;
4169}
4170
4171void
4172set_gdbarch_float_format (struct gdbarch *gdbarch,
4173 const struct floatformat * float_format)
4174{
4175 gdbarch->float_format = float_format;
4176}
4177
4178const struct floatformat *
4179gdbarch_double_format (struct gdbarch *gdbarch)
4180{
8de9bdc4 4181 gdb_assert (gdbarch != NULL);
f0d4cc9e
AC
4182 if (gdbarch_debug >= 2)
4183 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
4184 return gdbarch->double_format;
4185}
4186
4187void
4188set_gdbarch_double_format (struct gdbarch *gdbarch,
4189 const struct floatformat * double_format)
4190{
4191 gdbarch->double_format = double_format;
4192}
4193
4194const struct floatformat *
4195gdbarch_long_double_format (struct gdbarch *gdbarch)
4196{
8de9bdc4 4197 gdb_assert (gdbarch != NULL);
f0d4cc9e
AC
4198 if (gdbarch_debug >= 2)
4199 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
4200 return gdbarch->long_double_format;
4201}
4202
4203void
4204set_gdbarch_long_double_format (struct gdbarch *gdbarch,
4205 const struct floatformat * long_double_format)
4206{
4207 gdbarch->long_double_format = long_double_format;
4208}
4209
f517ea4e 4210CORE_ADDR
e2d0e7eb 4211gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
f517ea4e 4212{
8de9bdc4 4213 gdb_assert (gdbarch != NULL);
956ac328 4214 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
f517ea4e
PS
4215 if (gdbarch_debug >= 2)
4216 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
e2d0e7eb 4217 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
f517ea4e
PS
4218}
4219
4220void
4221set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
4222 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
4223{
4224 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
4225}
4226
875e1767
AC
4227CORE_ADDR
4228gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
4229{
8de9bdc4 4230 gdb_assert (gdbarch != NULL);
956ac328 4231 gdb_assert (gdbarch->addr_bits_remove != NULL);
875e1767
AC
4232 if (gdbarch_debug >= 2)
4233 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
4234 return gdbarch->addr_bits_remove (addr);
4235}
4236
4237void
4238set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
4239 gdbarch_addr_bits_remove_ftype addr_bits_remove)
4240{
4241 gdbarch->addr_bits_remove = addr_bits_remove;
4242}
4243
181c1381
RE
4244CORE_ADDR
4245gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
4246{
8de9bdc4 4247 gdb_assert (gdbarch != NULL);
956ac328 4248 gdb_assert (gdbarch->smash_text_address != NULL);
181c1381
RE
4249 if (gdbarch_debug >= 2)
4250 fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
4251 return gdbarch->smash_text_address (addr);
4252}
4253
4254void
4255set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
4256 gdbarch_smash_text_address_ftype smash_text_address)
4257{
4258 gdbarch->smash_text_address = smash_text_address;
4259}
4260
64c4637f
AC
4261int
4262gdbarch_software_single_step_p (struct gdbarch *gdbarch)
4263{
8de9bdc4 4264 gdb_assert (gdbarch != NULL);
956ac328 4265 return gdbarch->software_single_step != NULL;
64c4637f
AC
4266}
4267
4268void
4269gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
4270{
8de9bdc4 4271 gdb_assert (gdbarch != NULL);
956ac328 4272 gdb_assert (gdbarch->software_single_step != NULL);
64c4637f
AC
4273 if (gdbarch_debug >= 2)
4274 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
4275 gdbarch->software_single_step (sig, insert_breakpoints_p);
4276}
4277
4278void
4279set_gdbarch_software_single_step (struct gdbarch *gdbarch,
4280 gdbarch_software_single_step_ftype software_single_step)
4281{
4282 gdbarch->software_single_step = software_single_step;
4283}
4284
2bf0cb65 4285int
a89aa300 4286gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2bf0cb65 4287{
8de9bdc4 4288 gdb_assert (gdbarch != NULL);
956ac328 4289 gdb_assert (gdbarch->print_insn != NULL);
2bf0cb65
EZ
4290 if (gdbarch_debug >= 2)
4291 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
4292 return gdbarch->print_insn (vma, info);
4293}
4294
4295void
4296set_gdbarch_print_insn (struct gdbarch *gdbarch,
4297 gdbarch_print_insn_ftype print_insn)
4298{
4299 gdbarch->print_insn = print_insn;
4300}
4301
bdcd319a
CV
4302CORE_ADDR
4303gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
4304{
8de9bdc4 4305 gdb_assert (gdbarch != NULL);
956ac328 4306 gdb_assert (gdbarch->skip_trampoline_code != NULL);
bdcd319a
CV
4307 if (gdbarch_debug >= 2)
4308 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
4309 return gdbarch->skip_trampoline_code (pc);
4310}
4311
4312void
4313set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
4314 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
4315{
4316 gdbarch->skip_trampoline_code = skip_trampoline_code;
4317}
4318
dea0c52f
MK
4319CORE_ADDR
4320gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
4321{
4322 gdb_assert (gdbarch != NULL);
4323 gdb_assert (gdbarch->skip_solib_resolver != NULL);
4324 if (gdbarch_debug >= 2)
4325 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
4c8c40e6 4326 return gdbarch->skip_solib_resolver (gdbarch, pc);
dea0c52f
MK
4327}
4328
4329void
4330set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
4331 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
4332{
4333 gdbarch->skip_solib_resolver = skip_solib_resolver;
4334}
4335
68e9cc94
CV
4336int
4337gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4338{
8de9bdc4 4339 gdb_assert (gdbarch != NULL);
956ac328 4340 gdb_assert (gdbarch->in_solib_call_trampoline != NULL);
68e9cc94
CV
4341 if (gdbarch_debug >= 2)
4342 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
4343 return gdbarch->in_solib_call_trampoline (pc, name);
4344}
4345
4346void
4347set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
4348 gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
4349{
4350 gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
4351}
4352
d50355b6
MS
4353int
4354gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
4355{
4356 gdb_assert (gdbarch != NULL);
956ac328 4357 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
d50355b6
MS
4358 if (gdbarch_debug >= 2)
4359 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
4360 return gdbarch->in_solib_return_trampoline (pc, name);
4361}
4362
4363void
4364set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
4365 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
4366{
4367 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
4368}
4369
c12260ac
CV
4370int
4371gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
4372{
8de9bdc4 4373 gdb_assert (gdbarch != NULL);
956ac328 4374 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
c12260ac
CV
4375 if (gdbarch_debug >= 2)
4376 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
4377 return gdbarch->in_function_epilogue_p (gdbarch, addr);
4378}
4379
4380void
4381set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
4382 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
4383{
4384 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
4385}
4386
552c04a7
TT
4387char *
4388gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
4389{
8de9bdc4 4390 gdb_assert (gdbarch != NULL);
956ac328 4391 gdb_assert (gdbarch->construct_inferior_arguments != NULL);
552c04a7
TT
4392 if (gdbarch_debug >= 2)
4393 fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
4394 return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
4395}
4396
4397void
4398set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
4399 gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
4400{
4401 gdbarch->construct_inferior_arguments = construct_inferior_arguments;
4402}
4403
a2cf933a
EZ
4404void
4405gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
4406{
8de9bdc4 4407 gdb_assert (gdbarch != NULL);
956ac328 4408 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
a2cf933a
EZ
4409 if (gdbarch_debug >= 2)
4410 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
4411 gdbarch->elf_make_msymbol_special (sym, msym);
4412}
4413
4414void
4415set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
4416 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
4417{
4418 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
4419}
4420
4421void
4422gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
4423{
8de9bdc4 4424 gdb_assert (gdbarch != NULL);
956ac328 4425 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
a2cf933a
EZ
4426 if (gdbarch_debug >= 2)
4427 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
4428 gdbarch->coff_make_msymbol_special (val, msym);
4429}
4430
4431void
4432set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
4433 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
4434{
4435 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
4436}
4437
5720643c
JB
4438const char *
4439gdbarch_name_of_malloc (struct gdbarch *gdbarch)
4440{
4441 gdb_assert (gdbarch != NULL);
4442 /* Skip verify of name_of_malloc, invalid_p == 0 */
4443 if (gdbarch_debug >= 2)
4444 fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
4445 return gdbarch->name_of_malloc;
4446}
4447
4448void
4449set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
4450 const char * name_of_malloc)
4451{
4452 gdbarch->name_of_malloc = name_of_malloc;
4453}
4454
c4ed33b9
AC
4455int
4456gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
4457{
4458 gdb_assert (gdbarch != NULL);
4459 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
4460 if (gdbarch_debug >= 2)
4461 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
4462 return gdbarch->cannot_step_breakpoint;
4463}
4464
4465void
4466set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
4467 int cannot_step_breakpoint)
4468{
4469 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
4470}
4471
f74fa174
MM
4472int
4473gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
4474{
4475 gdb_assert (gdbarch != NULL);
4476 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
4477 if (gdbarch_debug >= 2)
4478 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
4479 return gdbarch->have_nonsteppable_watchpoint;
4480}
4481
4482void
4483set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
967c0d83 4484 int have_nonsteppable_watchpoint)
f74fa174
MM
4485{
4486 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
4487}
4488
8b2dbe47
KB
4489int
4490gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
4491{
4492 gdb_assert (gdbarch != NULL);
956ac328 4493 return gdbarch->address_class_type_flags != NULL;
8b2dbe47
KB
4494}
4495
4496int
4497gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
4498{
4499 gdb_assert (gdbarch != NULL);
956ac328 4500 gdb_assert (gdbarch->address_class_type_flags != NULL);
8b2dbe47
KB
4501 if (gdbarch_debug >= 2)
4502 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
4503 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
4504}
4505
4506void
4507set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
4508 gdbarch_address_class_type_flags_ftype address_class_type_flags)
4509{
4510 gdbarch->address_class_type_flags = address_class_type_flags;
4511}
4512
4513int
4514gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
4515{
4516 gdb_assert (gdbarch != NULL);
956ac328 4517 return gdbarch->address_class_type_flags_to_name != NULL;
8b2dbe47
KB
4518}
4519
321432c0 4520const char *
8b2dbe47
KB
4521gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
4522{
4523 gdb_assert (gdbarch != NULL);
956ac328 4524 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
8b2dbe47
KB
4525 if (gdbarch_debug >= 2)
4526 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
5f11f355 4527 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
8b2dbe47
KB
4528}
4529
4530void
4531set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
4532 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
4533{
4534 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
4535}
4536
4537int
4538gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
4539{
4540 gdb_assert (gdbarch != NULL);
956ac328 4541 return gdbarch->address_class_name_to_type_flags != NULL;
8b2dbe47
KB
4542}
4543
4544int
321432c0 4545gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
8b2dbe47
KB
4546{
4547 gdb_assert (gdbarch != NULL);
956ac328 4548 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
8b2dbe47
KB
4549 if (gdbarch_debug >= 2)
4550 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
5f11f355 4551 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
8b2dbe47
KB
4552}
4553
4554void
4555set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
4556 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
4557{
4558 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
4559}
4560
b59ff9d5
AC
4561int
4562gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
4563{
4564 gdb_assert (gdbarch != NULL);
956ac328 4565 gdb_assert (gdbarch->register_reggroup_p != NULL);
b59ff9d5
AC
4566 if (gdbarch_debug >= 2)
4567 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
4568 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
4569}
4570
4571void
4572set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
4573 gdbarch_register_reggroup_p_ftype register_reggroup_p)
4574{
4575 gdbarch->register_reggroup_p = register_reggroup_p;
4576}
4577
143985b7
AF
4578int
4579gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
4580{
4581 gdb_assert (gdbarch != NULL);
956ac328 4582 return gdbarch->fetch_pointer_argument != NULL;
143985b7
AF
4583}
4584
4585CORE_ADDR
4586gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
4587{
4588 gdb_assert (gdbarch != NULL);
956ac328 4589 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
143985b7
AF
4590 if (gdbarch_debug >= 2)
4591 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
4592 return gdbarch->fetch_pointer_argument (frame, argi, type);
4593}
4594
4595void
4596set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
4597 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
4598{
4599 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
4600}
4601
6ce6d90f
MK
4602int
4603gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
4604{
4605 gdb_assert (gdbarch != NULL);
4606 return gdbarch->regset_from_core_section != NULL;
4607}
4608
4609const struct regset *
4610gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
4611{
4612 gdb_assert (gdbarch != NULL);
4613 gdb_assert (gdbarch->regset_from_core_section != NULL);
4614 if (gdbarch_debug >= 2)
4615 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
4616 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
4617}
4618
4619void
4620set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
4621 gdbarch_regset_from_core_section_ftype regset_from_core_section)
4622{
4623 gdbarch->regset_from_core_section = regset_from_core_section;
4624}
4625
0f71a2f6 4626
be5a57e1 4627/* Keep a registry of per-architecture data-pointers required by GDB
0f71a2f6
JM
4628 modules. */
4629
4630struct gdbarch_data
4631{
95160752 4632 unsigned index;
76860b5f 4633 int init_p;
030f20e1
AC
4634 gdbarch_data_pre_init_ftype *pre_init;
4635 gdbarch_data_post_init_ftype *post_init;
0f71a2f6
JM
4636};
4637
4638struct gdbarch_data_registration
adf40b2e 4639{
adf40b2e
JM
4640 struct gdbarch_data *data;
4641 struct gdbarch_data_registration *next;
4642};
0f71a2f6 4643
be5a57e1 4644struct gdbarch_data_registry
adf40b2e 4645{
95160752 4646 unsigned nr;
adf40b2e
JM
4647 struct gdbarch_data_registration *registrations;
4648};
0f71a2f6 4649
be5a57e1 4650struct gdbarch_data_registry gdbarch_data_registry =
0f71a2f6
JM
4651{
4652 0, NULL,
4653};
4654
030f20e1
AC
4655static struct gdbarch_data *
4656gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4657 gdbarch_data_post_init_ftype *post_init)
0f71a2f6
JM
4658{
4659 struct gdbarch_data_registration **curr;
76860b5f 4660 /* Append the new registraration. */
be5a57e1 4661 for (curr = &gdbarch_data_registry.registrations;
0f71a2f6
JM
4662 (*curr) != NULL;
4663 curr = &(*curr)->next);
4664 (*curr) = XMALLOC (struct gdbarch_data_registration);
4665 (*curr)->next = NULL;
0f71a2f6 4666 (*curr)->data = XMALLOC (struct gdbarch_data);
be5a57e1 4667 (*curr)->data->index = gdbarch_data_registry.nr++;
030f20e1
AC
4668 (*curr)->data->pre_init = pre_init;
4669 (*curr)->data->post_init = post_init;
76860b5f 4670 (*curr)->data->init_p = 1;
0f71a2f6
JM
4671 return (*curr)->data;
4672}
4673
030f20e1
AC
4674struct gdbarch_data *
4675gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4676{
4677 return gdbarch_data_register (pre_init, NULL);
4678}
4679
4680struct gdbarch_data *
4681gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4682{
4683 return gdbarch_data_register (NULL, post_init);
4684}
0f71a2f6 4685
b3cc3077 4686/* Create/delete the gdbarch data vector. */
95160752
AC
4687
4688static void
b3cc3077 4689alloc_gdbarch_data (struct gdbarch *gdbarch)
95160752 4690{
b3cc3077
JB
4691 gdb_assert (gdbarch->data == NULL);
4692 gdbarch->nr_data = gdbarch_data_registry.nr;
aebd7893 4693 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
0f71a2f6
JM
4694}
4695
76860b5f 4696/* Initialize the current value of the specified per-architecture
b3cc3077
JB
4697 data-pointer. */
4698
95160752 4699void
030f20e1
AC
4700deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4701 struct gdbarch_data *data,
4702 void *pointer)
95160752
AC
4703{
4704 gdb_assert (data->index < gdbarch->nr_data);
aebd7893 4705 gdb_assert (gdbarch->data[data->index] == NULL);
030f20e1 4706 gdb_assert (data->pre_init == NULL);
95160752
AC
4707 gdbarch->data[data->index] = pointer;
4708}
4709
0f71a2f6
JM
4710/* Return the current value of the specified per-architecture
4711 data-pointer. */
4712
4713void *
451fbdda 4714gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
0f71a2f6 4715{
451fbdda 4716 gdb_assert (data->index < gdbarch->nr_data);
030f20e1 4717 if (gdbarch->data[data->index] == NULL)
76860b5f 4718 {
030f20e1
AC
4719 /* The data-pointer isn't initialized, call init() to get a
4720 value. */
4721 if (data->pre_init != NULL)
4722 /* Mid architecture creation: pass just the obstack, and not
4723 the entire architecture, as that way it isn't possible for
4724 pre-init code to refer to undefined architecture
4725 fields. */
4726 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4727 else if (gdbarch->initialized_p
4728 && data->post_init != NULL)
4729 /* Post architecture creation: pass the entire architecture
4730 (as all fields are valid), but be careful to also detect
4731 recursive references. */
4732 {
4733 gdb_assert (data->init_p);
4734 data->init_p = 0;
4735 gdbarch->data[data->index] = data->post_init (gdbarch);
4736 data->init_p = 1;
4737 }
4738 else
4739 /* The architecture initialization hasn't completed - punt -
4740 hope that the caller knows what they are doing. Once
4741 deprecated_set_gdbarch_data has been initialized, this can be
4742 changed to an internal error. */
4743 return NULL;
76860b5f
AC
4744 gdb_assert (gdbarch->data[data->index] != NULL);
4745 }
451fbdda 4746 return gdbarch->data[data->index];
0f71a2f6
JM
4747}
4748
4749
4750
be5a57e1 4751/* Keep a registry of swapped data required by GDB modules. */
0f71a2f6
JM
4752
4753struct gdbarch_swap
4754{
4755 void *swap;
4756 struct gdbarch_swap_registration *source;
4757 struct gdbarch_swap *next;
4758};
4759
4760struct gdbarch_swap_registration
adf40b2e
JM
4761{
4762 void *data;
4763 unsigned long sizeof_data;
4764 gdbarch_swap_ftype *init;
4765 struct gdbarch_swap_registration *next;
4766};
0f71a2f6 4767
be5a57e1 4768struct gdbarch_swap_registry
adf40b2e
JM
4769{
4770 int nr;
4771 struct gdbarch_swap_registration *registrations;
4772};
0f71a2f6 4773
be5a57e1 4774struct gdbarch_swap_registry gdbarch_swap_registry =
0f71a2f6
JM
4775{
4776 0, NULL,
4777};
4778
4779void
046a4708
AC
4780deprecated_register_gdbarch_swap (void *data,
4781 unsigned long sizeof_data,
4782 gdbarch_swap_ftype *init)
0f71a2f6
JM
4783{
4784 struct gdbarch_swap_registration **rego;
be5a57e1 4785 for (rego = &gdbarch_swap_registry.registrations;
0f71a2f6
JM
4786 (*rego) != NULL;
4787 rego = &(*rego)->next);
4788 (*rego) = XMALLOC (struct gdbarch_swap_registration);
4789 (*rego)->next = NULL;
4790 (*rego)->init = init;
4791 (*rego)->data = data;
4792 (*rego)->sizeof_data = sizeof_data;
4793}
4794
40af4b0c 4795static void
7de2341d 4796current_gdbarch_swap_init_hack (void)
0f71a2f6
JM
4797{
4798 struct gdbarch_swap_registration *rego;
7de2341d 4799 struct gdbarch_swap **curr = &current_gdbarch->swap;
be5a57e1 4800 for (rego = gdbarch_swap_registry.registrations;
0f71a2f6
JM
4801 rego != NULL;
4802 rego = rego->next)
4803 {
4804 if (rego->data != NULL)
4805 {
7de2341d
AC
4806 (*curr) = GDBARCH_OBSTACK_ZALLOC (current_gdbarch,
4807 struct gdbarch_swap);
0f71a2f6 4808 (*curr)->source = rego;
7de2341d
AC
4809 (*curr)->swap = gdbarch_obstack_zalloc (current_gdbarch,
4810 rego->sizeof_data);
0f71a2f6 4811 (*curr)->next = NULL;
0f71a2f6
JM
4812 curr = &(*curr)->next;
4813 }
4814 if (rego->init != NULL)
4815 rego->init ();
4816 }
4817}
4818
7de2341d
AC
4819static struct gdbarch *
4820current_gdbarch_swap_out_hack (void)
0f71a2f6 4821{
7de2341d 4822 struct gdbarch *old_gdbarch = current_gdbarch;
0f71a2f6 4823 struct gdbarch_swap *curr;
7de2341d
AC
4824
4825 gdb_assert (old_gdbarch != NULL);
4826 for (curr = old_gdbarch->swap;
0f71a2f6
JM
4827 curr != NULL;
4828 curr = curr->next)
7de2341d
AC
4829 {
4830 memcpy (curr->swap, curr->source->data, curr->source->sizeof_data);
4831 memset (curr->source->data, 0, curr->source->sizeof_data);
4832 }
4833 current_gdbarch = NULL;
4834 return old_gdbarch;
0f71a2f6
JM
4835}
4836
0f71a2f6 4837static void
7de2341d 4838current_gdbarch_swap_in_hack (struct gdbarch *new_gdbarch)
0f71a2f6
JM
4839{
4840 struct gdbarch_swap *curr;
7de2341d
AC
4841
4842 gdb_assert (current_gdbarch == NULL);
4843 for (curr = new_gdbarch->swap;
0f71a2f6
JM
4844 curr != NULL;
4845 curr = curr->next)
4846 memcpy (curr->source->data, curr->swap, curr->source->sizeof_data);
7de2341d 4847 current_gdbarch = new_gdbarch;
0f71a2f6
JM
4848}
4849
4850
be5a57e1 4851/* Keep a registry of the architectures known by GDB. */
0f71a2f6 4852
4b9b3959 4853struct gdbarch_registration
0f71a2f6
JM
4854{
4855 enum bfd_architecture bfd_architecture;
4856 gdbarch_init_ftype *init;
4b9b3959 4857 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 4858 struct gdbarch_list *arches;
4b9b3959 4859 struct gdbarch_registration *next;
0f71a2f6
JM
4860};
4861
be5a57e1 4862static struct gdbarch_registration *gdbarch_registry = NULL;
0f71a2f6 4863
b4a20239
AC
4864static void
4865append_name (const char ***buf, int *nr, const char *name)
4866{
4867 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4868 (*buf)[*nr] = name;
4869 *nr += 1;
4870}
4871
4872const char **
4873gdbarch_printable_names (void)
4874{
7996bcec
AC
4875 /* Accumulate a list of names based on the registed list of
4876 architectures. */
4877 enum bfd_architecture a;
4878 int nr_arches = 0;
4879 const char **arches = NULL;
4880 struct gdbarch_registration *rego;
4881 for (rego = gdbarch_registry;
4882 rego != NULL;
4883 rego = rego->next)
b4a20239 4884 {
7996bcec
AC
4885 const struct bfd_arch_info *ap;
4886 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4887 if (ap == NULL)
4888 internal_error (__FILE__, __LINE__,
4889 "gdbarch_architecture_names: multi-arch unknown");
4890 do
4891 {
4892 append_name (&arches, &nr_arches, ap->printable_name);
4893 ap = ap->next;
4894 }
4895 while (ap != NULL);
b4a20239 4896 }
7996bcec
AC
4897 append_name (&arches, &nr_arches, NULL);
4898 return arches;
b4a20239
AC
4899}
4900
4901
0f71a2f6 4902void
4b9b3959
AC
4903gdbarch_register (enum bfd_architecture bfd_architecture,
4904 gdbarch_init_ftype *init,
4905 gdbarch_dump_tdep_ftype *dump_tdep)
0f71a2f6 4906{
4b9b3959 4907 struct gdbarch_registration **curr;
0f71a2f6 4908 const struct bfd_arch_info *bfd_arch_info;
ec3d358c 4909 /* Check that BFD recognizes this architecture */
0f71a2f6
JM
4910 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4911 if (bfd_arch_info == NULL)
4912 {
8e65ff28
AC
4913 internal_error (__FILE__, __LINE__,
4914 "gdbarch: Attempt to register unknown architecture (%d)",
4915 bfd_architecture);
0f71a2f6
JM
4916 }
4917 /* Check that we haven't seen this architecture before */
be5a57e1 4918 for (curr = &gdbarch_registry;
0f71a2f6
JM
4919 (*curr) != NULL;
4920 curr = &(*curr)->next)
4921 {
4922 if (bfd_architecture == (*curr)->bfd_architecture)
8e65ff28
AC
4923 internal_error (__FILE__, __LINE__,
4924 "gdbarch: Duplicate registraration of architecture (%s)",
4925 bfd_arch_info->printable_name);
0f71a2f6
JM
4926 }
4927 /* log it */
4928 if (gdbarch_debug)
4929 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
4930 bfd_arch_info->printable_name,
4931 (long) init);
4932 /* Append it */
4b9b3959 4933 (*curr) = XMALLOC (struct gdbarch_registration);
0f71a2f6
JM
4934 (*curr)->bfd_architecture = bfd_architecture;
4935 (*curr)->init = init;
4b9b3959 4936 (*curr)->dump_tdep = dump_tdep;
0f71a2f6
JM
4937 (*curr)->arches = NULL;
4938 (*curr)->next = NULL;
4b9b3959
AC
4939}
4940
4941void
4942register_gdbarch_init (enum bfd_architecture bfd_architecture,
4943 gdbarch_init_ftype *init)
4944{
4945 gdbarch_register (bfd_architecture, init, NULL);
0f71a2f6 4946}
0f71a2f6
JM
4947
4948
4949/* Look for an architecture using gdbarch_info. Base search on only
4950 BFD_ARCH_INFO and BYTE_ORDER. */
4951
4952struct gdbarch_list *
104c1213
JM
4953gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4954 const struct gdbarch_info *info)
0f71a2f6
JM
4955{
4956 for (; arches != NULL; arches = arches->next)
4957 {
4958 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4959 continue;
4960 if (info->byte_order != arches->gdbarch->byte_order)
4961 continue;
4be87837
DJ
4962 if (info->osabi != arches->gdbarch->osabi)
4963 continue;
0f71a2f6
JM
4964 return arches;
4965 }
4966 return NULL;
4967}
4968
4969
ebdba546
AC
4970/* Find an architecture that matches the specified INFO. Create a new
4971 architecture if needed. Return that new architecture. Assumes
4972 that there is no current architecture. */
0f71a2f6 4973
ebdba546
AC
4974static struct gdbarch *
4975find_arch_by_info (struct gdbarch *old_gdbarch, struct gdbarch_info info)
0f71a2f6
JM
4976{
4977 struct gdbarch *new_gdbarch;
4b9b3959 4978 struct gdbarch_registration *rego;
0f71a2f6 4979
ebdba546
AC
4980 /* The existing architecture has been swapped out - all this code
4981 works from a clean slate. */
4982 gdb_assert (current_gdbarch == NULL);
4983
b732d07d 4984 /* Fill in missing parts of the INFO struct using a number of
ebdba546
AC
4985 sources: "set ..."; INFOabfd supplied; and the existing
4986 architecture. */
4987 gdbarch_info_fill (old_gdbarch, &info);
4be87837 4988
b732d07d
AC
4989 /* Must have found some sort of architecture. */
4990 gdb_assert (info.bfd_arch_info != NULL);
0f71a2f6
JM
4991
4992 if (gdbarch_debug)
4993 {
0f71a2f6 4994 fprintf_unfiltered (gdb_stdlog,
ebdba546 4995 "find_arch_by_info: info.bfd_arch_info %s\n",
0f71a2f6
JM
4996 (info.bfd_arch_info != NULL
4997 ? info.bfd_arch_info->printable_name
4998 : "(null)"));
4999 fprintf_unfiltered (gdb_stdlog,
ebdba546 5000 "find_arch_by_info: info.byte_order %d (%s)\n",
0f71a2f6 5001 info.byte_order,
d7449b42 5002 (info.byte_order == BFD_ENDIAN_BIG ? "big"
778eb05e 5003 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
0f71a2f6 5004 : "default"));
4be87837 5005 fprintf_unfiltered (gdb_stdlog,
ebdba546 5006 "find_arch_by_info: info.osabi %d (%s)\n",
4be87837 5007 info.osabi, gdbarch_osabi_name (info.osabi));
0f71a2f6 5008 fprintf_unfiltered (gdb_stdlog,
ebdba546 5009 "find_arch_by_info: info.abfd 0x%lx\n",
0f71a2f6
JM
5010 (long) info.abfd);
5011 fprintf_unfiltered (gdb_stdlog,
ebdba546 5012 "find_arch_by_info: info.tdep_info 0x%lx\n",
0f71a2f6
JM
5013 (long) info.tdep_info);
5014 }
5015
ebdba546 5016 /* Find the tdep code that knows about this architecture. */
b732d07d
AC
5017 for (rego = gdbarch_registry;
5018 rego != NULL;
5019 rego = rego->next)
5020 if (rego->bfd_architecture == info.bfd_arch_info->arch)
5021 break;
5022 if (rego == NULL)
5023 {
5024 if (gdbarch_debug)
ebdba546
AC
5025 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5026 "No matching architecture\n");
b732d07d
AC
5027 return 0;
5028 }
5029
ebdba546 5030 /* Ask the tdep code for an architecture that matches "info". */
0f71a2f6
JM
5031 new_gdbarch = rego->init (info, rego->arches);
5032
ebdba546
AC
5033 /* Did the tdep code like it? No. Reject the change and revert to
5034 the old architecture. */
0f71a2f6
JM
5035 if (new_gdbarch == NULL)
5036 {
5037 if (gdbarch_debug)
ebdba546
AC
5038 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5039 "Target rejected architecture\n");
5040 return NULL;
0f71a2f6
JM
5041 }
5042
ebdba546
AC
5043 /* Is this a pre-existing architecture (as determined by already
5044 being initialized)? Move it to the front of the architecture
5045 list (keeping the list sorted Most Recently Used). */
5046 if (new_gdbarch->initialized_p)
0f71a2f6 5047 {
ebdba546
AC
5048 struct gdbarch_list **list;
5049 struct gdbarch_list *this;
0f71a2f6 5050 if (gdbarch_debug)
ebdba546
AC
5051 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5052 "Previous architecture 0x%08lx (%s) selected\n",
0f71a2f6
JM
5053 (long) new_gdbarch,
5054 new_gdbarch->bfd_arch_info->printable_name);
ebdba546
AC
5055 /* Find the existing arch in the list. */
5056 for (list = &rego->arches;
5057 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
5058 list = &(*list)->next);
5059 /* It had better be in the list of architectures. */
5060 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
5061 /* Unlink THIS. */
5062 this = (*list);
5063 (*list) = this->next;
5064 /* Insert THIS at the front. */
5065 this->next = rego->arches;
5066 rego->arches = this;
5067 /* Return it. */
5068 return new_gdbarch;
0f71a2f6
JM
5069 }
5070
ebdba546
AC
5071 /* It's a new architecture. */
5072 if (gdbarch_debug)
5073 fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
5074 "New architecture 0x%08lx (%s) selected\n",
5075 (long) new_gdbarch,
5076 new_gdbarch->bfd_arch_info->printable_name);
5077
5078 /* Insert the new architecture into the front of the architecture
5079 list (keep the list sorted Most Recently Used). */
0f79675b
AC
5080 {
5081 struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
5082 this->next = rego->arches;
5083 this->gdbarch = new_gdbarch;
5084 rego->arches = this;
5085 }
0f71a2f6 5086
4b9b3959
AC
5087 /* Check that the newly installed architecture is valid. Plug in
5088 any post init values. */
5089 new_gdbarch->dump_tdep = rego->dump_tdep;
0f71a2f6 5090 verify_gdbarch (new_gdbarch);
ebdba546 5091 new_gdbarch->initialized_p = 1;
0f71a2f6 5092
ebdba546
AC
5093 /* Initialize any per-architecture swap areas. This phase requires
5094 a valid global CURRENT_GDBARCH. Set it momentarially, and then
5095 swap the entire architecture out. */
5096 current_gdbarch = new_gdbarch;
7de2341d 5097 current_gdbarch_swap_init_hack ();
ebdba546 5098 current_gdbarch_swap_out_hack ();
67c2c32c 5099
4b9b3959 5100 if (gdbarch_debug)
ebdba546 5101 gdbarch_dump (new_gdbarch, gdb_stdlog);
4b9b3959 5102
ebdba546 5103 return new_gdbarch;
0f71a2f6 5104}
c906108c 5105
ebdba546
AC
5106struct gdbarch *
5107gdbarch_find_by_info (struct gdbarch_info info)
5108{
5109 /* Save the previously selected architecture, setting the global to
5110 NULL. This stops things like gdbarch->init() trying to use the
5111 previous architecture's configuration. The previous architecture
5112 may not even be of the same architecture family. The most recent
5113 architecture of the same family is found at the head of the
5114 rego->arches list. */
5115 struct gdbarch *old_gdbarch = current_gdbarch_swap_out_hack ();
5116
5117 /* Find the specified architecture. */
5118 struct gdbarch *new_gdbarch = find_arch_by_info (old_gdbarch, info);
5119
5120 /* Restore the existing architecture. */
5121 gdb_assert (current_gdbarch == NULL);
5122 current_gdbarch_swap_in_hack (old_gdbarch);
5123
5124 return new_gdbarch;
5125}
5126
5127/* Make the specified architecture current, swapping the existing one
5128 out. */
5129
5130void
5131deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
5132{
5133 gdb_assert (new_gdbarch != NULL);
5134 gdb_assert (current_gdbarch != NULL);
5135 gdb_assert (new_gdbarch->initialized_p);
5136 current_gdbarch_swap_out_hack ();
5137 current_gdbarch_swap_in_hack (new_gdbarch);
5138 architecture_changed_event ();
5139}
c906108c 5140
104c1213 5141extern void _initialize_gdbarch (void);
b4a20239 5142
c906108c 5143void
7c7651b2 5144_initialize_gdbarch (void)
c906108c 5145{
5d161b24
DB
5146 struct cmd_list_element *c;
5147
5d161b24 5148 add_show_from_set (add_set_cmd ("arch",
c906108c
SS
5149 class_maintenance,
5150 var_zinteger,
adf40b2e 5151 (char *)&gdbarch_debug,
c906108c 5152 "Set architecture debugging.\n\
5d161b24
DB
5153When non-zero, architecture debugging is enabled.", &setdebuglist),
5154 &showdebuglist);
59233f88
AC
5155 c = add_set_cmd ("archdebug",
5156 class_maintenance,
5157 var_zinteger,
5158 (char *)&gdbarch_debug,
5159 "Set architecture debugging.\n\
5d161b24
DB
5160When non-zero, architecture debugging is enabled.", &setlist);
5161
59233f88
AC
5162 deprecate_cmd (c, "set debug arch");
5163 deprecate_cmd (add_show_from_set (c, &showlist), "show debug arch");
c906108c 5164}
This page took 0.931031 seconds and 4 git commands to generate.