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