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