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