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