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