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