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