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