Tweak in memory_error
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
CommitLineData
c4bfde41
JK
1/* *INDENT-OFF* */ /* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
2/* vi:set ro: */
59233f88 3
adf40b2e 4/* Dynamic architecture support for GDB, the GNU debugger.
79d45cd4 5
ecd75fc8 6 Copyright (C) 1998-2014 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 32 to this file, modifying gdbarch.sh and using its output may prove
0963b4bd 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"
0e9f083f 46#include <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"
19630284 52#include "objfiles.h"
95160752 53
104c1213
JM
54/* Static function declarations */
55
b3cc3077 56static void alloc_gdbarch_data (struct gdbarch *);
104c1213 57
0f71a2f6
JM
58/* Non-zero if we want to trace architecture code. */
59
60#ifndef GDBARCH_DEBUG
61#define GDBARCH_DEBUG 0
62#endif
ccce17b0 63unsigned int gdbarch_debug = GDBARCH_DEBUG;
920d2a44
AC
64static void
65show_gdbarch_debug (struct ui_file *file, int from_tty,
66 struct cmd_list_element *c, const char *value)
67{
68 fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
69}
0f71a2f6 70
456fcf94 71static const char *
8da61cc4 72pformat (const struct floatformat **format)
456fcf94
AC
73{
74 if (format == NULL)
75 return "(null)";
76 else
8da61cc4
DJ
77 /* Just print out one of them - this is only for diagnostics. */
78 return format[0]->name;
456fcf94
AC
79}
80
08105857
PA
81static const char *
82pstring (const char *string)
83{
84 if (string == NULL)
85 return "(null)";
86 return string;
87}
88
05c0465e
SDJ
89/* Helper function to print a list of strings, represented as "const
90 char *const *". The list is printed comma-separated. */
91
92static char *
93pstring_list (const char *const *list)
94{
95 static char ret[100];
96 const char *const *p;
97 size_t offset = 0;
98
99 if (list == NULL)
100 return "(null)";
101
102 ret[0] = '\0';
103 for (p = list; *p != NULL && offset < sizeof (ret); ++p)
104 {
105 size_t s = xsnprintf (ret + offset, sizeof (ret) - offset, "%s, ", *p);
106 offset += 2 + s;
107 }
108
109 if (offset > 0)
110 {
111 gdb_assert (offset - 2 < sizeof (ret));
112 ret[offset - 2] = '\0';
113 }
114
115 return ret;
116}
117
0f71a2f6 118
0963b4bd 119/* Maintain the struct gdbarch object. */
0f71a2f6
JM
120
121struct gdbarch
adf40b2e 122{
76860b5f
AC
123 /* Has this architecture been fully initialized? */
124 int initialized_p;
aebd7893
AC
125
126 /* An obstack bound to the lifetime of the architecture. */
127 struct obstack *obstack;
128
0963b4bd 129 /* basic architectural information. */
adf40b2e 130 const struct bfd_arch_info * bfd_arch_info;
94123b4f
YQ
131 enum bfd_endian byte_order;
132 enum bfd_endian byte_order_for_code;
4be87837 133 enum gdb_osabi osabi;
424163ea 134 const struct target_desc * target_desc;
0f71a2f6 135
0963b4bd 136 /* target specific vector. */
adf40b2e 137 struct gdbarch_tdep *tdep;
4b9b3959 138 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 139
0963b4bd 140 /* per-architecture data-pointers. */
95160752 141 unsigned nr_data;
adf40b2e 142 void **data;
0f71a2f6 143
adf40b2e 144 /* Multi-arch values.
0f71a2f6 145
adf40b2e 146 When extending this structure you must:
0f71a2f6 147
adf40b2e 148 Add the field below.
0f71a2f6 149
adf40b2e
JM
150 Declare set/get functions and define the corresponding
151 macro in gdbarch.h.
0f71a2f6 152
adf40b2e
JM
153 gdbarch_alloc(): If zero/NULL is not a suitable default,
154 initialize the new field.
0f71a2f6 155
adf40b2e
JM
156 verify_gdbarch(): Confirm that the target updated the field
157 correctly.
0f71a2f6 158
7e73cedf 159 gdbarch_dump(): Add a fprintf_unfiltered call so that the new
adf40b2e 160 field is dumped out
0f71a2f6 161
c0e8c252 162 ``startup_gdbarch()'': Append an initial value to the static
adf40b2e 163 variable (base values on the host's c-type system).
0f71a2f6 164
adf40b2e
JM
165 get_gdbarch(): Implement the set/get functions (probably using
166 the macro's as shortcuts).
0f71a2f6
JM
167
168 */
169
32c9a795 170 int bits_big_endian;
adf40b2e
JM
171 int short_bit;
172 int int_bit;
173 int long_bit;
174 int long_long_bit;
205c306f 175 int long_long_align_bit;
f9e9243a
UW
176 int half_bit;
177 const struct floatformat ** half_format;
adf40b2e 178 int float_bit;
8da61cc4 179 const struct floatformat ** float_format;
adf40b2e 180 int double_bit;
8da61cc4 181 const struct floatformat ** double_format;
adf40b2e 182 int long_double_bit;
8da61cc4 183 const struct floatformat ** long_double_format;
66b43ecb 184 int ptr_bit;
52204a0b 185 int addr_bit;
8da614df 186 int dwarf2_addr_size;
4e409299 187 int char_signed;
adf40b2e
JM
188 gdbarch_read_pc_ftype *read_pc;
189 gdbarch_write_pc_ftype *write_pc;
39d4ef09 190 gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
d8124050 191 gdbarch_pseudo_register_read_ftype *pseudo_register_read;
3543a589 192 gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value;
d8124050 193 gdbarch_pseudo_register_write_ftype *pseudo_register_write;
adf40b2e 194 int num_regs;
0aba1244 195 int num_pseudo_regs;
175ff332
HZ
196 gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
197 gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
adf40b2e 198 int sp_regnum;
adf40b2e 199 int pc_regnum;
c2169756 200 int ps_regnum;
60054393 201 int fp0_regnum;
88c72b7d
AC
202 gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
203 gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
88c72b7d
AC
204 gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
205 gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
adf40b2e 206 gdbarch_register_name_ftype *register_name;
9c04cab7 207 gdbarch_register_type_ftype *register_type;
669fac23 208 gdbarch_dummy_id_ftype *dummy_id;
f3be58bc 209 int deprecated_fp_regnum;
b8de8283 210 gdbarch_push_dummy_call_ftype *push_dummy_call;
adf40b2e 211 int call_dummy_location;
7043d8dc 212 gdbarch_push_dummy_code_ftype *push_dummy_code;
b8de8283
AC
213 gdbarch_print_registers_info_ftype *print_registers_info;
214 gdbarch_print_float_info_ftype *print_float_info;
215 gdbarch_print_vector_info_ftype *print_vector_info;
216 gdbarch_register_sim_regno_ftype *register_sim_regno;
b8de8283
AC
217 gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
218 gdbarch_cannot_store_register_ftype *cannot_store_register;
219 gdbarch_get_longjmp_target_ftype *get_longjmp_target;
adf40b2e 220 int believe_pcc_promotion;
13d01224
AC
221 gdbarch_convert_register_p_ftype *convert_register_p;
222 gdbarch_register_to_value_ftype *register_to_value;
223 gdbarch_value_to_register_ftype *value_to_register;
9acbedc0 224 gdbarch_value_from_register_ftype *value_from_register;
4478b372
JB
225 gdbarch_pointer_to_address_ftype *pointer_to_address;
226 gdbarch_address_to_pointer_ftype *address_to_pointer;
fc0c74b1 227 gdbarch_integer_to_address_ftype *integer_to_address;
92ad9cd9 228 gdbarch_return_value_ftype *return_value;
18648a37 229 gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p;
adf40b2e 230 gdbarch_skip_prologue_ftype *skip_prologue;
4309257c 231 gdbarch_skip_main_prologue_ftype *skip_main_prologue;
591a12a1 232 gdbarch_skip_entrypoint_ftype *skip_entrypoint;
adf40b2e
JM
233 gdbarch_inner_than_ftype *inner_than;
234 gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
a1dcb23a 235 gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
a1131521 236 gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
917317f4
JM
237 gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
238 gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
adf40b2e 239 CORE_ADDR decr_pc_after_break;
782263ab 240 CORE_ADDR deprecated_function_start_offset;
123dc839 241 gdbarch_remote_register_number_ftype *remote_register_number;
b2756930 242 gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
adf40b2e 243 CORE_ADDR frame_args_skip;
12cc2063 244 gdbarch_unwind_pc_ftype *unwind_pc;
a9e5fdc2 245 gdbarch_unwind_sp_ftype *unwind_sp;
adf40b2e 246 gdbarch_frame_num_args_ftype *frame_num_args;
dc604539 247 gdbarch_frame_align_ftype *frame_align;
192cb3d4 248 gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
8b148df9 249 int frame_red_zone_size;
f517ea4e 250 gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
875e1767 251 gdbarch_addr_bits_remove_ftype *addr_bits_remove;
64c4637f 252 gdbarch_software_single_step_ftype *software_single_step;
3352ef37 253 gdbarch_single_step_through_delay_ftype *single_step_through_delay;
2bf0cb65 254 gdbarch_print_insn_ftype *print_insn;
bdcd319a 255 gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
dea0c52f 256 gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
d50355b6 257 gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
c12260ac 258 gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
a2cf933a
EZ
259 gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
260 gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
c4ed33b9 261 int cannot_step_breakpoint;
f74fa174 262 int have_nonsteppable_watchpoint;
8b2dbe47
KB
263 gdbarch_address_class_type_flags_ftype *address_class_type_flags;
264 gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
265 gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
b59ff9d5 266 gdbarch_register_reggroup_p_ftype *register_reggroup_p;
143985b7 267 gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
6ce6d90f 268 gdbarch_regset_from_core_section_ftype *regset_from_core_section;
17ea7499 269 struct core_regset_section * core_regset_sections;
6432734d 270 gdbarch_make_corefile_notes_ftype *make_corefile_notes;
b3ac9c77 271 gdbarch_elfcore_write_linux_prpsinfo_ftype *elfcore_write_linux_prpsinfo;
35c2fab7 272 gdbarch_find_memory_regions_ftype *find_memory_regions;
de584861 273 gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
356a5233 274 gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix;
28439f5e 275 gdbarch_core_pid_to_str_ftype *core_pid_to_str;
a78c2d62 276 const char * gcore_bfd_target;
0d5de010
DJ
277 int vtable_function_descriptors;
278 int vbit_in_delta;
6d350bb5 279 gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
237fc4c9
PA
280 ULONGEST max_insn_length;
281 gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
99e40580 282 gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
237fc4c9
PA
283 gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
284 gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
285 gdbarch_displaced_step_location_ftype *displaced_step_location;
dde08ee1 286 gdbarch_relocate_instruction_ftype *relocate_instruction;
1c772458 287 gdbarch_overlay_update_ftype *overlay_update;
4eb0ad19 288 gdbarch_core_read_description_ftype *core_read_description;
149ad273 289 gdbarch_static_transform_name_ftype *static_transform_name;
203c3895 290 int sofun_address_maybe_missing;
0508c3ec 291 gdbarch_process_record_ftype *process_record;
3846b520 292 gdbarch_process_record_signal_ftype *process_record_signal;
22203bbf 293 gdbarch_gdb_signal_from_target_ftype *gdb_signal_from_target;
eb14d406 294 gdbarch_gdb_signal_to_target_ftype *gdb_signal_to_target;
4aa995e1 295 gdbarch_get_siginfo_type_ftype *get_siginfo_type;
60c5725c 296 gdbarch_record_special_symbol_ftype *record_special_symbol;
a96d9b2e 297 gdbarch_get_syscall_number_ftype *get_syscall_number;
05c0465e
SDJ
298 const char *const * stap_integer_prefixes;
299 const char *const * stap_integer_suffixes;
300 const char *const * stap_register_prefixes;
301 const char *const * stap_register_suffixes;
302 const char *const * stap_register_indirection_prefixes;
303 const char *const * stap_register_indirection_suffixes;
55aa24fb
SDJ
304 const char * stap_gdb_register_prefix;
305 const char * stap_gdb_register_suffix;
306 gdbarch_stap_is_single_operand_ftype *stap_is_single_operand;
307 gdbarch_stap_parse_special_token_ftype *stap_parse_special_token;
50c71eaf 308 int has_global_solist;
2567c7d9 309 int has_global_breakpoints;
6c95b8df 310 gdbarch_has_shared_address_space_ftype *has_shared_address_space;
7a697b8d 311 gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
f870a310
TT
312 gdbarch_auto_charset_ftype *auto_charset;
313 gdbarch_auto_wide_charset_ftype *auto_wide_charset;
08105857 314 const char * solib_symbols_extension;
ab38a727 315 int has_dos_based_file_system;
6710bf39 316 gdbarch_gen_return_address_ftype *gen_return_address;
3030c96e 317 gdbarch_info_proc_ftype *info_proc;
451b7c33 318 gdbarch_core_info_proc_ftype *core_info_proc;
19630284 319 gdbarch_iterate_over_objfiles_in_search_order_ftype *iterate_over_objfiles_in_search_order;
7e35103a 320 struct ravenscar_arch_ops * ravenscar_ops;
c2170eef
MM
321 gdbarch_insn_is_call_ftype *insn_is_call;
322 gdbarch_insn_is_ret_ftype *insn_is_ret;
323 gdbarch_insn_is_jump_ftype *insn_is_jump;
adf40b2e 324};
0f71a2f6
JM
325
326
327/* The default architecture uses host values (for want of a better
0963b4bd 328 choice). */
0f71a2f6
JM
329
330extern const struct bfd_arch_info bfd_default_arch_struct;
331
4b9b3959
AC
332struct gdbarch startup_gdbarch =
333{
76860b5f 334 1, /* Always initialized. */
aebd7893 335 NULL, /* The obstack. */
0963b4bd 336 /* basic architecture information. */
ec5cbaec
AC
337 &bfd_default_arch_struct, /* bfd_arch_info */
338 BFD_ENDIAN_BIG, /* byte_order */
9d4fde75 339 BFD_ENDIAN_BIG, /* byte_order_for_code */
ec5cbaec 340 GDB_OSABI_UNKNOWN, /* osabi */
424163ea 341 0, /* target_desc */
0963b4bd 342 /* target specific vector and its dump routine. */
4b9b3959 343 NULL, NULL,
c66fb220
TT
344 /*per-architecture data-pointers. */
345 0, NULL,
0f71a2f6 346 /* Multi-arch values */
32c9a795 347 1, /* bits_big_endian */
ec5cbaec
AC
348 8 * sizeof (short), /* short_bit */
349 8 * sizeof (int), /* int_bit */
350 8 * sizeof (long), /* long_bit */
351 8 * sizeof (LONGEST), /* long_long_bit */
205c306f 352 8 * sizeof (LONGEST), /* long_long_align_bit */
f9e9243a
UW
353 16, /* half_bit */
354 0, /* half_format */
ec5cbaec 355 8 * sizeof (float), /* float_bit */
456fcf94 356 0, /* float_format */
ec5cbaec 357 8 * sizeof (double), /* double_bit */
456fcf94 358 0, /* double_format */
ec5cbaec 359 8 * sizeof (long double), /* long_double_bit */
456fcf94 360 0, /* long_double_format */
ec5cbaec
AC
361 8 * sizeof (void*), /* ptr_bit */
362 8 * sizeof (void*), /* addr_bit */
8da614df 363 sizeof (void*), /* dwarf2_addr_size */
ec5cbaec
AC
364 1, /* char_signed */
365 0, /* read_pc */
366 0, /* write_pc */
a54fba4c 367 legacy_virtual_frame_pointer, /* virtual_frame_pointer */
ec5cbaec 368 0, /* pseudo_register_read */
3543a589 369 0, /* pseudo_register_read_value */
ec5cbaec
AC
370 0, /* pseudo_register_write */
371 0, /* num_regs */
372 0, /* num_pseudo_regs */
175ff332
HZ
373 0, /* ax_pseudo_register_collect */
374 0, /* ax_pseudo_register_push_stack */
ec5cbaec 375 -1, /* sp_regnum */
ec5cbaec
AC
376 -1, /* pc_regnum */
377 -1, /* ps_regnum */
378 0, /* fp0_regnum */
d3f73121
MD
379 no_op_reg_to_regnum, /* stab_reg_to_regnum */
380 no_op_reg_to_regnum, /* ecoff_reg_to_regnum */
d3f73121
MD
381 no_op_reg_to_regnum, /* sdb_reg_to_regnum */
382 no_op_reg_to_regnum, /* dwarf2_reg_to_regnum */
ec5cbaec 383 0, /* register_name */
9c04cab7 384 0, /* register_type */
669fac23 385 0, /* dummy_id */
f3be58bc 386 -1, /* deprecated_fp_regnum */
b8de8283 387 0, /* push_dummy_call */
ec5cbaec 388 0, /* call_dummy_location */
ec5cbaec 389 0, /* push_dummy_code */
b8de8283
AC
390 default_print_registers_info, /* print_registers_info */
391 0, /* print_float_info */
392 0, /* print_vector_info */
e7faf938 393 legacy_register_sim_regno, /* register_sim_regno */
64a3914f
MD
394 cannot_register_not, /* cannot_fetch_register */
395 cannot_register_not, /* cannot_store_register */
b8de8283 396 0, /* get_longjmp_target */
ec5cbaec 397 0, /* believe_pcc_promotion */
0abe36f5 398 generic_convert_register_p, /* convert_register_p */
ec5cbaec
AC
399 0, /* register_to_value */
400 0, /* value_to_register */
9acbedc0 401 0, /* value_from_register */
9898f801
UW
402 unsigned_pointer_to_address, /* pointer_to_address */
403 unsigned_address_to_pointer, /* address_to_pointer */
ec5cbaec 404 0, /* integer_to_address */
92ad9cd9 405 0, /* return_value */
18648a37 406 default_return_in_first_hidden_param_p, /* return_in_first_hidden_param_p */
ec5cbaec 407 0, /* skip_prologue */
4309257c 408 0, /* skip_main_prologue */
591a12a1 409 0, /* skip_entrypoint */
ec5cbaec
AC
410 0, /* inner_than */
411 0, /* breakpoint_from_pc */
a1dcb23a 412 default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */
a1131521 413 0, /* adjust_breakpoint_address */
ae4b2284
MD
414 default_memory_insert_breakpoint, /* memory_insert_breakpoint */
415 default_memory_remove_breakpoint, /* memory_remove_breakpoint */
ec5cbaec 416 0, /* decr_pc_after_break */
782263ab 417 0, /* deprecated_function_start_offset */
123dc839 418 default_remote_register_number, /* remote_register_number */
b2756930 419 0, /* fetch_tls_load_module_address */
ec5cbaec 420 0, /* frame_args_skip */
ec5cbaec 421 0, /* unwind_pc */
a9e5fdc2 422 0, /* unwind_sp */
ec5cbaec 423 0, /* frame_num_args */
ec5cbaec 424 0, /* frame_align */
192cb3d4 425 default_stabs_argument_has_addr, /* stabs_argument_has_addr */
8b148df9 426 0, /* frame_red_zone_size */
e2d0e7eb 427 convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
24568a2c 428 core_addr_identity, /* addr_bits_remove */
ec5cbaec 429 0, /* software_single_step */
3352ef37 430 0, /* single_step_through_delay */
ec5cbaec
AC
431 0, /* print_insn */
432 0, /* skip_trampoline_code */
4c8c40e6 433 generic_skip_solib_resolver, /* skip_solib_resolver */
e17a4113 434 generic_in_solib_return_trampoline, /* in_solib_return_trampoline */
ec5cbaec 435 generic_in_function_epilogue_p, /* in_function_epilogue_p */
ec5cbaec
AC
436 0, /* elf_make_msymbol_special */
437 0, /* coff_make_msymbol_special */
ec5cbaec
AC
438 0, /* cannot_step_breakpoint */
439 0, /* have_nonsteppable_watchpoint */
440 0, /* address_class_type_flags */
441 0, /* address_class_type_flags_to_name */
442 0, /* address_class_name_to_type_flags */
443 default_register_reggroup_p, /* register_reggroup_p */
444 0, /* fetch_pointer_argument */
6ce6d90f 445 0, /* regset_from_core_section */
17ea7499 446 0, /* core_regset_sections */
6432734d 447 0, /* make_corefile_notes */
b3ac9c77 448 0, /* elfcore_write_linux_prpsinfo */
35c2fab7 449 0, /* find_memory_regions */
de584861 450 0, /* core_xfer_shared_libraries */
356a5233 451 0, /* core_xfer_shared_libraries_aix */
28439f5e 452 0, /* core_pid_to_str */
a78c2d62 453 0, /* gcore_bfd_target */
0d5de010
DJ
454 0, /* vtable_function_descriptors */
455 0, /* vbit_in_delta */
6d350bb5 456 0, /* skip_permanent_breakpoint */
237fc4c9
PA
457 0, /* max_insn_length */
458 0, /* displaced_step_copy_insn */
99e40580 459 default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */
237fc4c9
PA
460 0, /* displaced_step_fixup */
461 NULL, /* displaced_step_free_closure */
462 NULL, /* displaced_step_location */
dde08ee1 463 0, /* relocate_instruction */
1c772458 464 0, /* overlay_update */
4eb0ad19 465 0, /* core_read_description */
149ad273 466 0, /* static_transform_name */
203c3895 467 0, /* sofun_address_maybe_missing */
0508c3ec 468 0, /* process_record */
3846b520 469 0, /* process_record_signal */
1f8cf220 470 0, /* gdb_signal_from_target */
eb14d406 471 0, /* gdb_signal_to_target */
4aa995e1 472 0, /* get_siginfo_type */
60c5725c 473 0, /* record_special_symbol */
a96d9b2e 474 0, /* get_syscall_number */
05c0465e
SDJ
475 0, /* stap_integer_prefixes */
476 0, /* stap_integer_suffixes */
477 0, /* stap_register_prefixes */
478 0, /* stap_register_suffixes */
479 0, /* stap_register_indirection_prefixes */
480 0, /* stap_register_indirection_suffixes */
55aa24fb
SDJ
481 0, /* stap_gdb_register_prefix */
482 0, /* stap_gdb_register_suffix */
483 0, /* stap_is_single_operand */
484 0, /* stap_parse_special_token */
50c71eaf 485 0, /* has_global_solist */
2567c7d9 486 0, /* has_global_breakpoints */
6c95b8df 487 default_has_shared_address_space, /* has_shared_address_space */
7a697b8d 488 default_fast_tracepoint_valid_at, /* fast_tracepoint_valid_at */
f870a310
TT
489 default_auto_charset, /* auto_charset */
490 default_auto_wide_charset, /* auto_wide_charset */
08105857 491 0, /* solib_symbols_extension */
ab38a727 492 0, /* has_dos_based_file_system */
6710bf39 493 default_gen_return_address, /* gen_return_address */
3030c96e 494 0, /* info_proc */
451b7c33 495 0, /* core_info_proc */
19630284 496 default_iterate_over_objfiles_in_search_order, /* iterate_over_objfiles_in_search_order */
7e35103a 497 NULL, /* ravenscar_ops */
c2170eef
MM
498 default_insn_is_call, /* insn_is_call */
499 default_insn_is_ret, /* insn_is_ret */
500 default_insn_is_jump, /* insn_is_jump */
c0e8c252 501 /* startup_gdbarch() */
0f71a2f6 502};
4b9b3959 503
0f71a2f6 504
66b43ecb 505/* Create a new ``struct gdbarch'' based on information provided by
0963b4bd 506 ``struct gdbarch_info''. */
0f71a2f6
JM
507
508struct gdbarch *
104c1213
JM
509gdbarch_alloc (const struct gdbarch_info *info,
510 struct gdbarch_tdep *tdep)
0f71a2f6 511{
be7811ad 512 struct gdbarch *gdbarch;
aebd7893
AC
513
514 /* Create an obstack for allocating all the per-architecture memory,
515 then use that to allocate the architecture vector. */
70ba0933 516 struct obstack *obstack = XNEW (struct obstack);
aebd7893 517 obstack_init (obstack);
be7811ad
MD
518 gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
519 memset (gdbarch, 0, sizeof (*gdbarch));
520 gdbarch->obstack = obstack;
0f71a2f6 521
be7811ad 522 alloc_gdbarch_data (gdbarch);
b3cc3077 523
be7811ad 524 gdbarch->tdep = tdep;
0f71a2f6 525
be7811ad
MD
526 gdbarch->bfd_arch_info = info->bfd_arch_info;
527 gdbarch->byte_order = info->byte_order;
9d4fde75 528 gdbarch->byte_order_for_code = info->byte_order_for_code;
be7811ad
MD
529 gdbarch->osabi = info->osabi;
530 gdbarch->target_desc = info->target_desc;
0f71a2f6 531
0963b4bd 532 /* Force the explicit initialization of these. */
32c9a795 533 gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
be7811ad
MD
534 gdbarch->short_bit = 2*TARGET_CHAR_BIT;
535 gdbarch->int_bit = 4*TARGET_CHAR_BIT;
536 gdbarch->long_bit = 4*TARGET_CHAR_BIT;
537 gdbarch->long_long_bit = 2*gdbarch->long_bit;
205c306f 538 gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
f9e9243a 539 gdbarch->half_bit = 2*TARGET_CHAR_BIT;
be7811ad
MD
540 gdbarch->float_bit = 4*TARGET_CHAR_BIT;
541 gdbarch->double_bit = 8*TARGET_CHAR_BIT;
542 gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
543 gdbarch->ptr_bit = gdbarch->int_bit;
544 gdbarch->char_signed = -1;
545 gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
546 gdbarch->num_regs = -1;
547 gdbarch->sp_regnum = -1;
548 gdbarch->pc_regnum = -1;
549 gdbarch->ps_regnum = -1;
550 gdbarch->fp0_regnum = -1;
551 gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
552 gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
be7811ad
MD
553 gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
554 gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
555 gdbarch->deprecated_fp_regnum = -1;
556 gdbarch->call_dummy_location = AT_ENTRY_POINT;
557 gdbarch->print_registers_info = default_print_registers_info;
558 gdbarch->register_sim_regno = legacy_register_sim_regno;
559 gdbarch->cannot_fetch_register = cannot_register_not;
560 gdbarch->cannot_store_register = cannot_register_not;
561 gdbarch->convert_register_p = generic_convert_register_p;
562 gdbarch->value_from_register = default_value_from_register;
563 gdbarch->pointer_to_address = unsigned_pointer_to_address;
564 gdbarch->address_to_pointer = unsigned_address_to_pointer;
18648a37 565 gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
a1dcb23a 566 gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
be7811ad
MD
567 gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
568 gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
569 gdbarch->remote_register_number = default_remote_register_number;
570 gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
571 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
572 gdbarch->addr_bits_remove = core_addr_identity;
be7811ad
MD
573 gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
574 gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
575 gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
576 gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
be7811ad
MD
577 gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
578 gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
be7811ad 579 gdbarch->register_reggroup_p = default_register_reggroup_p;
99e40580 580 gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
237fc4c9
PA
581 gdbarch->displaced_step_fixup = NULL;
582 gdbarch->displaced_step_free_closure = NULL;
583 gdbarch->displaced_step_location = NULL;
dde08ee1 584 gdbarch->relocate_instruction = NULL;
6c95b8df 585 gdbarch->has_shared_address_space = default_has_shared_address_space;
7a697b8d 586 gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
f870a310
TT
587 gdbarch->auto_charset = default_auto_charset;
588 gdbarch->auto_wide_charset = default_auto_wide_charset;
6710bf39 589 gdbarch->gen_return_address = default_gen_return_address;
19630284 590 gdbarch->iterate_over_objfiles_in_search_order = default_iterate_over_objfiles_in_search_order;
7e35103a 591 gdbarch->ravenscar_ops = NULL;
c2170eef
MM
592 gdbarch->insn_is_call = default_insn_is_call;
593 gdbarch->insn_is_ret = default_insn_is_ret;
594 gdbarch->insn_is_jump = default_insn_is_jump;
0f71a2f6
JM
595 /* gdbarch_alloc() */
596
be7811ad 597 return gdbarch;
0f71a2f6
JM
598}
599
600
aebd7893
AC
601/* Allocate extra space using the per-architecture obstack. */
602
603void *
604gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
605{
606 void *data = obstack_alloc (arch->obstack, size);
05c547f6 607
aebd7893
AC
608 memset (data, 0, size);
609 return data;
610}
611
612
058f20d5
JB
613/* Free a gdbarch struct. This should never happen in normal
614 operation --- once you've created a gdbarch, you keep it around.
615 However, if an architecture's init function encounters an error
616 building the structure, it may need to clean up a partially
617 constructed gdbarch. */
4b9b3959 618
058f20d5
JB
619void
620gdbarch_free (struct gdbarch *arch)
621{
aebd7893 622 struct obstack *obstack;
05c547f6 623
95160752 624 gdb_assert (arch != NULL);
aebd7893
AC
625 gdb_assert (!arch->initialized_p);
626 obstack = arch->obstack;
627 obstack_free (obstack, 0); /* Includes the ARCH. */
628 xfree (obstack);
058f20d5
JB
629}
630
631
db446970
AC
632/* Ensure that all values in a GDBARCH are reasonable. */
633
0f71a2f6 634static void
be7811ad 635verify_gdbarch (struct gdbarch *gdbarch)
0f71a2f6 636{
f16a1923
AC
637 struct ui_file *log;
638 struct cleanup *cleanups;
759ef836 639 long length;
f16a1923 640 char *buf;
05c547f6 641
f16a1923
AC
642 log = mem_fileopen ();
643 cleanups = make_cleanup_ui_file_delete (log);
0f71a2f6 644 /* fundamental */
be7811ad 645 if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
f16a1923 646 fprintf_unfiltered (log, "\n\tbyte-order");
be7811ad 647 if (gdbarch->bfd_arch_info == NULL)
f16a1923 648 fprintf_unfiltered (log, "\n\tbfd_arch_info");
0963b4bd 649 /* Check those that need to be defined for the given multi-arch level. */
32c9a795 650 /* Skip verify of bits_big_endian, invalid_p == 0 */
66b43ecb
AC
651 /* Skip verify of short_bit, invalid_p == 0 */
652 /* Skip verify of int_bit, invalid_p == 0 */
653 /* Skip verify of long_bit, invalid_p == 0 */
654 /* Skip verify of long_long_bit, invalid_p == 0 */
205c306f 655 /* Skip verify of long_long_align_bit, invalid_p == 0 */
f9e9243a
UW
656 /* Skip verify of half_bit, invalid_p == 0 */
657 if (gdbarch->half_format == 0)
658 gdbarch->half_format = floatformats_ieee_half;
66b43ecb 659 /* Skip verify of float_bit, invalid_p == 0 */
be7811ad
MD
660 if (gdbarch->float_format == 0)
661 gdbarch->float_format = floatformats_ieee_single;
66b43ecb 662 /* Skip verify of double_bit, invalid_p == 0 */
be7811ad
MD
663 if (gdbarch->double_format == 0)
664 gdbarch->double_format = floatformats_ieee_double;
66b43ecb 665 /* Skip verify of long_double_bit, invalid_p == 0 */
be7811ad
MD
666 if (gdbarch->long_double_format == 0)
667 gdbarch->long_double_format = floatformats_ieee_double;
66b43ecb 668 /* Skip verify of ptr_bit, invalid_p == 0 */
be7811ad
MD
669 if (gdbarch->addr_bit == 0)
670 gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
8da614df
CV
671 if (gdbarch->dwarf2_addr_size == 0)
672 gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
be7811ad
MD
673 if (gdbarch->char_signed == -1)
674 gdbarch->char_signed = 1;
0963b4bd
MS
675 /* Skip verify of read_pc, has predicate. */
676 /* Skip verify of write_pc, has predicate. */
39d4ef09 677 /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
0963b4bd 678 /* Skip verify of pseudo_register_read, has predicate. */
3543a589 679 /* Skip verify of pseudo_register_read_value, has predicate. */
0963b4bd 680 /* Skip verify of pseudo_register_write, has predicate. */
be7811ad 681 if (gdbarch->num_regs == -1)
f16a1923 682 fprintf_unfiltered (log, "\n\tnum_regs");
0aba1244 683 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
0963b4bd
MS
684 /* Skip verify of ax_pseudo_register_collect, has predicate. */
685 /* Skip verify of ax_pseudo_register_push_stack, has predicate. */
1200cd6e 686 /* Skip verify of sp_regnum, invalid_p == 0 */
1200cd6e 687 /* Skip verify of pc_regnum, invalid_p == 0 */
c2169756 688 /* Skip verify of ps_regnum, invalid_p == 0 */
60054393 689 /* Skip verify of fp0_regnum, invalid_p == 0 */
88c72b7d
AC
690 /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
691 /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
88c72b7d
AC
692 /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
693 /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
be7811ad 694 if (gdbarch->register_name == 0)
d93859e2 695 fprintf_unfiltered (log, "\n\tregister_name");
0963b4bd
MS
696 /* Skip verify of register_type, has predicate. */
697 /* Skip verify of dummy_id, has predicate. */
f3be58bc 698 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
0963b4bd 699 /* Skip verify of push_dummy_call, has predicate. */
b8de8283 700 /* Skip verify of call_dummy_location, invalid_p == 0 */
0963b4bd 701 /* Skip verify of push_dummy_code, has predicate. */
0ab7a791 702 /* Skip verify of print_registers_info, invalid_p == 0 */
0963b4bd
MS
703 /* Skip verify of print_float_info, has predicate. */
704 /* Skip verify of print_vector_info, has predicate. */
7c7651b2 705 /* Skip verify of register_sim_regno, invalid_p == 0 */
01fb7433
AC
706 /* Skip verify of cannot_fetch_register, invalid_p == 0 */
707 /* Skip verify of cannot_store_register, invalid_p == 0 */
0963b4bd 708 /* Skip verify of get_longjmp_target, has predicate. */
13d01224 709 /* Skip verify of convert_register_p, invalid_p == 0 */
9acbedc0 710 /* Skip verify of value_from_register, invalid_p == 0 */
4478b372
JB
711 /* Skip verify of pointer_to_address, invalid_p == 0 */
712 /* Skip verify of address_to_pointer, invalid_p == 0 */
0963b4bd
MS
713 /* Skip verify of integer_to_address, has predicate. */
714 /* Skip verify of return_value, has predicate. */
18648a37 715 /* Skip verify of return_in_first_hidden_param_p, invalid_p == 0 */
be7811ad 716 if (gdbarch->skip_prologue == 0)
f16a1923 717 fprintf_unfiltered (log, "\n\tskip_prologue");
0963b4bd 718 /* Skip verify of skip_main_prologue, has predicate. */
591a12a1 719 /* Skip verify of skip_entrypoint, has predicate. */
be7811ad 720 if (gdbarch->inner_than == 0)
f16a1923 721 fprintf_unfiltered (log, "\n\tinner_than");
be7811ad 722 if (gdbarch->breakpoint_from_pc == 0)
aaab4dba 723 fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
0e05dfcb 724 /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
0963b4bd 725 /* Skip verify of adjust_breakpoint_address, has predicate. */
c0e8c252
AC
726 /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
727 /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
71bd6bd4 728 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
782263ab 729 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
123dc839 730 /* Skip verify of remote_register_number, invalid_p == 0 */
0963b4bd 731 /* Skip verify of fetch_tls_load_module_address, has predicate. */
5867a2fb 732 /* Skip verify of frame_args_skip, invalid_p == 0 */
0963b4bd
MS
733 /* Skip verify of unwind_pc, has predicate. */
734 /* Skip verify of unwind_sp, has predicate. */
735 /* Skip verify of frame_num_args, has predicate. */
736 /* Skip verify of frame_align, has predicate. */
192cb3d4 737 /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
f517ea4e 738 /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
875e1767 739 /* Skip verify of addr_bits_remove, invalid_p == 0 */
0963b4bd
MS
740 /* Skip verify of software_single_step, has predicate. */
741 /* Skip verify of single_step_through_delay, has predicate. */
be7811ad 742 if (gdbarch->print_insn == 0)
f6c40618 743 fprintf_unfiltered (log, "\n\tprint_insn");
bdcd319a 744 /* Skip verify of skip_trampoline_code, invalid_p == 0 */
dea0c52f 745 /* Skip verify of skip_solib_resolver, invalid_p == 0 */
d50355b6 746 /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
c12260ac 747 /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
a2cf933a
EZ
748 /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
749 /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
c4ed33b9 750 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
f74fa174 751 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
0963b4bd
MS
752 /* Skip verify of address_class_type_flags, has predicate. */
753 /* Skip verify of address_class_type_flags_to_name, has predicate. */
754 /* Skip verify of address_class_name_to_type_flags, has predicate. */
7e20f3fb 755 /* Skip verify of register_reggroup_p, invalid_p == 0 */
0963b4bd
MS
756 /* Skip verify of fetch_pointer_argument, has predicate. */
757 /* Skip verify of regset_from_core_section, has predicate. */
6432734d 758 /* Skip verify of make_corefile_notes, has predicate. */
b3ac9c77 759 /* Skip verify of elfcore_write_linux_prpsinfo, has predicate. */
35c2fab7 760 /* Skip verify of find_memory_regions, has predicate. */
0963b4bd 761 /* Skip verify of core_xfer_shared_libraries, has predicate. */
356a5233 762 /* Skip verify of core_xfer_shared_libraries_aix, has predicate. */
0963b4bd
MS
763 /* Skip verify of core_pid_to_str, has predicate. */
764 /* Skip verify of gcore_bfd_target, has predicate. */
0d5de010
DJ
765 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
766 /* Skip verify of vbit_in_delta, invalid_p == 0 */
0963b4bd
MS
767 /* Skip verify of skip_permanent_breakpoint, has predicate. */
768 /* Skip verify of max_insn_length, has predicate. */
769 /* Skip verify of displaced_step_copy_insn, has predicate. */
99e40580 770 /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
0963b4bd 771 /* Skip verify of displaced_step_fixup, has predicate. */
237fc4c9
PA
772 if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
773 fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
774 if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
775 fprintf_unfiltered (log, "\n\tdisplaced_step_location");
0963b4bd
MS
776 /* Skip verify of relocate_instruction, has predicate. */
777 /* Skip verify of overlay_update, has predicate. */
778 /* Skip verify of core_read_description, has predicate. */
779 /* Skip verify of static_transform_name, has predicate. */
203c3895 780 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
0963b4bd
MS
781 /* Skip verify of process_record, has predicate. */
782 /* Skip verify of process_record_signal, has predicate. */
1f8cf220 783 /* Skip verify of gdb_signal_from_target, has predicate. */
eb14d406 784 /* Skip verify of gdb_signal_to_target, has predicate. */
0963b4bd
MS
785 /* Skip verify of get_siginfo_type, has predicate. */
786 /* Skip verify of record_special_symbol, has predicate. */
787 /* Skip verify of get_syscall_number, has predicate. */
05c0465e
SDJ
788 /* Skip verify of stap_integer_prefixes, invalid_p == 0 */
789 /* Skip verify of stap_integer_suffixes, invalid_p == 0 */
790 /* Skip verify of stap_register_prefixes, invalid_p == 0 */
791 /* Skip verify of stap_register_suffixes, invalid_p == 0 */
792 /* Skip verify of stap_register_indirection_prefixes, invalid_p == 0 */
793 /* Skip verify of stap_register_indirection_suffixes, invalid_p == 0 */
55aa24fb
SDJ
794 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
795 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
796 /* Skip verify of stap_is_single_operand, has predicate. */
797 /* Skip verify of stap_parse_special_token, has predicate. */
50c71eaf 798 /* Skip verify of has_global_solist, invalid_p == 0 */
2567c7d9 799 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
6c95b8df 800 /* Skip verify of has_shared_address_space, invalid_p == 0 */
7a697b8d 801 /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
f870a310
TT
802 /* Skip verify of auto_charset, invalid_p == 0 */
803 /* Skip verify of auto_wide_charset, invalid_p == 0 */
ab38a727 804 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
6710bf39 805 /* Skip verify of gen_return_address, invalid_p == 0 */
3030c96e 806 /* Skip verify of info_proc, has predicate. */
451b7c33 807 /* Skip verify of core_info_proc, has predicate. */
19630284 808 /* Skip verify of iterate_over_objfiles_in_search_order, invalid_p == 0 */
7e35103a 809 /* Skip verify of ravenscar_ops, invalid_p == 0 */
c2170eef
MM
810 /* Skip verify of insn_is_call, invalid_p == 0 */
811 /* Skip verify of insn_is_ret, invalid_p == 0 */
812 /* Skip verify of insn_is_jump, invalid_p == 0 */
759ef836 813 buf = ui_file_xstrdup (log, &length);
f16a1923 814 make_cleanup (xfree, buf);
759ef836 815 if (length > 0)
f16a1923 816 internal_error (__FILE__, __LINE__,
e2e0b3e5 817 _("verify_gdbarch: the following are invalid ...%s"),
f16a1923
AC
818 buf);
819 do_cleanups (cleanups);
0f71a2f6
JM
820}
821
822
0963b4bd 823/* Print out the details of the current architecture. */
0f71a2f6
JM
824
825void
be7811ad 826gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
0f71a2f6 827{
b78960be 828 const char *gdb_nm_file = "<not-defined>";
05c547f6 829
b78960be
AC
830#if defined (GDB_NM_FILE)
831 gdb_nm_file = GDB_NM_FILE;
832#endif
833 fprintf_unfiltered (file,
834 "gdbarch_dump: GDB_NM_FILE = %s\n",
835 gdb_nm_file);
48f7351b
AC
836 fprintf_unfiltered (file,
837 "gdbarch_dump: addr_bit = %s\n",
623d3eb1 838 plongest (gdbarch->addr_bit));
48f7351b 839 fprintf_unfiltered (file,
30737ed9
JB
840 "gdbarch_dump: addr_bits_remove = <%s>\n",
841 host_address_to_string (gdbarch->addr_bits_remove));
7996bcec
AC
842 fprintf_unfiltered (file,
843 "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
be7811ad 844 gdbarch_address_class_name_to_type_flags_p (gdbarch));
7996bcec 845 fprintf_unfiltered (file,
30737ed9
JB
846 "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
847 host_address_to_string (gdbarch->address_class_name_to_type_flags));
48f7351b
AC
848 fprintf_unfiltered (file,
849 "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
be7811ad 850 gdbarch_address_class_type_flags_p (gdbarch));
48f7351b 851 fprintf_unfiltered (file,
30737ed9
JB
852 "gdbarch_dump: address_class_type_flags = <%s>\n",
853 host_address_to_string (gdbarch->address_class_type_flags));
7996bcec
AC
854 fprintf_unfiltered (file,
855 "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
be7811ad 856 gdbarch_address_class_type_flags_to_name_p (gdbarch));
7996bcec 857 fprintf_unfiltered (file,
30737ed9
JB
858 "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
859 host_address_to_string (gdbarch->address_class_type_flags_to_name));
48f7351b 860 fprintf_unfiltered (file,
30737ed9
JB
861 "gdbarch_dump: address_to_pointer = <%s>\n",
862 host_address_to_string (gdbarch->address_to_pointer));
a1131521
KB
863 fprintf_unfiltered (file,
864 "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
be7811ad 865 gdbarch_adjust_breakpoint_address_p (gdbarch));
a1131521 866 fprintf_unfiltered (file,
30737ed9
JB
867 "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
868 host_address_to_string (gdbarch->adjust_breakpoint_address));
f870a310
TT
869 fprintf_unfiltered (file,
870 "gdbarch_dump: auto_charset = <%s>\n",
871 host_address_to_string (gdbarch->auto_charset));
872 fprintf_unfiltered (file,
873 "gdbarch_dump: auto_wide_charset = <%s>\n",
874 host_address_to_string (gdbarch->auto_wide_charset));
175ff332
HZ
875 fprintf_unfiltered (file,
876 "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
877 gdbarch_ax_pseudo_register_collect_p (gdbarch));
878 fprintf_unfiltered (file,
879 "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
880 host_address_to_string (gdbarch->ax_pseudo_register_collect));
881 fprintf_unfiltered (file,
882 "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
883 gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
884 fprintf_unfiltered (file,
885 "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
886 host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
48f7351b
AC
887 fprintf_unfiltered (file,
888 "gdbarch_dump: believe_pcc_promotion = %s\n",
623d3eb1 889 plongest (gdbarch->believe_pcc_promotion));
283354d8 890 fprintf_unfiltered (file,
48f7351b 891 "gdbarch_dump: bfd_arch_info = %s\n",
be7811ad 892 gdbarch_bfd_arch_info (gdbarch)->printable_name);
32c9a795
MD
893 fprintf_unfiltered (file,
894 "gdbarch_dump: bits_big_endian = %s\n",
623d3eb1 895 plongest (gdbarch->bits_big_endian));
48f7351b 896 fprintf_unfiltered (file,
30737ed9
JB
897 "gdbarch_dump: breakpoint_from_pc = <%s>\n",
898 host_address_to_string (gdbarch->breakpoint_from_pc));
48f7351b
AC
899 fprintf_unfiltered (file,
900 "gdbarch_dump: byte_order = %s\n",
623d3eb1 901 plongest (gdbarch->byte_order));
9d4fde75
SS
902 fprintf_unfiltered (file,
903 "gdbarch_dump: byte_order_for_code = %s\n",
623d3eb1 904 plongest (gdbarch->byte_order_for_code));
48f7351b
AC
905 fprintf_unfiltered (file,
906 "gdbarch_dump: call_dummy_location = %s\n",
623d3eb1 907 plongest (gdbarch->call_dummy_location));
48f7351b 908 fprintf_unfiltered (file,
30737ed9
JB
909 "gdbarch_dump: cannot_fetch_register = <%s>\n",
910 host_address_to_string (gdbarch->cannot_fetch_register));
48f7351b
AC
911 fprintf_unfiltered (file,
912 "gdbarch_dump: cannot_step_breakpoint = %s\n",
623d3eb1 913 plongest (gdbarch->cannot_step_breakpoint));
48f7351b 914 fprintf_unfiltered (file,
30737ed9
JB
915 "gdbarch_dump: cannot_store_register = <%s>\n",
916 host_address_to_string (gdbarch->cannot_store_register));
48f7351b
AC
917 fprintf_unfiltered (file,
918 "gdbarch_dump: char_signed = %s\n",
623d3eb1 919 plongest (gdbarch->char_signed));
7996bcec 920 fprintf_unfiltered (file,
30737ed9
JB
921 "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
922 host_address_to_string (gdbarch->coff_make_msymbol_special));
a2428dbe 923 fprintf_unfiltered (file,
30737ed9
JB
924 "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
925 host_address_to_string (gdbarch->convert_from_func_ptr_addr));
48f7351b 926 fprintf_unfiltered (file,
30737ed9
JB
927 "gdbarch_dump: convert_register_p = <%s>\n",
928 host_address_to_string (gdbarch->convert_register_p));
451b7c33
TT
929 fprintf_unfiltered (file,
930 "gdbarch_dump: gdbarch_core_info_proc_p() = %d\n",
931 gdbarch_core_info_proc_p (gdbarch));
932 fprintf_unfiltered (file,
933 "gdbarch_dump: core_info_proc = <%s>\n",
934 host_address_to_string (gdbarch->core_info_proc));
28439f5e
PA
935 fprintf_unfiltered (file,
936 "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
937 gdbarch_core_pid_to_str_p (gdbarch));
938 fprintf_unfiltered (file,
939 "gdbarch_dump: core_pid_to_str = <%s>\n",
940 host_address_to_string (gdbarch->core_pid_to_str));
4eb0ad19
DJ
941 fprintf_unfiltered (file,
942 "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
be7811ad 943 gdbarch_core_read_description_p (gdbarch));
4eb0ad19 944 fprintf_unfiltered (file,
30737ed9
JB
945 "gdbarch_dump: core_read_description = <%s>\n",
946 host_address_to_string (gdbarch->core_read_description));
17ea7499
CES
947 fprintf_unfiltered (file,
948 "gdbarch_dump: core_regset_sections = %s\n",
949 host_address_to_string (gdbarch->core_regset_sections));
de584861
PA
950 fprintf_unfiltered (file,
951 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
be7811ad 952 gdbarch_core_xfer_shared_libraries_p (gdbarch));
de584861 953 fprintf_unfiltered (file,
30737ed9
JB
954 "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
955 host_address_to_string (gdbarch->core_xfer_shared_libraries));
356a5233
JB
956 fprintf_unfiltered (file,
957 "gdbarch_dump: gdbarch_core_xfer_shared_libraries_aix_p() = %d\n",
958 gdbarch_core_xfer_shared_libraries_aix_p (gdbarch));
959 fprintf_unfiltered (file,
960 "gdbarch_dump: core_xfer_shared_libraries_aix = <%s>\n",
961 host_address_to_string (gdbarch->core_xfer_shared_libraries_aix));
48f7351b 962 fprintf_unfiltered (file,
0b1553bc
UW
963 "gdbarch_dump: decr_pc_after_break = %s\n",
964 core_addr_to_string_nz (gdbarch->decr_pc_after_break));
48f7351b
AC
965 fprintf_unfiltered (file,
966 "gdbarch_dump: deprecated_fp_regnum = %s\n",
623d3eb1 967 plongest (gdbarch->deprecated_fp_regnum));
48f7351b 968 fprintf_unfiltered (file,
0b1553bc
UW
969 "gdbarch_dump: deprecated_function_start_offset = %s\n",
970 core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
237fc4c9
PA
971 fprintf_unfiltered (file,
972 "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
973 gdbarch_displaced_step_copy_insn_p (gdbarch));
974 fprintf_unfiltered (file,
30737ed9
JB
975 "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
976 host_address_to_string (gdbarch->displaced_step_copy_insn));
237fc4c9
PA
977 fprintf_unfiltered (file,
978 "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
979 gdbarch_displaced_step_fixup_p (gdbarch));
980 fprintf_unfiltered (file,
30737ed9
JB
981 "gdbarch_dump: displaced_step_fixup = <%s>\n",
982 host_address_to_string (gdbarch->displaced_step_fixup));
237fc4c9 983 fprintf_unfiltered (file,
30737ed9
JB
984 "gdbarch_dump: displaced_step_free_closure = <%s>\n",
985 host_address_to_string (gdbarch->displaced_step_free_closure));
99e40580
UW
986 fprintf_unfiltered (file,
987 "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
988 host_address_to_string (gdbarch->displaced_step_hw_singlestep));
237fc4c9 989 fprintf_unfiltered (file,
30737ed9
JB
990 "gdbarch_dump: displaced_step_location = <%s>\n",
991 host_address_to_string (gdbarch->displaced_step_location));
48f7351b
AC
992 fprintf_unfiltered (file,
993 "gdbarch_dump: double_bit = %s\n",
623d3eb1 994 plongest (gdbarch->double_bit));
a2428dbe 995 fprintf_unfiltered (file,
48f7351b 996 "gdbarch_dump: double_format = %s\n",
be7811ad 997 pformat (gdbarch->double_format));
669fac23
DJ
998 fprintf_unfiltered (file,
999 "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
1000 gdbarch_dummy_id_p (gdbarch));
1001 fprintf_unfiltered (file,
30737ed9
JB
1002 "gdbarch_dump: dummy_id = <%s>\n",
1003 host_address_to_string (gdbarch->dummy_id));
8da614df
CV
1004 fprintf_unfiltered (file,
1005 "gdbarch_dump: dwarf2_addr_size = %s\n",
1006 plongest (gdbarch->dwarf2_addr_size));
48f7351b 1007 fprintf_unfiltered (file,
30737ed9
JB
1008 "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
1009 host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
48f7351b 1010 fprintf_unfiltered (file,
30737ed9
JB
1011 "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
1012 host_address_to_string (gdbarch->ecoff_reg_to_regnum));
48f7351b 1013 fprintf_unfiltered (file,
30737ed9
JB
1014 "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
1015 host_address_to_string (gdbarch->elf_make_msymbol_special));
b3ac9c77
SDJ
1016 fprintf_unfiltered (file,
1017 "gdbarch_dump: gdbarch_elfcore_write_linux_prpsinfo_p() = %d\n",
1018 gdbarch_elfcore_write_linux_prpsinfo_p (gdbarch));
1019 fprintf_unfiltered (file,
1020 "gdbarch_dump: elfcore_write_linux_prpsinfo = <%s>\n",
1021 host_address_to_string (gdbarch->elfcore_write_linux_prpsinfo));
7a697b8d
SS
1022 fprintf_unfiltered (file,
1023 "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
1024 host_address_to_string (gdbarch->fast_tracepoint_valid_at));
48f7351b
AC
1025 fprintf_unfiltered (file,
1026 "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
be7811ad 1027 gdbarch_fetch_pointer_argument_p (gdbarch));
48f7351b 1028 fprintf_unfiltered (file,
30737ed9
JB
1029 "gdbarch_dump: fetch_pointer_argument = <%s>\n",
1030 host_address_to_string (gdbarch->fetch_pointer_argument));
b2756930
KB
1031 fprintf_unfiltered (file,
1032 "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
be7811ad 1033 gdbarch_fetch_tls_load_module_address_p (gdbarch));
b2756930 1034 fprintf_unfiltered (file,
30737ed9
JB
1035 "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
1036 host_address_to_string (gdbarch->fetch_tls_load_module_address));
35c2fab7
UW
1037 fprintf_unfiltered (file,
1038 "gdbarch_dump: gdbarch_find_memory_regions_p() = %d\n",
1039 gdbarch_find_memory_regions_p (gdbarch));
1040 fprintf_unfiltered (file,
1041 "gdbarch_dump: find_memory_regions = <%s>\n",
1042 host_address_to_string (gdbarch->find_memory_regions));
48f7351b
AC
1043 fprintf_unfiltered (file,
1044 "gdbarch_dump: float_bit = %s\n",
623d3eb1 1045 plongest (gdbarch->float_bit));
a2428dbe 1046 fprintf_unfiltered (file,
48f7351b 1047 "gdbarch_dump: float_format = %s\n",
be7811ad 1048 pformat (gdbarch->float_format));
48f7351b
AC
1049 fprintf_unfiltered (file,
1050 "gdbarch_dump: fp0_regnum = %s\n",
623d3eb1 1051 plongest (gdbarch->fp0_regnum));
a2428dbe
AC
1052 fprintf_unfiltered (file,
1053 "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
be7811ad 1054 gdbarch_frame_align_p (gdbarch));
a2428dbe 1055 fprintf_unfiltered (file,
30737ed9
JB
1056 "gdbarch_dump: frame_align = <%s>\n",
1057 host_address_to_string (gdbarch->frame_align));
48f7351b 1058 fprintf_unfiltered (file,
0b1553bc
UW
1059 "gdbarch_dump: frame_args_skip = %s\n",
1060 core_addr_to_string_nz (gdbarch->frame_args_skip));
48f7351b
AC
1061 fprintf_unfiltered (file,
1062 "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
be7811ad 1063 gdbarch_frame_num_args_p (gdbarch));
48f7351b 1064 fprintf_unfiltered (file,
30737ed9
JB
1065 "gdbarch_dump: frame_num_args = <%s>\n",
1066 host_address_to_string (gdbarch->frame_num_args));
48f7351b
AC
1067 fprintf_unfiltered (file,
1068 "gdbarch_dump: frame_red_zone_size = %s\n",
623d3eb1 1069 plongest (gdbarch->frame_red_zone_size));
a78c2d62
UW
1070 fprintf_unfiltered (file,
1071 "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
1072 gdbarch_gcore_bfd_target_p (gdbarch));
1073 fprintf_unfiltered (file,
1074 "gdbarch_dump: gcore_bfd_target = %s\n",
86ba1042 1075 pstring (gdbarch->gcore_bfd_target));
1f8cf220
PA
1076 fprintf_unfiltered (file,
1077 "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
1078 gdbarch_gdb_signal_from_target_p (gdbarch));
2ea28649 1079 fprintf_unfiltered (file,
22203bbf
PA
1080 "gdbarch_dump: gdb_signal_from_target = <%s>\n",
1081 host_address_to_string (gdbarch->gdb_signal_from_target));
eb14d406
SDJ
1082 fprintf_unfiltered (file,
1083 "gdbarch_dump: gdbarch_gdb_signal_to_target_p() = %d\n",
1084 gdbarch_gdb_signal_to_target_p (gdbarch));
1085 fprintf_unfiltered (file,
1086 "gdbarch_dump: gdb_signal_to_target = <%s>\n",
1087 host_address_to_string (gdbarch->gdb_signal_to_target));
6710bf39
SS
1088 fprintf_unfiltered (file,
1089 "gdbarch_dump: gen_return_address = <%s>\n",
1090 host_address_to_string (gdbarch->gen_return_address));
48f7351b
AC
1091 fprintf_unfiltered (file,
1092 "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
be7811ad 1093 gdbarch_get_longjmp_target_p (gdbarch));
48f7351b 1094 fprintf_unfiltered (file,
30737ed9
JB
1095 "gdbarch_dump: get_longjmp_target = <%s>\n",
1096 host_address_to_string (gdbarch->get_longjmp_target));
4aa995e1
PA
1097 fprintf_unfiltered (file,
1098 "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
1099 gdbarch_get_siginfo_type_p (gdbarch));
1100 fprintf_unfiltered (file,
315aef0a
PA
1101 "gdbarch_dump: get_siginfo_type = <%s>\n",
1102 host_address_to_string (gdbarch->get_siginfo_type));
a96d9b2e
SDJ
1103 fprintf_unfiltered (file,
1104 "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
1105 gdbarch_get_syscall_number_p (gdbarch));
1106 fprintf_unfiltered (file,
1107 "gdbarch_dump: get_syscall_number = <%s>\n",
1108 host_address_to_string (gdbarch->get_syscall_number));
f9e9243a
UW
1109 fprintf_unfiltered (file,
1110 "gdbarch_dump: half_bit = %s\n",
1111 plongest (gdbarch->half_bit));
1112 fprintf_unfiltered (file,
1113 "gdbarch_dump: half_format = %s\n",
1114 pformat (gdbarch->half_format));
ab38a727
PA
1115 fprintf_unfiltered (file,
1116 "gdbarch_dump: has_dos_based_file_system = %s\n",
1117 plongest (gdbarch->has_dos_based_file_system));
2567c7d9
PA
1118 fprintf_unfiltered (file,
1119 "gdbarch_dump: has_global_breakpoints = %s\n",
1120 plongest (gdbarch->has_global_breakpoints));
50c71eaf
PA
1121 fprintf_unfiltered (file,
1122 "gdbarch_dump: has_global_solist = %s\n",
1123 plongest (gdbarch->has_global_solist));
6c95b8df
PA
1124 fprintf_unfiltered (file,
1125 "gdbarch_dump: has_shared_address_space = <%s>\n",
1126 host_address_to_string (gdbarch->has_shared_address_space));
a2428dbe 1127 fprintf_unfiltered (file,
48f7351b 1128 "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
623d3eb1 1129 plongest (gdbarch->have_nonsteppable_watchpoint));
48f7351b 1130 fprintf_unfiltered (file,
30737ed9
JB
1131 "gdbarch_dump: in_function_epilogue_p = <%s>\n",
1132 host_address_to_string (gdbarch->in_function_epilogue_p));
48f7351b 1133 fprintf_unfiltered (file,
30737ed9
JB
1134 "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
1135 host_address_to_string (gdbarch->in_solib_return_trampoline));
3030c96e
UW
1136 fprintf_unfiltered (file,
1137 "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
1138 gdbarch_info_proc_p (gdbarch));
1139 fprintf_unfiltered (file,
1140 "gdbarch_dump: info_proc = <%s>\n",
1141 host_address_to_string (gdbarch->info_proc));
48f7351b 1142 fprintf_unfiltered (file,
30737ed9
JB
1143 "gdbarch_dump: inner_than = <%s>\n",
1144 host_address_to_string (gdbarch->inner_than));
c2170eef
MM
1145 fprintf_unfiltered (file,
1146 "gdbarch_dump: insn_is_call = <%s>\n",
1147 host_address_to_string (gdbarch->insn_is_call));
1148 fprintf_unfiltered (file,
1149 "gdbarch_dump: insn_is_jump = <%s>\n",
1150 host_address_to_string (gdbarch->insn_is_jump));
1151 fprintf_unfiltered (file,
1152 "gdbarch_dump: insn_is_ret = <%s>\n",
1153 host_address_to_string (gdbarch->insn_is_ret));
48f7351b
AC
1154 fprintf_unfiltered (file,
1155 "gdbarch_dump: int_bit = %s\n",
623d3eb1 1156 plongest (gdbarch->int_bit));
48f7351b
AC
1157 fprintf_unfiltered (file,
1158 "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
be7811ad 1159 gdbarch_integer_to_address_p (gdbarch));
48f7351b 1160 fprintf_unfiltered (file,
30737ed9
JB
1161 "gdbarch_dump: integer_to_address = <%s>\n",
1162 host_address_to_string (gdbarch->integer_to_address));
19630284
JB
1163 fprintf_unfiltered (file,
1164 "gdbarch_dump: iterate_over_objfiles_in_search_order = <%s>\n",
1165 host_address_to_string (gdbarch->iterate_over_objfiles_in_search_order));
48f7351b
AC
1166 fprintf_unfiltered (file,
1167 "gdbarch_dump: long_bit = %s\n",
623d3eb1 1168 plongest (gdbarch->long_bit));
48f7351b
AC
1169 fprintf_unfiltered (file,
1170 "gdbarch_dump: long_double_bit = %s\n",
623d3eb1 1171 plongest (gdbarch->long_double_bit));
a2428dbe 1172 fprintf_unfiltered (file,
48f7351b 1173 "gdbarch_dump: long_double_format = %s\n",
be7811ad 1174 pformat (gdbarch->long_double_format));
205c306f
DM
1175 fprintf_unfiltered (file,
1176 "gdbarch_dump: long_long_align_bit = %s\n",
1177 plongest (gdbarch->long_long_align_bit));
48f7351b
AC
1178 fprintf_unfiltered (file,
1179 "gdbarch_dump: long_long_bit = %s\n",
623d3eb1 1180 plongest (gdbarch->long_long_bit));
6432734d
UW
1181 fprintf_unfiltered (file,
1182 "gdbarch_dump: gdbarch_make_corefile_notes_p() = %d\n",
1183 gdbarch_make_corefile_notes_p (gdbarch));
1184 fprintf_unfiltered (file,
1185 "gdbarch_dump: make_corefile_notes = <%s>\n",
1186 host_address_to_string (gdbarch->make_corefile_notes));
237fc4c9
PA
1187 fprintf_unfiltered (file,
1188 "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
1189 gdbarch_max_insn_length_p (gdbarch));
1190 fprintf_unfiltered (file,
1191 "gdbarch_dump: max_insn_length = %s\n",
623d3eb1 1192 plongest (gdbarch->max_insn_length));
48f7351b 1193 fprintf_unfiltered (file,
30737ed9
JB
1194 "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
1195 host_address_to_string (gdbarch->memory_insert_breakpoint));
48f7351b 1196 fprintf_unfiltered (file,
30737ed9
JB
1197 "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
1198 host_address_to_string (gdbarch->memory_remove_breakpoint));
48f7351b
AC
1199 fprintf_unfiltered (file,
1200 "gdbarch_dump: num_pseudo_regs = %s\n",
623d3eb1 1201 plongest (gdbarch->num_pseudo_regs));
48f7351b
AC
1202 fprintf_unfiltered (file,
1203 "gdbarch_dump: num_regs = %s\n",
623d3eb1 1204 plongest (gdbarch->num_regs));
48f7351b
AC
1205 fprintf_unfiltered (file,
1206 "gdbarch_dump: osabi = %s\n",
623d3eb1 1207 plongest (gdbarch->osabi));
1c772458
UW
1208 fprintf_unfiltered (file,
1209 "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
be7811ad 1210 gdbarch_overlay_update_p (gdbarch));
1c772458 1211 fprintf_unfiltered (file,
30737ed9
JB
1212 "gdbarch_dump: overlay_update = <%s>\n",
1213 host_address_to_string (gdbarch->overlay_update));
48f7351b
AC
1214 fprintf_unfiltered (file,
1215 "gdbarch_dump: pc_regnum = %s\n",
623d3eb1 1216 plongest (gdbarch->pc_regnum));
48f7351b 1217 fprintf_unfiltered (file,
30737ed9
JB
1218 "gdbarch_dump: pointer_to_address = <%s>\n",
1219 host_address_to_string (gdbarch->pointer_to_address));
7996bcec
AC
1220 fprintf_unfiltered (file,
1221 "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
be7811ad 1222 gdbarch_print_float_info_p (gdbarch));
7996bcec 1223 fprintf_unfiltered (file,
30737ed9
JB
1224 "gdbarch_dump: print_float_info = <%s>\n",
1225 host_address_to_string (gdbarch->print_float_info));
7996bcec 1226 fprintf_unfiltered (file,
30737ed9
JB
1227 "gdbarch_dump: print_insn = <%s>\n",
1228 host_address_to_string (gdbarch->print_insn));
48f7351b 1229 fprintf_unfiltered (file,
30737ed9
JB
1230 "gdbarch_dump: print_registers_info = <%s>\n",
1231 host_address_to_string (gdbarch->print_registers_info));
7996bcec
AC
1232 fprintf_unfiltered (file,
1233 "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
be7811ad 1234 gdbarch_print_vector_info_p (gdbarch));
7996bcec 1235 fprintf_unfiltered (file,
30737ed9
JB
1236 "gdbarch_dump: print_vector_info = <%s>\n",
1237 host_address_to_string (gdbarch->print_vector_info));
0508c3ec
HZ
1238 fprintf_unfiltered (file,
1239 "gdbarch_dump: gdbarch_process_record_p() = %d\n",
1240 gdbarch_process_record_p (gdbarch));
1241 fprintf_unfiltered (file,
1242 "gdbarch_dump: process_record = <%s>\n",
1243 host_address_to_string (gdbarch->process_record));
3846b520
HZ
1244 fprintf_unfiltered (file,
1245 "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
1246 gdbarch_process_record_signal_p (gdbarch));
1247 fprintf_unfiltered (file,
1248 "gdbarch_dump: process_record_signal = <%s>\n",
1249 host_address_to_string (gdbarch->process_record_signal));
48f7351b
AC
1250 fprintf_unfiltered (file,
1251 "gdbarch_dump: ps_regnum = %s\n",
623d3eb1 1252 plongest (gdbarch->ps_regnum));
a2428dbe
AC
1253 fprintf_unfiltered (file,
1254 "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
be7811ad 1255 gdbarch_pseudo_register_read_p (gdbarch));
a2428dbe 1256 fprintf_unfiltered (file,
30737ed9
JB
1257 "gdbarch_dump: pseudo_register_read = <%s>\n",
1258 host_address_to_string (gdbarch->pseudo_register_read));
3543a589
TT
1259 fprintf_unfiltered (file,
1260 "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1261 gdbarch_pseudo_register_read_value_p (gdbarch));
1262 fprintf_unfiltered (file,
1263 "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1264 host_address_to_string (gdbarch->pseudo_register_read_value));
a2428dbe
AC
1265 fprintf_unfiltered (file,
1266 "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
be7811ad 1267 gdbarch_pseudo_register_write_p (gdbarch));
a2428dbe 1268 fprintf_unfiltered (file,
30737ed9
JB
1269 "gdbarch_dump: pseudo_register_write = <%s>\n",
1270 host_address_to_string (gdbarch->pseudo_register_write));
48f7351b
AC
1271 fprintf_unfiltered (file,
1272 "gdbarch_dump: ptr_bit = %s\n",
623d3eb1 1273 plongest (gdbarch->ptr_bit));
7996bcec
AC
1274 fprintf_unfiltered (file,
1275 "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
be7811ad 1276 gdbarch_push_dummy_call_p (gdbarch));
7996bcec 1277 fprintf_unfiltered (file,
30737ed9
JB
1278 "gdbarch_dump: push_dummy_call = <%s>\n",
1279 host_address_to_string (gdbarch->push_dummy_call));
7996bcec
AC
1280 fprintf_unfiltered (file,
1281 "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
be7811ad 1282 gdbarch_push_dummy_code_p (gdbarch));
7996bcec 1283 fprintf_unfiltered (file,
30737ed9
JB
1284 "gdbarch_dump: push_dummy_code = <%s>\n",
1285 host_address_to_string (gdbarch->push_dummy_code));
7e35103a
JB
1286 fprintf_unfiltered (file,
1287 "gdbarch_dump: ravenscar_ops = %s\n",
1288 host_address_to_string (gdbarch->ravenscar_ops));
48f7351b
AC
1289 fprintf_unfiltered (file,
1290 "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
be7811ad 1291 gdbarch_read_pc_p (gdbarch));
48f7351b 1292 fprintf_unfiltered (file,
30737ed9
JB
1293 "gdbarch_dump: read_pc = <%s>\n",
1294 host_address_to_string (gdbarch->read_pc));
60c5725c
DJ
1295 fprintf_unfiltered (file,
1296 "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
1297 gdbarch_record_special_symbol_p (gdbarch));
1298 fprintf_unfiltered (file,
30737ed9
JB
1299 "gdbarch_dump: record_special_symbol = <%s>\n",
1300 host_address_to_string (gdbarch->record_special_symbol));
a2428dbe 1301 fprintf_unfiltered (file,
30737ed9
JB
1302 "gdbarch_dump: register_name = <%s>\n",
1303 host_address_to_string (gdbarch->register_name));
48f7351b 1304 fprintf_unfiltered (file,
30737ed9
JB
1305 "gdbarch_dump: register_reggroup_p = <%s>\n",
1306 host_address_to_string (gdbarch->register_reggroup_p));
48f7351b 1307 fprintf_unfiltered (file,
30737ed9
JB
1308 "gdbarch_dump: register_sim_regno = <%s>\n",
1309 host_address_to_string (gdbarch->register_sim_regno));
48f7351b 1310 fprintf_unfiltered (file,
30737ed9
JB
1311 "gdbarch_dump: register_to_value = <%s>\n",
1312 host_address_to_string (gdbarch->register_to_value));
7996bcec
AC
1313 fprintf_unfiltered (file,
1314 "gdbarch_dump: gdbarch_register_type_p() = %d\n",
be7811ad 1315 gdbarch_register_type_p (gdbarch));
7996bcec 1316 fprintf_unfiltered (file,
30737ed9
JB
1317 "gdbarch_dump: register_type = <%s>\n",
1318 host_address_to_string (gdbarch->register_type));
a2428dbe
AC
1319 fprintf_unfiltered (file,
1320 "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
be7811ad 1321 gdbarch_regset_from_core_section_p (gdbarch));
a2428dbe 1322 fprintf_unfiltered (file,
30737ed9
JB
1323 "gdbarch_dump: regset_from_core_section = <%s>\n",
1324 host_address_to_string (gdbarch->regset_from_core_section));
dde08ee1
PA
1325 fprintf_unfiltered (file,
1326 "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1327 gdbarch_relocate_instruction_p (gdbarch));
1328 fprintf_unfiltered (file,
1329 "gdbarch_dump: relocate_instruction = <%s>\n",
1330 host_address_to_string (gdbarch->relocate_instruction));
a1dcb23a
DJ
1331 fprintf_unfiltered (file,
1332 "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1333 host_address_to_string (gdbarch->remote_breakpoint_from_pc));
123dc839 1334 fprintf_unfiltered (file,
30737ed9
JB
1335 "gdbarch_dump: remote_register_number = <%s>\n",
1336 host_address_to_string (gdbarch->remote_register_number));
18648a37
YQ
1337 fprintf_unfiltered (file,
1338 "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
1339 host_address_to_string (gdbarch->return_in_first_hidden_param_p));
a2428dbe
AC
1340 fprintf_unfiltered (file,
1341 "gdbarch_dump: gdbarch_return_value_p() = %d\n",
be7811ad 1342 gdbarch_return_value_p (gdbarch));
a2428dbe 1343 fprintf_unfiltered (file,
30737ed9
JB
1344 "gdbarch_dump: return_value = <%s>\n",
1345 host_address_to_string (gdbarch->return_value));
48f7351b 1346 fprintf_unfiltered (file,
30737ed9
JB
1347 "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
1348 host_address_to_string (gdbarch->sdb_reg_to_regnum));
48f7351b
AC
1349 fprintf_unfiltered (file,
1350 "gdbarch_dump: short_bit = %s\n",
623d3eb1 1351 plongest (gdbarch->short_bit));
3352ef37
AC
1352 fprintf_unfiltered (file,
1353 "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
be7811ad 1354 gdbarch_single_step_through_delay_p (gdbarch));
3352ef37 1355 fprintf_unfiltered (file,
30737ed9
JB
1356 "gdbarch_dump: single_step_through_delay = <%s>\n",
1357 host_address_to_string (gdbarch->single_step_through_delay));
591a12a1
UW
1358 fprintf_unfiltered (file,
1359 "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n",
1360 gdbarch_skip_entrypoint_p (gdbarch));
1361 fprintf_unfiltered (file,
1362 "gdbarch_dump: skip_entrypoint = <%s>\n",
1363 host_address_to_string (gdbarch->skip_entrypoint));
4309257c
PM
1364 fprintf_unfiltered (file,
1365 "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
1366 gdbarch_skip_main_prologue_p (gdbarch));
1367 fprintf_unfiltered (file,
30737ed9
JB
1368 "gdbarch_dump: skip_main_prologue = <%s>\n",
1369 host_address_to_string (gdbarch->skip_main_prologue));
6d350bb5
UW
1370 fprintf_unfiltered (file,
1371 "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
be7811ad 1372 gdbarch_skip_permanent_breakpoint_p (gdbarch));
6d350bb5 1373 fprintf_unfiltered (file,
30737ed9
JB
1374 "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
1375 host_address_to_string (gdbarch->skip_permanent_breakpoint));
dea0c52f 1376 fprintf_unfiltered (file,
30737ed9
JB
1377 "gdbarch_dump: skip_prologue = <%s>\n",
1378 host_address_to_string (gdbarch->skip_prologue));
48f7351b 1379 fprintf_unfiltered (file,
30737ed9
JB
1380 "gdbarch_dump: skip_solib_resolver = <%s>\n",
1381 host_address_to_string (gdbarch->skip_solib_resolver));
48f7351b 1382 fprintf_unfiltered (file,
30737ed9
JB
1383 "gdbarch_dump: skip_trampoline_code = <%s>\n",
1384 host_address_to_string (gdbarch->skip_trampoline_code));
48f7351b
AC
1385 fprintf_unfiltered (file,
1386 "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
be7811ad 1387 gdbarch_software_single_step_p (gdbarch));
48f7351b 1388 fprintf_unfiltered (file,
30737ed9
JB
1389 "gdbarch_dump: software_single_step = <%s>\n",
1390 host_address_to_string (gdbarch->software_single_step));
203c3895
UW
1391 fprintf_unfiltered (file,
1392 "gdbarch_dump: sofun_address_maybe_missing = %s\n",
623d3eb1 1393 plongest (gdbarch->sofun_address_maybe_missing));
08105857
PA
1394 fprintf_unfiltered (file,
1395 "gdbarch_dump: solib_symbols_extension = %s\n",
1396 pstring (gdbarch->solib_symbols_extension));
48f7351b
AC
1397 fprintf_unfiltered (file,
1398 "gdbarch_dump: sp_regnum = %s\n",
623d3eb1 1399 plongest (gdbarch->sp_regnum));
a2428dbe 1400 fprintf_unfiltered (file,
30737ed9
JB
1401 "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
1402 host_address_to_string (gdbarch->stab_reg_to_regnum));
48f7351b 1403 fprintf_unfiltered (file,
30737ed9
JB
1404 "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
1405 host_address_to_string (gdbarch->stabs_argument_has_addr));
55aa24fb
SDJ
1406 fprintf_unfiltered (file,
1407 "gdbarch_dump: stap_gdb_register_prefix = %s\n",
08af7a40 1408 pstring (gdbarch->stap_gdb_register_prefix));
55aa24fb
SDJ
1409 fprintf_unfiltered (file,
1410 "gdbarch_dump: stap_gdb_register_suffix = %s\n",
08af7a40 1411 pstring (gdbarch->stap_gdb_register_suffix));
55aa24fb 1412 fprintf_unfiltered (file,
05c0465e
SDJ
1413 "gdbarch_dump: stap_integer_prefixes = %s\n",
1414 pstring_list (gdbarch->stap_integer_prefixes));
55aa24fb 1415 fprintf_unfiltered (file,
05c0465e
SDJ
1416 "gdbarch_dump: stap_integer_suffixes = %s\n",
1417 pstring_list (gdbarch->stap_integer_suffixes));
55aa24fb
SDJ
1418 fprintf_unfiltered (file,
1419 "gdbarch_dump: gdbarch_stap_is_single_operand_p() = %d\n",
1420 gdbarch_stap_is_single_operand_p (gdbarch));
1421 fprintf_unfiltered (file,
1422 "gdbarch_dump: stap_is_single_operand = <%s>\n",
1423 host_address_to_string (gdbarch->stap_is_single_operand));
1424 fprintf_unfiltered (file,
1425 "gdbarch_dump: gdbarch_stap_parse_special_token_p() = %d\n",
1426 gdbarch_stap_parse_special_token_p (gdbarch));
1427 fprintf_unfiltered (file,
1428 "gdbarch_dump: stap_parse_special_token = <%s>\n",
1429 host_address_to_string (gdbarch->stap_parse_special_token));
1430 fprintf_unfiltered (file,
05c0465e
SDJ
1431 "gdbarch_dump: stap_register_indirection_prefixes = %s\n",
1432 pstring_list (gdbarch->stap_register_indirection_prefixes));
55aa24fb 1433 fprintf_unfiltered (file,
05c0465e
SDJ
1434 "gdbarch_dump: stap_register_indirection_suffixes = %s\n",
1435 pstring_list (gdbarch->stap_register_indirection_suffixes));
55aa24fb 1436 fprintf_unfiltered (file,
05c0465e
SDJ
1437 "gdbarch_dump: stap_register_prefixes = %s\n",
1438 pstring_list (gdbarch->stap_register_prefixes));
55aa24fb 1439 fprintf_unfiltered (file,
05c0465e
SDJ
1440 "gdbarch_dump: stap_register_suffixes = %s\n",
1441 pstring_list (gdbarch->stap_register_suffixes));
149ad273
UW
1442 fprintf_unfiltered (file,
1443 "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
be7811ad 1444 gdbarch_static_transform_name_p (gdbarch));
149ad273 1445 fprintf_unfiltered (file,
30737ed9
JB
1446 "gdbarch_dump: static_transform_name = <%s>\n",
1447 host_address_to_string (gdbarch->static_transform_name));
424163ea
DJ
1448 fprintf_unfiltered (file,
1449 "gdbarch_dump: target_desc = %s\n",
30737ed9 1450 host_address_to_string (gdbarch->target_desc));
08e45a40 1451 fprintf_unfiltered (file,
a2428dbe 1452 "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
be7811ad 1453 gdbarch_unwind_pc_p (gdbarch));
7996bcec 1454 fprintf_unfiltered (file,
30737ed9
JB
1455 "gdbarch_dump: unwind_pc = <%s>\n",
1456 host_address_to_string (gdbarch->unwind_pc));
bd1ce8ba 1457 fprintf_unfiltered (file,
a2428dbe 1458 "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
be7811ad 1459 gdbarch_unwind_sp_p (gdbarch));
bd1ce8ba 1460 fprintf_unfiltered (file,
30737ed9
JB
1461 "gdbarch_dump: unwind_sp = <%s>\n",
1462 host_address_to_string (gdbarch->unwind_sp));
9acbedc0 1463 fprintf_unfiltered (file,
30737ed9
JB
1464 "gdbarch_dump: value_from_register = <%s>\n",
1465 host_address_to_string (gdbarch->value_from_register));
48f7351b 1466 fprintf_unfiltered (file,
30737ed9
JB
1467 "gdbarch_dump: value_to_register = <%s>\n",
1468 host_address_to_string (gdbarch->value_to_register));
0d5de010
DJ
1469 fprintf_unfiltered (file,
1470 "gdbarch_dump: vbit_in_delta = %s\n",
623d3eb1 1471 plongest (gdbarch->vbit_in_delta));
48f7351b 1472 fprintf_unfiltered (file,
30737ed9
JB
1473 "gdbarch_dump: virtual_frame_pointer = <%s>\n",
1474 host_address_to_string (gdbarch->virtual_frame_pointer));
0d5de010
DJ
1475 fprintf_unfiltered (file,
1476 "gdbarch_dump: vtable_function_descriptors = %s\n",
623d3eb1 1477 plongest (gdbarch->vtable_function_descriptors));
4b9b3959 1478 fprintf_unfiltered (file,
61a1198a 1479 "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
be7811ad 1480 gdbarch_write_pc_p (gdbarch));
48f7351b 1481 fprintf_unfiltered (file,
30737ed9
JB
1482 "gdbarch_dump: write_pc = <%s>\n",
1483 host_address_to_string (gdbarch->write_pc));
be7811ad
MD
1484 if (gdbarch->dump_tdep != NULL)
1485 gdbarch->dump_tdep (gdbarch, file);
0f71a2f6
JM
1486}
1487
1488struct gdbarch_tdep *
104c1213 1489gdbarch_tdep (struct gdbarch *gdbarch)
0f71a2f6
JM
1490{
1491 if (gdbarch_debug >= 2)
0f71a2f6
JM
1492 fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1493 return gdbarch->tdep;
1494}
1495
1496
1497const struct bfd_arch_info *
104c1213 1498gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
0f71a2f6 1499{
8de9bdc4 1500 gdb_assert (gdbarch != NULL);
0f71a2f6 1501 if (gdbarch_debug >= 2)
0f71a2f6
JM
1502 fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1503 return gdbarch->bfd_arch_info;
1504}
1505
94123b4f 1506enum bfd_endian
104c1213 1507gdbarch_byte_order (struct gdbarch *gdbarch)
0f71a2f6 1508{
8de9bdc4 1509 gdb_assert (gdbarch != NULL);
0f71a2f6 1510 if (gdbarch_debug >= 2)
0f71a2f6
JM
1511 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1512 return gdbarch->byte_order;
1513}
1514
94123b4f 1515enum bfd_endian
9d4fde75
SS
1516gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
1517{
1518 gdb_assert (gdbarch != NULL);
1519 if (gdbarch_debug >= 2)
1520 fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
1521 return gdbarch->byte_order_for_code;
1522}
1523
4be87837
DJ
1524enum gdb_osabi
1525gdbarch_osabi (struct gdbarch *gdbarch)
1526{
1527 gdb_assert (gdbarch != NULL);
1528 if (gdbarch_debug >= 2)
1529 fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1530 return gdbarch->osabi;
1531}
1532
424163ea
DJ
1533const struct target_desc *
1534gdbarch_target_desc (struct gdbarch *gdbarch)
1535{
1536 gdb_assert (gdbarch != NULL);
1537 if (gdbarch_debug >= 2)
1538 fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1539 return gdbarch->target_desc;
1540}
1541
32c9a795
MD
1542int
1543gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1544{
1545 gdb_assert (gdbarch != NULL);
1546 /* Skip verify of bits_big_endian, invalid_p == 0 */
1547 if (gdbarch_debug >= 2)
1548 fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1549 return gdbarch->bits_big_endian;
1550}
1551
1552void
1553set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1554 int bits_big_endian)
1555{
1556 gdbarch->bits_big_endian = bits_big_endian;
1557}
1558
0f71a2f6 1559int
104c1213 1560gdbarch_short_bit (struct gdbarch *gdbarch)
0f71a2f6 1561{
8de9bdc4 1562 gdb_assert (gdbarch != NULL);
66b43ecb 1563 /* Skip verify of short_bit, invalid_p == 0 */
0f71a2f6 1564 if (gdbarch_debug >= 2)
0f71a2f6
JM
1565 fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1566 return gdbarch->short_bit;
1567}
1568
1569void
104c1213
JM
1570set_gdbarch_short_bit (struct gdbarch *gdbarch,
1571 int short_bit)
0f71a2f6
JM
1572{
1573 gdbarch->short_bit = short_bit;
1574}
1575
1576int
104c1213 1577gdbarch_int_bit (struct gdbarch *gdbarch)
0f71a2f6 1578{
8de9bdc4 1579 gdb_assert (gdbarch != NULL);
66b43ecb 1580 /* Skip verify of int_bit, invalid_p == 0 */
0f71a2f6 1581 if (gdbarch_debug >= 2)
0f71a2f6
JM
1582 fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1583 return gdbarch->int_bit;
1584}
1585
1586void
104c1213
JM
1587set_gdbarch_int_bit (struct gdbarch *gdbarch,
1588 int int_bit)
0f71a2f6
JM
1589{
1590 gdbarch->int_bit = int_bit;
1591}
1592
1593int
104c1213 1594gdbarch_long_bit (struct gdbarch *gdbarch)
0f71a2f6 1595{
8de9bdc4 1596 gdb_assert (gdbarch != NULL);
66b43ecb 1597 /* Skip verify of long_bit, invalid_p == 0 */
0f71a2f6 1598 if (gdbarch_debug >= 2)
0f71a2f6
JM
1599 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1600 return gdbarch->long_bit;
1601}
1602
1603void
104c1213
JM
1604set_gdbarch_long_bit (struct gdbarch *gdbarch,
1605 int long_bit)
0f71a2f6
JM
1606{
1607 gdbarch->long_bit = long_bit;
1608}
1609
1610int
104c1213 1611gdbarch_long_long_bit (struct gdbarch *gdbarch)
0f71a2f6 1612{
8de9bdc4 1613 gdb_assert (gdbarch != NULL);
66b43ecb 1614 /* Skip verify of long_long_bit, invalid_p == 0 */
0f71a2f6 1615 if (gdbarch_debug >= 2)
0f71a2f6
JM
1616 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1617 return gdbarch->long_long_bit;
1618}
1619
1620void
104c1213
JM
1621set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1622 int long_long_bit)
0f71a2f6
JM
1623{
1624 gdbarch->long_long_bit = long_long_bit;
1625}
1626
205c306f
DM
1627int
1628gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
1629{
1630 gdb_assert (gdbarch != NULL);
1631 /* Skip verify of long_long_align_bit, invalid_p == 0 */
1632 if (gdbarch_debug >= 2)
1633 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
1634 return gdbarch->long_long_align_bit;
1635}
1636
1637void
1638set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
1639 int long_long_align_bit)
1640{
1641 gdbarch->long_long_align_bit = long_long_align_bit;
1642}
1643
f9e9243a
UW
1644int
1645gdbarch_half_bit (struct gdbarch *gdbarch)
1646{
1647 gdb_assert (gdbarch != NULL);
1648 /* Skip verify of half_bit, invalid_p == 0 */
1649 if (gdbarch_debug >= 2)
1650 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_bit called\n");
1651 return gdbarch->half_bit;
1652}
1653
1654void
1655set_gdbarch_half_bit (struct gdbarch *gdbarch,
1656 int half_bit)
1657{
1658 gdbarch->half_bit = half_bit;
1659}
1660
1661const struct floatformat **
1662gdbarch_half_format (struct gdbarch *gdbarch)
1663{
1664 gdb_assert (gdbarch != NULL);
1665 if (gdbarch_debug >= 2)
1666 fprintf_unfiltered (gdb_stdlog, "gdbarch_half_format called\n");
1667 return gdbarch->half_format;
1668}
1669
1670void
1671set_gdbarch_half_format (struct gdbarch *gdbarch,
1672 const struct floatformat ** half_format)
1673{
1674 gdbarch->half_format = half_format;
1675}
1676
0f71a2f6 1677int
104c1213 1678gdbarch_float_bit (struct gdbarch *gdbarch)
0f71a2f6 1679{
8de9bdc4 1680 gdb_assert (gdbarch != NULL);
66b43ecb 1681 /* Skip verify of float_bit, invalid_p == 0 */
0f71a2f6 1682 if (gdbarch_debug >= 2)
0f71a2f6
JM
1683 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1684 return gdbarch->float_bit;
1685}
1686
1687void
104c1213
JM
1688set_gdbarch_float_bit (struct gdbarch *gdbarch,
1689 int float_bit)
0f71a2f6
JM
1690{
1691 gdbarch->float_bit = float_bit;
1692}
1693
8da61cc4 1694const struct floatformat **
456fcf94
AC
1695gdbarch_float_format (struct gdbarch *gdbarch)
1696{
1697 gdb_assert (gdbarch != NULL);
1698 if (gdbarch_debug >= 2)
1699 fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1700 return gdbarch->float_format;
1701}
1702
1703void
1704set_gdbarch_float_format (struct gdbarch *gdbarch,
8da61cc4 1705 const struct floatformat ** float_format)
456fcf94
AC
1706{
1707 gdbarch->float_format = float_format;
1708}
1709
0f71a2f6 1710int
104c1213 1711gdbarch_double_bit (struct gdbarch *gdbarch)
0f71a2f6 1712{
8de9bdc4 1713 gdb_assert (gdbarch != NULL);
66b43ecb 1714 /* Skip verify of double_bit, invalid_p == 0 */
0f71a2f6 1715 if (gdbarch_debug >= 2)
0f71a2f6
JM
1716 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1717 return gdbarch->double_bit;
1718}
1719
1720void
104c1213
JM
1721set_gdbarch_double_bit (struct gdbarch *gdbarch,
1722 int double_bit)
0f71a2f6
JM
1723{
1724 gdbarch->double_bit = double_bit;
1725}
1726
8da61cc4 1727const struct floatformat **
456fcf94
AC
1728gdbarch_double_format (struct gdbarch *gdbarch)
1729{
1730 gdb_assert (gdbarch != NULL);
1731 if (gdbarch_debug >= 2)
1732 fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1733 return gdbarch->double_format;
1734}
1735
1736void
1737set_gdbarch_double_format (struct gdbarch *gdbarch,
8da61cc4 1738 const struct floatformat ** double_format)
456fcf94
AC
1739{
1740 gdbarch->double_format = double_format;
1741}
1742
0f71a2f6 1743int
104c1213 1744gdbarch_long_double_bit (struct gdbarch *gdbarch)
0f71a2f6 1745{
8de9bdc4 1746 gdb_assert (gdbarch != NULL);
66b43ecb 1747 /* Skip verify of long_double_bit, invalid_p == 0 */
0f71a2f6 1748 if (gdbarch_debug >= 2)
0f71a2f6
JM
1749 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1750 return gdbarch->long_double_bit;
1751}
1752
1753void
104c1213
JM
1754set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1755 int long_double_bit)
0f71a2f6
JM
1756{
1757 gdbarch->long_double_bit = long_double_bit;
1758}
1759
8da61cc4 1760const struct floatformat **
456fcf94
AC
1761gdbarch_long_double_format (struct gdbarch *gdbarch)
1762{
1763 gdb_assert (gdbarch != NULL);
1764 if (gdbarch_debug >= 2)
1765 fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1766 return gdbarch->long_double_format;
1767}
1768
1769void
1770set_gdbarch_long_double_format (struct gdbarch *gdbarch,
8da61cc4 1771 const struct floatformat ** long_double_format)
456fcf94
AC
1772{
1773 gdbarch->long_double_format = long_double_format;
1774}
1775
66b43ecb
AC
1776int
1777gdbarch_ptr_bit (struct gdbarch *gdbarch)
1778{
8de9bdc4 1779 gdb_assert (gdbarch != NULL);
66b43ecb
AC
1780 /* Skip verify of ptr_bit, invalid_p == 0 */
1781 if (gdbarch_debug >= 2)
1782 fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1783 return gdbarch->ptr_bit;
1784}
1785
1786void
1787set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1788 int ptr_bit)
1789{
1790 gdbarch->ptr_bit = ptr_bit;
1791}
1792
52204a0b
DT
1793int
1794gdbarch_addr_bit (struct gdbarch *gdbarch)
1795{
8de9bdc4 1796 gdb_assert (gdbarch != NULL);
956ac328
AC
1797 /* Check variable changed from pre-default. */
1798 gdb_assert (gdbarch->addr_bit != 0);
52204a0b
DT
1799 if (gdbarch_debug >= 2)
1800 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1801 return gdbarch->addr_bit;
1802}
1803
1804void
1805set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1806 int addr_bit)
1807{
1808 gdbarch->addr_bit = addr_bit;
1809}
1810
8da614df
CV
1811int
1812gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch)
1813{
1814 gdb_assert (gdbarch != NULL);
1815 /* Check variable changed from pre-default. */
1816 gdb_assert (gdbarch->dwarf2_addr_size != 0);
1817 if (gdbarch_debug >= 2)
1818 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n");
1819 return gdbarch->dwarf2_addr_size;
1820}
1821
1822void
1823set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch,
1824 int dwarf2_addr_size)
1825{
1826 gdbarch->dwarf2_addr_size = dwarf2_addr_size;
1827}
1828
4e409299
JB
1829int
1830gdbarch_char_signed (struct gdbarch *gdbarch)
1831{
8de9bdc4 1832 gdb_assert (gdbarch != NULL);
956ac328
AC
1833 /* Check variable changed from pre-default. */
1834 gdb_assert (gdbarch->char_signed != -1);
4e409299
JB
1835 if (gdbarch_debug >= 2)
1836 fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1837 return gdbarch->char_signed;
1838}
1839
1840void
1841set_gdbarch_char_signed (struct gdbarch *gdbarch,
1842 int char_signed)
1843{
1844 gdbarch->char_signed = char_signed;
1845}
1846
cde9ea48
AC
1847int
1848gdbarch_read_pc_p (struct gdbarch *gdbarch)
1849{
1850 gdb_assert (gdbarch != NULL);
956ac328 1851 return gdbarch->read_pc != NULL;
cde9ea48
AC
1852}
1853
0f71a2f6 1854CORE_ADDR
61a1198a 1855gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
0f71a2f6 1856{
8de9bdc4 1857 gdb_assert (gdbarch != NULL);
956ac328 1858 gdb_assert (gdbarch->read_pc != NULL);
0f71a2f6 1859 if (gdbarch_debug >= 2)
0f71a2f6 1860 fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
61a1198a 1861 return gdbarch->read_pc (regcache);
0f71a2f6
JM
1862}
1863
1864void
104c1213
JM
1865set_gdbarch_read_pc (struct gdbarch *gdbarch,
1866 gdbarch_read_pc_ftype read_pc)
0f71a2f6
JM
1867{
1868 gdbarch->read_pc = read_pc;
1869}
1870
61a1198a
UW
1871int
1872gdbarch_write_pc_p (struct gdbarch *gdbarch)
1873{
1874 gdb_assert (gdbarch != NULL);
1875 return gdbarch->write_pc != NULL;
1876}
1877
0f71a2f6 1878void
61a1198a 1879gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
0f71a2f6 1880{
8de9bdc4 1881 gdb_assert (gdbarch != NULL);
956ac328 1882 gdb_assert (gdbarch->write_pc != NULL);
0f71a2f6 1883 if (gdbarch_debug >= 2)
0f71a2f6 1884 fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
61a1198a 1885 gdbarch->write_pc (regcache, val);
0f71a2f6
JM
1886}
1887
1888void
104c1213
JM
1889set_gdbarch_write_pc (struct gdbarch *gdbarch,
1890 gdbarch_write_pc_ftype write_pc)
0f71a2f6
JM
1891{
1892 gdbarch->write_pc = write_pc;
1893}
1894
39d4ef09
AC
1895void
1896gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1897{
8de9bdc4 1898 gdb_assert (gdbarch != NULL);
956ac328 1899 gdb_assert (gdbarch->virtual_frame_pointer != NULL);
39d4ef09
AC
1900 if (gdbarch_debug >= 2)
1901 fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
a54fba4c 1902 gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
39d4ef09
AC
1903}
1904
1905void
1906set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1907 gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1908{
1909 gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1910}
1911
61a0eb5b 1912int
d8124050 1913gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
61a0eb5b 1914{
8de9bdc4 1915 gdb_assert (gdbarch != NULL);
956ac328 1916 return gdbarch->pseudo_register_read != NULL;
61a0eb5b
AC
1917}
1918
05d1431c 1919enum register_status
b60c417a 1920gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
61a0eb5b 1921{
8de9bdc4 1922 gdb_assert (gdbarch != NULL);
956ac328 1923 gdb_assert (gdbarch->pseudo_register_read != NULL);
61a0eb5b 1924 if (gdbarch_debug >= 2)
d8124050 1925 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
05d1431c 1926 return gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
61a0eb5b
AC
1927}
1928
1929void
d8124050
AC
1930set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1931 gdbarch_pseudo_register_read_ftype pseudo_register_read)
61a0eb5b 1932{
d8124050 1933 gdbarch->pseudo_register_read = pseudo_register_read;
61a0eb5b
AC
1934}
1935
3543a589
TT
1936int
1937gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch)
1938{
1939 gdb_assert (gdbarch != NULL);
1940 return gdbarch->pseudo_register_read_value != NULL;
1941}
1942
1943struct value *
1944gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum)
1945{
1946 gdb_assert (gdbarch != NULL);
1947 gdb_assert (gdbarch->pseudo_register_read_value != NULL);
1948 if (gdbarch_debug >= 2)
1949 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read_value called\n");
1950 return gdbarch->pseudo_register_read_value (gdbarch, regcache, cookednum);
1951}
1952
1953void
1954set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch,
1955 gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value)
1956{
1957 gdbarch->pseudo_register_read_value = pseudo_register_read_value;
1958}
1959
61a0eb5b 1960int
d8124050 1961gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
61a0eb5b 1962{
8de9bdc4 1963 gdb_assert (gdbarch != NULL);
956ac328 1964 return gdbarch->pseudo_register_write != NULL;
61a0eb5b
AC
1965}
1966
1967void
b60c417a 1968gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
61a0eb5b 1969{
8de9bdc4 1970 gdb_assert (gdbarch != NULL);
956ac328 1971 gdb_assert (gdbarch->pseudo_register_write != NULL);
61a0eb5b 1972 if (gdbarch_debug >= 2)
d8124050
AC
1973 fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1974 gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
61a0eb5b
AC
1975}
1976
1977void
d8124050
AC
1978set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1979 gdbarch_pseudo_register_write_ftype pseudo_register_write)
61a0eb5b 1980{
d8124050 1981 gdbarch->pseudo_register_write = pseudo_register_write;
61a0eb5b
AC
1982}
1983
0f71a2f6 1984int
104c1213 1985gdbarch_num_regs (struct gdbarch *gdbarch)
0f71a2f6 1986{
8de9bdc4 1987 gdb_assert (gdbarch != NULL);
956ac328
AC
1988 /* Check variable changed from pre-default. */
1989 gdb_assert (gdbarch->num_regs != -1);
0f71a2f6 1990 if (gdbarch_debug >= 2)
0f71a2f6
JM
1991 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1992 return gdbarch->num_regs;
1993}
1994
1995void
104c1213
JM
1996set_gdbarch_num_regs (struct gdbarch *gdbarch,
1997 int num_regs)
0f71a2f6
JM
1998{
1999 gdbarch->num_regs = num_regs;
2000}
2001
0aba1244
EZ
2002int
2003gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
2004{
8de9bdc4 2005 gdb_assert (gdbarch != NULL);
0aba1244
EZ
2006 /* Skip verify of num_pseudo_regs, invalid_p == 0 */
2007 if (gdbarch_debug >= 2)
2008 fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
2009 return gdbarch->num_pseudo_regs;
2010}
2011
2012void
2013set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
2014 int num_pseudo_regs)
2015{
2016 gdbarch->num_pseudo_regs = num_pseudo_regs;
2017}
2018
175ff332
HZ
2019int
2020gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch)
2021{
2022 gdb_assert (gdbarch != NULL);
2023 return gdbarch->ax_pseudo_register_collect != NULL;
2024}
2025
2026int
2027gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
2028{
2029 gdb_assert (gdbarch != NULL);
2030 gdb_assert (gdbarch->ax_pseudo_register_collect != NULL);
2031 if (gdbarch_debug >= 2)
2032 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_collect called\n");
2033 return gdbarch->ax_pseudo_register_collect (gdbarch, ax, reg);
2034}
2035
2036void
2037set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch,
2038 gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
2039{
2040 gdbarch->ax_pseudo_register_collect = ax_pseudo_register_collect;
2041}
2042
2043int
2044gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch)
2045{
2046 gdb_assert (gdbarch != NULL);
2047 return gdbarch->ax_pseudo_register_push_stack != NULL;
2048}
2049
2050int
2051gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
2052{
2053 gdb_assert (gdbarch != NULL);
2054 gdb_assert (gdbarch->ax_pseudo_register_push_stack != NULL);
2055 if (gdbarch_debug >= 2)
2056 fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_push_stack called\n");
2057 return gdbarch->ax_pseudo_register_push_stack (gdbarch, ax, reg);
2058}
2059
2060void
2061set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
2062 gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
2063{
2064 gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
2065}
2066
0f71a2f6 2067int
104c1213 2068gdbarch_sp_regnum (struct gdbarch *gdbarch)
0f71a2f6 2069{
8de9bdc4 2070 gdb_assert (gdbarch != NULL);
1200cd6e 2071 /* Skip verify of sp_regnum, invalid_p == 0 */
0f71a2f6 2072 if (gdbarch_debug >= 2)
0f71a2f6
JM
2073 fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
2074 return gdbarch->sp_regnum;
2075}
2076
2077void
104c1213
JM
2078set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
2079 int sp_regnum)
0f71a2f6
JM
2080{
2081 gdbarch->sp_regnum = sp_regnum;
2082}
2083
0f71a2f6 2084int
104c1213 2085gdbarch_pc_regnum (struct gdbarch *gdbarch)
0f71a2f6 2086{
8de9bdc4 2087 gdb_assert (gdbarch != NULL);
1200cd6e 2088 /* Skip verify of pc_regnum, invalid_p == 0 */
0f71a2f6 2089 if (gdbarch_debug >= 2)
0f71a2f6
JM
2090 fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
2091 return gdbarch->pc_regnum;
2092}
2093
2094void
104c1213
JM
2095set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
2096 int pc_regnum)
0f71a2f6
JM
2097{
2098 gdbarch->pc_regnum = pc_regnum;
2099}
2100
c2169756
AC
2101int
2102gdbarch_ps_regnum (struct gdbarch *gdbarch)
2103{
8de9bdc4 2104 gdb_assert (gdbarch != NULL);
c2169756
AC
2105 /* Skip verify of ps_regnum, invalid_p == 0 */
2106 if (gdbarch_debug >= 2)
2107 fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
2108 return gdbarch->ps_regnum;
2109}
2110
2111void
2112set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
2113 int ps_regnum)
2114{
2115 gdbarch->ps_regnum = ps_regnum;
2116}
2117
60054393
MS
2118int
2119gdbarch_fp0_regnum (struct gdbarch *gdbarch)
2120{
8de9bdc4 2121 gdb_assert (gdbarch != NULL);
60054393
MS
2122 /* Skip verify of fp0_regnum, invalid_p == 0 */
2123 if (gdbarch_debug >= 2)
2124 fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
2125 return gdbarch->fp0_regnum;
2126}
2127
2128void
2129set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
2130 int fp0_regnum)
2131{
2132 gdbarch->fp0_regnum = fp0_regnum;
2133}
2134
88c72b7d
AC
2135int
2136gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
2137{
8de9bdc4 2138 gdb_assert (gdbarch != NULL);
956ac328 2139 gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
88c72b7d
AC
2140 if (gdbarch_debug >= 2)
2141 fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
d3f73121 2142 return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
88c72b7d
AC
2143}
2144
2145void
2146set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
2147 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
2148{
2149 gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
2150}
2151
2152int
2153gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
2154{
8de9bdc4 2155 gdb_assert (gdbarch != NULL);
956ac328 2156 gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
88c72b7d
AC
2157 if (gdbarch_debug >= 2)
2158 fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
d3f73121 2159 return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
88c72b7d
AC
2160}
2161
2162void
2163set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
2164 gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
2165{
2166 gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
2167}
2168
88c72b7d
AC
2169int
2170gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
2171{
8de9bdc4 2172 gdb_assert (gdbarch != NULL);
956ac328 2173 gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
88c72b7d
AC
2174 if (gdbarch_debug >= 2)
2175 fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
d3f73121 2176 return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
88c72b7d
AC
2177}
2178
2179void
2180set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
2181 gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
2182{
2183 gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
2184}
2185
2186int
2187gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
2188{
8de9bdc4 2189 gdb_assert (gdbarch != NULL);
956ac328 2190 gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
88c72b7d
AC
2191 if (gdbarch_debug >= 2)
2192 fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
d3f73121 2193 return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
88c72b7d
AC
2194}
2195
2196void
2197set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
2198 gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
2199{
2200 gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
2201}
2202
fa88f677 2203const char *
0f71a2f6
JM
2204gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
2205{
8de9bdc4 2206 gdb_assert (gdbarch != NULL);
956ac328 2207 gdb_assert (gdbarch->register_name != NULL);
0f71a2f6 2208 if (gdbarch_debug >= 2)
0f71a2f6 2209 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
d93859e2 2210 return gdbarch->register_name (gdbarch, regnr);
0f71a2f6
JM
2211}
2212
2213void
104c1213
JM
2214set_gdbarch_register_name (struct gdbarch *gdbarch,
2215 gdbarch_register_name_ftype register_name)
0f71a2f6
JM
2216{
2217 gdbarch->register_name = register_name;
2218}
2219
0f71a2f6 2220int
9c04cab7 2221gdbarch_register_type_p (struct gdbarch *gdbarch)
0f71a2f6 2222{
8de9bdc4 2223 gdb_assert (gdbarch != NULL);
956ac328 2224 return gdbarch->register_type != NULL;
9c04cab7
AC
2225}
2226
2227struct type *
2228gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
2229{
2230 gdb_assert (gdbarch != NULL);
956ac328 2231 gdb_assert (gdbarch->register_type != NULL);
0f71a2f6 2232 if (gdbarch_debug >= 2)
9c04cab7
AC
2233 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
2234 return gdbarch->register_type (gdbarch, reg_nr);
0f71a2f6
JM
2235}
2236
2237void
9c04cab7
AC
2238set_gdbarch_register_type (struct gdbarch *gdbarch,
2239 gdbarch_register_type_ftype register_type)
0f71a2f6 2240{
9c04cab7 2241 gdbarch->register_type = register_type;
0f71a2f6
JM
2242}
2243
f3be58bc 2244int
669fac23 2245gdbarch_dummy_id_p (struct gdbarch *gdbarch)
f3be58bc
AC
2246{
2247 gdb_assert (gdbarch != NULL);
669fac23 2248 return gdbarch->dummy_id != NULL;
f3be58bc
AC
2249}
2250
2251struct frame_id
669fac23 2252gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
f3be58bc
AC
2253{
2254 gdb_assert (gdbarch != NULL);
669fac23 2255 gdb_assert (gdbarch->dummy_id != NULL);
f3be58bc 2256 if (gdbarch_debug >= 2)
669fac23
DJ
2257 fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
2258 return gdbarch->dummy_id (gdbarch, this_frame);
f3be58bc
AC
2259}
2260
2261void
669fac23
DJ
2262set_gdbarch_dummy_id (struct gdbarch *gdbarch,
2263 gdbarch_dummy_id_ftype dummy_id)
f3be58bc 2264{
669fac23 2265 gdbarch->dummy_id = dummy_id;
f3be58bc
AC
2266}
2267
f3be58bc
AC
2268int
2269gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
2270{
2271 gdb_assert (gdbarch != NULL);
2272 /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
2273 if (gdbarch_debug >= 2)
2274 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
2275 return gdbarch->deprecated_fp_regnum;
2276}
2277
2278void
2279set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
2280 int deprecated_fp_regnum)
2281{
2282 gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
2283}
2284
0ab7a791 2285int
b8de8283 2286gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
0ab7a791
AC
2287{
2288 gdb_assert (gdbarch != NULL);
956ac328 2289 return gdbarch->push_dummy_call != NULL;
0ab7a791
AC
2290}
2291
b8de8283 2292CORE_ADDR
7d9b040b 2293gdbarch_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 2294{
8de9bdc4 2295 gdb_assert (gdbarch != NULL);
956ac328 2296 gdb_assert (gdbarch->push_dummy_call != NULL);
666e11c5 2297 if (gdbarch_debug >= 2)
b8de8283 2298 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
7d9b040b 2299 return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
666e11c5
EZ
2300}
2301
2302void
b8de8283
AC
2303set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
2304 gdbarch_push_dummy_call_ftype push_dummy_call)
666e11c5 2305{
b8de8283 2306 gdbarch->push_dummy_call = push_dummy_call;
666e11c5
EZ
2307}
2308
2649061d 2309int
b8de8283 2310gdbarch_call_dummy_location (struct gdbarch *gdbarch)
2649061d 2311{
8de9bdc4 2312 gdb_assert (gdbarch != NULL);
b8de8283
AC
2313 /* Skip verify of call_dummy_location, invalid_p == 0 */
2314 if (gdbarch_debug >= 2)
2315 fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
2316 return gdbarch->call_dummy_location;
2649061d
AC
2317}
2318
b8de8283
AC
2319void
2320set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
2321 int call_dummy_location)
2322{
2323 gdbarch->call_dummy_location = call_dummy_location;
2324}
2325
0f71a2f6 2326int
b8de8283 2327gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
0f71a2f6 2328{
8de9bdc4 2329 gdb_assert (gdbarch != NULL);
956ac328 2330 return gdbarch->push_dummy_code != NULL;
b8de8283
AC
2331}
2332
2333CORE_ADDR
82585c72 2334gdbarch_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
2335{
2336 gdb_assert (gdbarch != NULL);
956ac328 2337 gdb_assert (gdbarch->push_dummy_code != NULL);
0f71a2f6 2338 if (gdbarch_debug >= 2)
b8de8283 2339 fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
82585c72 2340 return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
0f71a2f6
JM
2341}
2342
2343void
b8de8283
AC
2344set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
2345 gdbarch_push_dummy_code_ftype push_dummy_code)
0f71a2f6 2346{
b8de8283 2347 gdbarch->push_dummy_code = push_dummy_code;
0f71a2f6
JM
2348}
2349
b8de8283
AC
2350void
2351gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
2352{
2353 gdb_assert (gdbarch != NULL);
956ac328 2354 gdb_assert (gdbarch->print_registers_info != NULL);
b8de8283
AC
2355 if (gdbarch_debug >= 2)
2356 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
2357 gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
2358}
2359
2360void
2361set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
2362 gdbarch_print_registers_info_ftype print_registers_info)
2363{
2364 gdbarch->print_registers_info = print_registers_info;
0f71a2f6
JM
2365}
2366
0f71a2f6 2367int
b8de8283
AC
2368gdbarch_print_float_info_p (struct gdbarch *gdbarch)
2369{
2370 gdb_assert (gdbarch != NULL);
956ac328 2371 return gdbarch->print_float_info != NULL;
b8de8283
AC
2372}
2373
2374void
2375gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
0f71a2f6 2376{
8de9bdc4 2377 gdb_assert (gdbarch != NULL);
956ac328 2378 gdb_assert (gdbarch->print_float_info != NULL);
0f71a2f6 2379 if (gdbarch_debug >= 2)
b8de8283
AC
2380 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
2381 gdbarch->print_float_info (gdbarch, file, frame, args);
0f71a2f6
JM
2382}
2383
2384void
b8de8283
AC
2385set_gdbarch_print_float_info (struct gdbarch *gdbarch,
2386 gdbarch_print_float_info_ftype print_float_info)
0f71a2f6 2387{
b8de8283
AC
2388 gdbarch->print_float_info = print_float_info;
2389}
2390
2391int
2392gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
2393{
2394 gdb_assert (gdbarch != NULL);
956ac328 2395 return gdbarch->print_vector_info != NULL;
b8de8283
AC
2396}
2397
2398void
2399gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
2400{
2401 gdb_assert (gdbarch != NULL);
956ac328 2402 gdb_assert (gdbarch->print_vector_info != NULL);
b8de8283
AC
2403 if (gdbarch_debug >= 2)
2404 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
2405 gdbarch->print_vector_info (gdbarch, file, frame, args);
0f71a2f6
JM
2406}
2407
b8de8283
AC
2408void
2409set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
2410 gdbarch_print_vector_info_ftype print_vector_info)
ae45cd16 2411{
b8de8283 2412 gdbarch->print_vector_info = print_vector_info;
ae45cd16
AC
2413}
2414
2415int
b8de8283 2416gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
0f71a2f6 2417{
8de9bdc4 2418 gdb_assert (gdbarch != NULL);
956ac328 2419 gdb_assert (gdbarch->register_sim_regno != NULL);
0f71a2f6 2420 if (gdbarch_debug >= 2)
b8de8283 2421 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
e7faf938 2422 return gdbarch->register_sim_regno (gdbarch, reg_nr);
0f71a2f6
JM
2423}
2424
2425void
b8de8283
AC
2426set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
2427 gdbarch_register_sim_regno_ftype register_sim_regno)
0f71a2f6 2428{
b8de8283 2429 gdbarch->register_sim_regno = register_sim_regno;
0f71a2f6
JM
2430}
2431
0f71a2f6 2432int
b8de8283 2433gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
0f71a2f6 2434{
8de9bdc4 2435 gdb_assert (gdbarch != NULL);
956ac328 2436 gdb_assert (gdbarch->cannot_fetch_register != NULL);
b8de8283
AC
2437 if (gdbarch_debug >= 2)
2438 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
64a3914f 2439 return gdbarch->cannot_fetch_register (gdbarch, regnum);
b8de8283
AC
2440}
2441
2442void
2443set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
2444 gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
2445{
2446 gdbarch->cannot_fetch_register = cannot_fetch_register;
0f71a2f6
JM
2447}
2448
2449int
b8de8283 2450gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
0f71a2f6 2451{
8de9bdc4 2452 gdb_assert (gdbarch != NULL);
956ac328 2453 gdb_assert (gdbarch->cannot_store_register != NULL);
0f71a2f6 2454 if (gdbarch_debug >= 2)
b8de8283 2455 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
64a3914f 2456 return gdbarch->cannot_store_register (gdbarch, regnum);
0f71a2f6
JM
2457}
2458
2459void
b8de8283
AC
2460set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
2461 gdbarch_cannot_store_register_ftype cannot_store_register)
0f71a2f6 2462{
b8de8283 2463 gdbarch->cannot_store_register = cannot_store_register;
0f71a2f6
JM
2464}
2465
e8ab51f7 2466int
b8de8283 2467gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
e8ab51f7
AC
2468{
2469 gdb_assert (gdbarch != NULL);
956ac328 2470 return gdbarch->get_longjmp_target != NULL;
e8ab51f7
AC
2471}
2472
b8de8283 2473int
60ade65d 2474gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
0f71a2f6 2475{
8de9bdc4 2476 gdb_assert (gdbarch != NULL);
956ac328 2477 gdb_assert (gdbarch->get_longjmp_target != NULL);
0f71a2f6 2478 if (gdbarch_debug >= 2)
b8de8283 2479 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
60ade65d 2480 return gdbarch->get_longjmp_target (frame, pc);
0f71a2f6
JM
2481}
2482
2483void
b8de8283
AC
2484set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
2485 gdbarch_get_longjmp_target_ftype get_longjmp_target)
0f71a2f6 2486{
b8de8283 2487 gdbarch->get_longjmp_target = get_longjmp_target;
0f71a2f6
JM
2488}
2489
2490int
104c1213 2491gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
0f71a2f6 2492{
8de9bdc4 2493 gdb_assert (gdbarch != NULL);
0f71a2f6 2494 if (gdbarch_debug >= 2)
0f71a2f6
JM
2495 fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
2496 return gdbarch->believe_pcc_promotion;
2497}
2498
2499void
104c1213
JM
2500set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
2501 int believe_pcc_promotion)
0f71a2f6
JM
2502{
2503 gdbarch->believe_pcc_promotion = believe_pcc_promotion;
2504}
2505
13d01224 2506int
ff2e87ac 2507gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
13d01224
AC
2508{
2509 gdb_assert (gdbarch != NULL);
956ac328 2510 gdb_assert (gdbarch->convert_register_p != NULL);
13d01224
AC
2511 if (gdbarch_debug >= 2)
2512 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
0abe36f5 2513 return gdbarch->convert_register_p (gdbarch, regnum, type);
13d01224
AC
2514}
2515
2516void
2517set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
2518 gdbarch_convert_register_p_ftype convert_register_p)
2519{
2520 gdbarch->convert_register_p = convert_register_p;
2521}
2522
8dccd430
PA
2523int
2524gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep)
13d01224
AC
2525{
2526 gdb_assert (gdbarch != NULL);
956ac328 2527 gdb_assert (gdbarch->register_to_value != NULL);
13d01224
AC
2528 if (gdbarch_debug >= 2)
2529 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
8dccd430 2530 return gdbarch->register_to_value (frame, regnum, type, buf, optimizedp, unavailablep);
13d01224
AC
2531}
2532
2533void
2534set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2535 gdbarch_register_to_value_ftype register_to_value)
2536{
2537 gdbarch->register_to_value = register_to_value;
2538}
2539
2540void
b60c417a 2541gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
13d01224
AC
2542{
2543 gdb_assert (gdbarch != NULL);
956ac328 2544 gdb_assert (gdbarch->value_to_register != NULL);
13d01224
AC
2545 if (gdbarch_debug >= 2)
2546 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
ff2e87ac 2547 gdbarch->value_to_register (frame, regnum, type, buf);
13d01224
AC
2548}
2549
2550void
2551set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2552 gdbarch_value_to_register_ftype value_to_register)
2553{
2554 gdbarch->value_to_register = value_to_register;
2555}
2556
9acbedc0
UW
2557struct value *
2558gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2559{
2560 gdb_assert (gdbarch != NULL);
2561 gdb_assert (gdbarch->value_from_register != NULL);
2562 if (gdbarch_debug >= 2)
2563 fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2564 return gdbarch->value_from_register (type, regnum, frame);
2565}
2566
2567void
2568set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2569 gdbarch_value_from_register_ftype value_from_register)
2570{
2571 gdbarch->value_from_register = value_from_register;
2572}
2573
4478b372 2574CORE_ADDR
b60c417a 2575gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
4478b372 2576{
8de9bdc4 2577 gdb_assert (gdbarch != NULL);
956ac328 2578 gdb_assert (gdbarch->pointer_to_address != NULL);
4478b372
JB
2579 if (gdbarch_debug >= 2)
2580 fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
9898f801 2581 return gdbarch->pointer_to_address (gdbarch, type, buf);
4478b372
JB
2582}
2583
2584void
2585set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2586 gdbarch_pointer_to_address_ftype pointer_to_address)
2587{
2588 gdbarch->pointer_to_address = pointer_to_address;
2589}
2590
2591void
b60c417a 2592gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
4478b372 2593{
8de9bdc4 2594 gdb_assert (gdbarch != NULL);
956ac328 2595 gdb_assert (gdbarch->address_to_pointer != NULL);
4478b372
JB
2596 if (gdbarch_debug >= 2)
2597 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
9898f801 2598 gdbarch->address_to_pointer (gdbarch, type, buf, addr);
4478b372
JB
2599}
2600
2601void
2602set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2603 gdbarch_address_to_pointer_ftype address_to_pointer)
2604{
2605 gdbarch->address_to_pointer = address_to_pointer;
2606}
2607
fc0c74b1
AC
2608int
2609gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2610{
8de9bdc4 2611 gdb_assert (gdbarch != NULL);
956ac328 2612 return gdbarch->integer_to_address != NULL;
fc0c74b1
AC
2613}
2614
2615CORE_ADDR
fc1a4b47 2616gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
fc0c74b1 2617{
8de9bdc4 2618 gdb_assert (gdbarch != NULL);
956ac328 2619 gdb_assert (gdbarch->integer_to_address != NULL);
fc0c74b1
AC
2620 if (gdbarch_debug >= 2)
2621 fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
79dd2d24 2622 return gdbarch->integer_to_address (gdbarch, type, buf);
fc0c74b1
AC
2623}
2624
2625void
2626set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2627 gdbarch_integer_to_address_ftype integer_to_address)
2628{
2629 gdbarch->integer_to_address = integer_to_address;
2630}
2631
92ad9cd9
AC
2632int
2633gdbarch_return_value_p (struct gdbarch *gdbarch)
2634{
2635 gdb_assert (gdbarch != NULL);
c1874924 2636 return gdbarch->return_value != NULL;
92ad9cd9
AC
2637}
2638
2639enum return_value_convention
6a3a010b 2640gdbarch_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
92ad9cd9
AC
2641{
2642 gdb_assert (gdbarch != NULL);
2643 gdb_assert (gdbarch->return_value != NULL);
2644 if (gdbarch_debug >= 2)
2645 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
6a3a010b 2646 return gdbarch->return_value (gdbarch, function, valtype, regcache, readbuf, writebuf);
92ad9cd9
AC
2647}
2648
2649void
2650set_gdbarch_return_value (struct gdbarch *gdbarch,
2651 gdbarch_return_value_ftype return_value)
2652{
2653 gdbarch->return_value = return_value;
2654}
2655
18648a37
YQ
2656int
2657gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type)
2658{
2659 gdb_assert (gdbarch != NULL);
2660 gdb_assert (gdbarch->return_in_first_hidden_param_p != NULL);
2661 if (gdbarch_debug >= 2)
2662 fprintf_unfiltered (gdb_stdlog, "gdbarch_return_in_first_hidden_param_p called\n");
2663 return gdbarch->return_in_first_hidden_param_p (gdbarch, type);
2664}
2665
2666void
2667set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
2668 gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p)
2669{
2670 gdbarch->return_in_first_hidden_param_p = return_in_first_hidden_param_p;
2671}
2672
0f71a2f6
JM
2673CORE_ADDR
2674gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2675{
8de9bdc4 2676 gdb_assert (gdbarch != NULL);
956ac328 2677 gdb_assert (gdbarch->skip_prologue != NULL);
0f71a2f6 2678 if (gdbarch_debug >= 2)
0f71a2f6 2679 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
6093d2eb 2680 return gdbarch->skip_prologue (gdbarch, ip);
0f71a2f6
JM
2681}
2682
2683void
104c1213
JM
2684set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2685 gdbarch_skip_prologue_ftype skip_prologue)
0f71a2f6
JM
2686{
2687 gdbarch->skip_prologue = skip_prologue;
2688}
2689
4309257c
PM
2690int
2691gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
2692{
2693 gdb_assert (gdbarch != NULL);
2694 return gdbarch->skip_main_prologue != NULL;
2695}
2696
2697CORE_ADDR
2698gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2699{
2700 gdb_assert (gdbarch != NULL);
2701 gdb_assert (gdbarch->skip_main_prologue != NULL);
2702 if (gdbarch_debug >= 2)
2703 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
2704 return gdbarch->skip_main_prologue (gdbarch, ip);
2705}
2706
2707void
2708set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
cfd8ab24 2709 gdbarch_skip_main_prologue_ftype skip_main_prologue)
4309257c
PM
2710{
2711 gdbarch->skip_main_prologue = skip_main_prologue;
2712}
2713
591a12a1
UW
2714int
2715gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch)
2716{
2717 gdb_assert (gdbarch != NULL);
2718 return gdbarch->skip_entrypoint != NULL;
2719}
2720
2721CORE_ADDR
2722gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip)
2723{
2724 gdb_assert (gdbarch != NULL);
2725 gdb_assert (gdbarch->skip_entrypoint != NULL);
2726 if (gdbarch_debug >= 2)
2727 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_entrypoint called\n");
2728 return gdbarch->skip_entrypoint (gdbarch, ip);
2729}
2730
2731void
2732set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch,
2733 gdbarch_skip_entrypoint_ftype skip_entrypoint)
2734{
2735 gdbarch->skip_entrypoint = skip_entrypoint;
2736}
2737
0f71a2f6
JM
2738int
2739gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2740{
8de9bdc4 2741 gdb_assert (gdbarch != NULL);
956ac328 2742 gdb_assert (gdbarch->inner_than != NULL);
0f71a2f6 2743 if (gdbarch_debug >= 2)
0f71a2f6
JM
2744 fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2745 return gdbarch->inner_than (lhs, rhs);
2746}
2747
2748void
104c1213
JM
2749set_gdbarch_inner_than (struct gdbarch *gdbarch,
2750 gdbarch_inner_than_ftype inner_than)
0f71a2f6
JM
2751{
2752 gdbarch->inner_than = inner_than;
2753}
2754
fc1a4b47 2755const gdb_byte *
adf40b2e 2756gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
0f71a2f6 2757{
8de9bdc4 2758 gdb_assert (gdbarch != NULL);
956ac328 2759 gdb_assert (gdbarch->breakpoint_from_pc != NULL);
0f71a2f6 2760 if (gdbarch_debug >= 2)
0f71a2f6 2761 fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
67d57894 2762 return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
0f71a2f6
JM
2763}
2764
2765void
104c1213
JM
2766set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2767 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
0f71a2f6
JM
2768{
2769 gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2770}
2771
a1dcb23a
DJ
2772void
2773gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2774{
2775 gdb_assert (gdbarch != NULL);
2776 gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2777 if (gdbarch_debug >= 2)
2778 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2779 gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2780}
2781
2782void
2783set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2784 gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2785{
2786 gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2787}
2788
a1131521
KB
2789int
2790gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2791{
2792 gdb_assert (gdbarch != NULL);
2793 return gdbarch->adjust_breakpoint_address != NULL;
2794}
2795
2796CORE_ADDR
2797gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2798{
2799 gdb_assert (gdbarch != NULL);
2800 gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2801 if (gdbarch_debug >= 2)
2802 fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2803 return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2804}
2805
2806void
2807set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2808 gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2809{
2810 gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2811}
2812
917317f4 2813int
8181d85f 2814gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
917317f4 2815{
8de9bdc4 2816 gdb_assert (gdbarch != NULL);
956ac328 2817 gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
917317f4 2818 if (gdbarch_debug >= 2)
917317f4 2819 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
ae4b2284 2820 return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
917317f4
JM
2821}
2822
2823void
2824set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2825 gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2826{
2827 gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2828}
2829
2830int
8181d85f 2831gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
917317f4 2832{
8de9bdc4 2833 gdb_assert (gdbarch != NULL);
956ac328 2834 gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
917317f4 2835 if (gdbarch_debug >= 2)
917317f4 2836 fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
ae4b2284 2837 return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
917317f4
JM
2838}
2839
2840void
2841set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2842 gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2843{
2844 gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2845}
2846
0f71a2f6 2847CORE_ADDR
104c1213 2848gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
0f71a2f6 2849{
8de9bdc4 2850 gdb_assert (gdbarch != NULL);
71bd6bd4 2851 /* Skip verify of decr_pc_after_break, invalid_p == 0 */
0f71a2f6 2852 if (gdbarch_debug >= 2)
0f71a2f6
JM
2853 fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2854 return gdbarch->decr_pc_after_break;
2855}
2856
2857void
104c1213
JM
2858set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2859 CORE_ADDR decr_pc_after_break)
0f71a2f6
JM
2860{
2861 gdbarch->decr_pc_after_break = decr_pc_after_break;
2862}
2863
2864CORE_ADDR
782263ab 2865gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
0f71a2f6 2866{
8de9bdc4 2867 gdb_assert (gdbarch != NULL);
782263ab 2868 /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
0f71a2f6 2869 if (gdbarch_debug >= 2)
782263ab
AC
2870 fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2871 return gdbarch->deprecated_function_start_offset;
0f71a2f6
JM
2872}
2873
2874void
782263ab
AC
2875set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2876 CORE_ADDR deprecated_function_start_offset)
0f71a2f6 2877{
782263ab 2878 gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
0f71a2f6
JM
2879}
2880
123dc839
DJ
2881int
2882gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2883{
2884 gdb_assert (gdbarch != NULL);
2885 gdb_assert (gdbarch->remote_register_number != NULL);
2886 if (gdbarch_debug >= 2)
2887 fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2888 return gdbarch->remote_register_number (gdbarch, regno);
2889}
2890
2891void
2892set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2893 gdbarch_remote_register_number_ftype remote_register_number)
2894{
2895 gdbarch->remote_register_number = remote_register_number;
2896}
2897
b2756930
KB
2898int
2899gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2900{
2901 gdb_assert (gdbarch != NULL);
2902 return gdbarch->fetch_tls_load_module_address != NULL;
2903}
2904
2905CORE_ADDR
2906gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2907{
2908 gdb_assert (gdbarch != NULL);
2909 gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2910 if (gdbarch_debug >= 2)
2911 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2912 return gdbarch->fetch_tls_load_module_address (objfile);
2913}
2914
2915void
2916set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2917 gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2918{
2919 gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2920}
2921
0f71a2f6 2922CORE_ADDR
104c1213 2923gdbarch_frame_args_skip (struct gdbarch *gdbarch)
0f71a2f6 2924{
8de9bdc4 2925 gdb_assert (gdbarch != NULL);
5867a2fb 2926 /* Skip verify of frame_args_skip, invalid_p == 0 */
0f71a2f6 2927 if (gdbarch_debug >= 2)
0f71a2f6
JM
2928 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2929 return gdbarch->frame_args_skip;
2930}
2931
2932void
104c1213
JM
2933set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2934 CORE_ADDR frame_args_skip)
0f71a2f6
JM
2935{
2936 gdbarch->frame_args_skip = frame_args_skip;
2937}
2938
12cc2063
AC
2939int
2940gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2941{
2942 gdb_assert (gdbarch != NULL);
956ac328 2943 return gdbarch->unwind_pc != NULL;
12cc2063
AC
2944}
2945
2946CORE_ADDR
2947gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2948{
2949 gdb_assert (gdbarch != NULL);
956ac328 2950 gdb_assert (gdbarch->unwind_pc != NULL);
12cc2063
AC
2951 if (gdbarch_debug >= 2)
2952 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2953 return gdbarch->unwind_pc (gdbarch, next_frame);
2954}
2955
2956void
2957set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2958 gdbarch_unwind_pc_ftype unwind_pc)
2959{
2960 gdbarch->unwind_pc = unwind_pc;
2961}
2962
a9e5fdc2
AC
2963int
2964gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2965{
2966 gdb_assert (gdbarch != NULL);
956ac328 2967 return gdbarch->unwind_sp != NULL;
a9e5fdc2
AC
2968}
2969
2970CORE_ADDR
2971gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2972{
2973 gdb_assert (gdbarch != NULL);
956ac328 2974 gdb_assert (gdbarch->unwind_sp != NULL);
a9e5fdc2
AC
2975 if (gdbarch_debug >= 2)
2976 fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2977 return gdbarch->unwind_sp (gdbarch, next_frame);
2978}
2979
2980void
2981set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2982 gdbarch_unwind_sp_ftype unwind_sp)
2983{
2984 gdbarch->unwind_sp = unwind_sp;
2985}
2986
983a287a
AC
2987int
2988gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2989{
2990 gdb_assert (gdbarch != NULL);
956ac328 2991 return gdbarch->frame_num_args != NULL;
983a287a
AC
2992}
2993
0f71a2f6
JM
2994int
2995gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2996{
8de9bdc4 2997 gdb_assert (gdbarch != NULL);
956ac328 2998 gdb_assert (gdbarch->frame_num_args != NULL);
0f71a2f6 2999 if (gdbarch_debug >= 2)
0f71a2f6
JM
3000 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
3001 return gdbarch->frame_num_args (frame);
3002}
3003
3004void
104c1213
JM
3005set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
3006 gdbarch_frame_num_args_ftype frame_num_args)
0f71a2f6
JM
3007{
3008 gdbarch->frame_num_args = frame_num_args;
3009}
3010
dc604539
AC
3011int
3012gdbarch_frame_align_p (struct gdbarch *gdbarch)
3013{
3014 gdb_assert (gdbarch != NULL);
956ac328 3015 return gdbarch->frame_align != NULL;
dc604539
AC
3016}
3017
3018CORE_ADDR
3019gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
3020{
3021 gdb_assert (gdbarch != NULL);
956ac328 3022 gdb_assert (gdbarch->frame_align != NULL);
dc604539
AC
3023 if (gdbarch_debug >= 2)
3024 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
3025 return gdbarch->frame_align (gdbarch, address);
3026}
3027
3028void
3029set_gdbarch_frame_align (struct gdbarch *gdbarch,
3030 gdbarch_frame_align_ftype frame_align)
3031{
3032 gdbarch->frame_align = frame_align;
3033}
3034
192cb3d4
MK
3035int
3036gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
3037{
3038 gdb_assert (gdbarch != NULL);
3039 gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
3040 if (gdbarch_debug >= 2)
3041 fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
3042 return gdbarch->stabs_argument_has_addr (gdbarch, type);
3043}
3044
3045void
3046set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
3047 gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
3048{
3049 gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
3050}
3051
8b148df9
AC
3052int
3053gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
3054{
3055 gdb_assert (gdbarch != NULL);
3056 if (gdbarch_debug >= 2)
3057 fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
3058 return gdbarch->frame_red_zone_size;
3059}
3060
3061void
3062set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
3063 int frame_red_zone_size)
3064{
3065 gdbarch->frame_red_zone_size = frame_red_zone_size;
3066}
3067
f517ea4e 3068CORE_ADDR
e2d0e7eb 3069gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
f517ea4e 3070{
8de9bdc4 3071 gdb_assert (gdbarch != NULL);
956ac328 3072 gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
f517ea4e
PS
3073 if (gdbarch_debug >= 2)
3074 fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
e2d0e7eb 3075 return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
f517ea4e
PS
3076}
3077
3078void
3079set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
3080 gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
3081{
3082 gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
3083}
3084
875e1767
AC
3085CORE_ADDR
3086gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
3087{
8de9bdc4 3088 gdb_assert (gdbarch != NULL);
956ac328 3089 gdb_assert (gdbarch->addr_bits_remove != NULL);
875e1767
AC
3090 if (gdbarch_debug >= 2)
3091 fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
24568a2c 3092 return gdbarch->addr_bits_remove (gdbarch, addr);
875e1767
AC
3093}
3094
3095void
3096set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
3097 gdbarch_addr_bits_remove_ftype addr_bits_remove)
3098{
3099 gdbarch->addr_bits_remove = addr_bits_remove;
3100}
3101
64c4637f
AC
3102int
3103gdbarch_software_single_step_p (struct gdbarch *gdbarch)
3104{
8de9bdc4 3105 gdb_assert (gdbarch != NULL);
956ac328 3106 return gdbarch->software_single_step != NULL;
64c4637f
AC
3107}
3108
e6590a1b 3109int
0b1b3e42 3110gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
64c4637f 3111{
8de9bdc4 3112 gdb_assert (gdbarch != NULL);
956ac328 3113 gdb_assert (gdbarch->software_single_step != NULL);
64c4637f
AC
3114 if (gdbarch_debug >= 2)
3115 fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
0b1b3e42 3116 return gdbarch->software_single_step (frame);
64c4637f
AC
3117}
3118
3119void
3120set_gdbarch_software_single_step (struct gdbarch *gdbarch,
3121 gdbarch_software_single_step_ftype software_single_step)
3122{
3123 gdbarch->software_single_step = software_single_step;
3124}
3125
3352ef37
AC
3126int
3127gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
3128{
3129 gdb_assert (gdbarch != NULL);
3130 return gdbarch->single_step_through_delay != NULL;
3131}
3132
3133int
3134gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
3135{
3136 gdb_assert (gdbarch != NULL);
3137 gdb_assert (gdbarch->single_step_through_delay != NULL);
3138 if (gdbarch_debug >= 2)
3139 fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
3140 return gdbarch->single_step_through_delay (gdbarch, frame);
3141}
3142
3143void
3144set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
3145 gdbarch_single_step_through_delay_ftype single_step_through_delay)
3146{
3147 gdbarch->single_step_through_delay = single_step_through_delay;
3148}
3149
2bf0cb65 3150int
a89aa300 3151gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2bf0cb65 3152{
8de9bdc4 3153 gdb_assert (gdbarch != NULL);
956ac328 3154 gdb_assert (gdbarch->print_insn != NULL);
2bf0cb65
EZ
3155 if (gdbarch_debug >= 2)
3156 fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
3157 return gdbarch->print_insn (vma, info);
3158}
3159
3160void
3161set_gdbarch_print_insn (struct gdbarch *gdbarch,
3162 gdbarch_print_insn_ftype print_insn)
3163{
3164 gdbarch->print_insn = print_insn;
3165}
3166
bdcd319a 3167CORE_ADDR
52f729a7 3168gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
bdcd319a 3169{
8de9bdc4 3170 gdb_assert (gdbarch != NULL);
956ac328 3171 gdb_assert (gdbarch->skip_trampoline_code != NULL);
bdcd319a
CV
3172 if (gdbarch_debug >= 2)
3173 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
52f729a7 3174 return gdbarch->skip_trampoline_code (frame, pc);
bdcd319a
CV
3175}
3176
3177void
3178set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
3179 gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
3180{
3181 gdbarch->skip_trampoline_code = skip_trampoline_code;
3182}
3183
dea0c52f
MK
3184CORE_ADDR
3185gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
3186{
3187 gdb_assert (gdbarch != NULL);
3188 gdb_assert (gdbarch->skip_solib_resolver != NULL);
3189 if (gdbarch_debug >= 2)
3190 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
4c8c40e6 3191 return gdbarch->skip_solib_resolver (gdbarch, pc);
dea0c52f
MK
3192}
3193
3194void
3195set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
3196 gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
3197{
3198 gdbarch->skip_solib_resolver = skip_solib_resolver;
3199}
3200
d50355b6 3201int
2c02bd72 3202gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, const char *name)
d50355b6
MS
3203{
3204 gdb_assert (gdbarch != NULL);
956ac328 3205 gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
d50355b6
MS
3206 if (gdbarch_debug >= 2)
3207 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
e17a4113 3208 return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
d50355b6
MS
3209}
3210
3211void
3212set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
3213 gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
3214{
3215 gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
3216}
3217
c12260ac
CV
3218int
3219gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
3220{
8de9bdc4 3221 gdb_assert (gdbarch != NULL);
956ac328 3222 gdb_assert (gdbarch->in_function_epilogue_p != NULL);
c12260ac
CV
3223 if (gdbarch_debug >= 2)
3224 fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
3225 return gdbarch->in_function_epilogue_p (gdbarch, addr);
3226}
3227
3228void
3229set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
3230 gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
3231{
3232 gdbarch->in_function_epilogue_p = in_function_epilogue_p;
3233}
3234
a2cf933a
EZ
3235void
3236gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
3237{
8de9bdc4 3238 gdb_assert (gdbarch != NULL);
956ac328 3239 gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
a2cf933a
EZ
3240 if (gdbarch_debug >= 2)
3241 fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
3242 gdbarch->elf_make_msymbol_special (sym, msym);
3243}
3244
3245void
3246set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
3247 gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
3248{
3249 gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
3250}
3251
3252void
3253gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
3254{
8de9bdc4 3255 gdb_assert (gdbarch != NULL);
956ac328 3256 gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
a2cf933a
EZ
3257 if (gdbarch_debug >= 2)
3258 fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
3259 gdbarch->coff_make_msymbol_special (val, msym);
3260}
3261
3262void
3263set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
3264 gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
3265{
3266 gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
3267}
3268
c4ed33b9
AC
3269int
3270gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
3271{
3272 gdb_assert (gdbarch != NULL);
3273 /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
3274 if (gdbarch_debug >= 2)
3275 fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
3276 return gdbarch->cannot_step_breakpoint;
3277}
3278
3279void
3280set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
3281 int cannot_step_breakpoint)
3282{
3283 gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
3284}
3285
f74fa174
MM
3286int
3287gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
3288{
3289 gdb_assert (gdbarch != NULL);
3290 /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
3291 if (gdbarch_debug >= 2)
3292 fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
3293 return gdbarch->have_nonsteppable_watchpoint;
3294}
3295
3296void
3297set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
967c0d83 3298 int have_nonsteppable_watchpoint)
f74fa174
MM
3299{
3300 gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
3301}
3302
8b2dbe47
KB
3303int
3304gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
3305{
3306 gdb_assert (gdbarch != NULL);
956ac328 3307 return gdbarch->address_class_type_flags != NULL;
8b2dbe47
KB
3308}
3309
3310int
3311gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
3312{
3313 gdb_assert (gdbarch != NULL);
956ac328 3314 gdb_assert (gdbarch->address_class_type_flags != NULL);
8b2dbe47
KB
3315 if (gdbarch_debug >= 2)
3316 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
3317 return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
3318}
3319
3320void
3321set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
3322 gdbarch_address_class_type_flags_ftype address_class_type_flags)
3323{
3324 gdbarch->address_class_type_flags = address_class_type_flags;
3325}
3326
3327int
3328gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
3329{
3330 gdb_assert (gdbarch != NULL);
956ac328 3331 return gdbarch->address_class_type_flags_to_name != NULL;
8b2dbe47
KB
3332}
3333
321432c0 3334const char *
8b2dbe47
KB
3335gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
3336{
3337 gdb_assert (gdbarch != NULL);
956ac328 3338 gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
8b2dbe47
KB
3339 if (gdbarch_debug >= 2)
3340 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
5f11f355 3341 return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
8b2dbe47
KB
3342}
3343
3344void
3345set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
3346 gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
3347{
3348 gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
3349}
3350
3351int
3352gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
3353{
3354 gdb_assert (gdbarch != NULL);
956ac328 3355 return gdbarch->address_class_name_to_type_flags != NULL;
8b2dbe47
KB
3356}
3357
3358int
321432c0 3359gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
8b2dbe47
KB
3360{
3361 gdb_assert (gdbarch != NULL);
956ac328 3362 gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
8b2dbe47
KB
3363 if (gdbarch_debug >= 2)
3364 fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
5f11f355 3365 return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
8b2dbe47
KB
3366}
3367
3368void
3369set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
3370 gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
3371{
3372 gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
3373}
3374
b59ff9d5
AC
3375int
3376gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
3377{
3378 gdb_assert (gdbarch != NULL);
956ac328 3379 gdb_assert (gdbarch->register_reggroup_p != NULL);
b59ff9d5
AC
3380 if (gdbarch_debug >= 2)
3381 fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
3382 return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
3383}
3384
3385void
3386set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
3387 gdbarch_register_reggroup_p_ftype register_reggroup_p)
3388{
3389 gdbarch->register_reggroup_p = register_reggroup_p;
3390}
3391
143985b7
AF
3392int
3393gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
3394{
3395 gdb_assert (gdbarch != NULL);
956ac328 3396 return gdbarch->fetch_pointer_argument != NULL;
143985b7
AF
3397}
3398
3399CORE_ADDR
3400gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
3401{
3402 gdb_assert (gdbarch != NULL);
956ac328 3403 gdb_assert (gdbarch->fetch_pointer_argument != NULL);
143985b7
AF
3404 if (gdbarch_debug >= 2)
3405 fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
3406 return gdbarch->fetch_pointer_argument (frame, argi, type);
3407}
3408
3409void
3410set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
3411 gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
3412{
3413 gdbarch->fetch_pointer_argument = fetch_pointer_argument;
3414}
3415
6ce6d90f
MK
3416int
3417gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
3418{
3419 gdb_assert (gdbarch != NULL);
3420 return gdbarch->regset_from_core_section != NULL;
3421}
3422
3423const struct regset *
3424gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
3425{
3426 gdb_assert (gdbarch != NULL);
3427 gdb_assert (gdbarch->regset_from_core_section != NULL);
3428 if (gdbarch_debug >= 2)
3429 fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
3430 return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
3431}
3432
3433void
3434set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
3435 gdbarch_regset_from_core_section_ftype regset_from_core_section)
3436{
3437 gdbarch->regset_from_core_section = regset_from_core_section;
3438}
3439
17ea7499
CES
3440struct core_regset_section *
3441gdbarch_core_regset_sections (struct gdbarch *gdbarch)
3442{
3443 gdb_assert (gdbarch != NULL);
3444 if (gdbarch_debug >= 2)
3445 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
3446 return gdbarch->core_regset_sections;
3447}
3448
3449void
3450set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
3451 struct core_regset_section * core_regset_sections)
3452{
3453 gdbarch->core_regset_sections = core_regset_sections;
3454}
3455
6432734d
UW
3456int
3457gdbarch_make_corefile_notes_p (struct gdbarch *gdbarch)
3458{
3459 gdb_assert (gdbarch != NULL);
3460 return gdbarch->make_corefile_notes != NULL;
3461}
3462
3463char *
3464gdbarch_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
3465{
3466 gdb_assert (gdbarch != NULL);
3467 gdb_assert (gdbarch->make_corefile_notes != NULL);
3468 if (gdbarch_debug >= 2)
3469 fprintf_unfiltered (gdb_stdlog, "gdbarch_make_corefile_notes called\n");
3470 return gdbarch->make_corefile_notes (gdbarch, obfd, note_size);
3471}
3472
3473void
3474set_gdbarch_make_corefile_notes (struct gdbarch *gdbarch,
3475 gdbarch_make_corefile_notes_ftype make_corefile_notes)
3476{
3477 gdbarch->make_corefile_notes = make_corefile_notes;
3478}
3479
b3ac9c77
SDJ
3480int
3481gdbarch_elfcore_write_linux_prpsinfo_p (struct gdbarch *gdbarch)
3482{
3483 gdb_assert (gdbarch != NULL);
3484 return gdbarch->elfcore_write_linux_prpsinfo != NULL;
3485}
3486
3487char *
3488gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch, bfd *obfd, char *note_data, int *note_size, const struct elf_internal_linux_prpsinfo *info)
3489{
3490 gdb_assert (gdbarch != NULL);
3491 gdb_assert (gdbarch->elfcore_write_linux_prpsinfo != NULL);
3492 if (gdbarch_debug >= 2)
3493 fprintf_unfiltered (gdb_stdlog, "gdbarch_elfcore_write_linux_prpsinfo called\n");
3494 return gdbarch->elfcore_write_linux_prpsinfo (obfd, note_data, note_size, info);
3495}
3496
3497void
3498set_gdbarch_elfcore_write_linux_prpsinfo (struct gdbarch *gdbarch,
3499 gdbarch_elfcore_write_linux_prpsinfo_ftype elfcore_write_linux_prpsinfo)
3500{
3501 gdbarch->elfcore_write_linux_prpsinfo = elfcore_write_linux_prpsinfo;
3502}
3503
35c2fab7
UW
3504int
3505gdbarch_find_memory_regions_p (struct gdbarch *gdbarch)
3506{
3507 gdb_assert (gdbarch != NULL);
3508 return gdbarch->find_memory_regions != NULL;
3509}
3510
3511int
3512gdbarch_find_memory_regions (struct gdbarch *gdbarch, find_memory_region_ftype func, void *data)
3513{
3514 gdb_assert (gdbarch != NULL);
3515 gdb_assert (gdbarch->find_memory_regions != NULL);
3516 if (gdbarch_debug >= 2)
3517 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_memory_regions called\n");
3518 return gdbarch->find_memory_regions (gdbarch, func, data);
3519}
3520
3521void
3522set_gdbarch_find_memory_regions (struct gdbarch *gdbarch,
3523 gdbarch_find_memory_regions_ftype find_memory_regions)
3524{
3525 gdbarch->find_memory_regions = find_memory_regions;
3526}
3527
de584861
PA
3528int
3529gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
3530{
3531 gdb_assert (gdbarch != NULL);
3532 return gdbarch->core_xfer_shared_libraries != NULL;
3533}
3534
3535LONGEST
7ec1862d 3536gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
de584861
PA
3537{
3538 gdb_assert (gdbarch != NULL);
3539 gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
3540 if (gdbarch_debug >= 2)
3541 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
3542 return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
3543}
3544
3545void
3546set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
3547 gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
3548{
3549 gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
3550}
3551
356a5233
JB
3552int
3553gdbarch_core_xfer_shared_libraries_aix_p (struct gdbarch *gdbarch)
3554{
3555 gdb_assert (gdbarch != NULL);
3556 return gdbarch->core_xfer_shared_libraries_aix != NULL;
3557}
3558
3559LONGEST
7ec1862d 3560gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
356a5233
JB
3561{
3562 gdb_assert (gdbarch != NULL);
3563 gdb_assert (gdbarch->core_xfer_shared_libraries_aix != NULL);
3564 if (gdbarch_debug >= 2)
3565 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries_aix called\n");
3566 return gdbarch->core_xfer_shared_libraries_aix (gdbarch, readbuf, offset, len);
3567}
3568
3569void
3570set_gdbarch_core_xfer_shared_libraries_aix (struct gdbarch *gdbarch,
3571 gdbarch_core_xfer_shared_libraries_aix_ftype core_xfer_shared_libraries_aix)
3572{
3573 gdbarch->core_xfer_shared_libraries_aix = core_xfer_shared_libraries_aix;
3574}
3575
28439f5e
PA
3576int
3577gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
3578{
3579 gdb_assert (gdbarch != NULL);
3580 return gdbarch->core_pid_to_str != NULL;
3581}
3582
3583char *
3584gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
3585{
3586 gdb_assert (gdbarch != NULL);
3587 gdb_assert (gdbarch->core_pid_to_str != NULL);
3588 if (gdbarch_debug >= 2)
3589 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
3590 return gdbarch->core_pid_to_str (gdbarch, ptid);
3591}
3592
3593void
3594set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
3595 gdbarch_core_pid_to_str_ftype core_pid_to_str)
3596{
3597 gdbarch->core_pid_to_str = core_pid_to_str;
3598}
3599
a78c2d62
UW
3600int
3601gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
3602{
3603 gdb_assert (gdbarch != NULL);
3604 return gdbarch->gcore_bfd_target != 0;
3605}
3606
3607const char *
3608gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
3609{
3610 gdb_assert (gdbarch != NULL);
3611 /* Check variable changed from pre-default. */
3612 gdb_assert (gdbarch->gcore_bfd_target != 0);
3613 if (gdbarch_debug >= 2)
3614 fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
3615 return gdbarch->gcore_bfd_target;
3616}
3617
3618void
3619set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
3620 const char * gcore_bfd_target)
3621{
3622 gdbarch->gcore_bfd_target = gcore_bfd_target;
3623}
3624
0d5de010
DJ
3625int
3626gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
3627{
3628 gdb_assert (gdbarch != NULL);
3629 /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
3630 if (gdbarch_debug >= 2)
3631 fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
3632 return gdbarch->vtable_function_descriptors;
3633}
3634
3635void
3636set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
3637 int vtable_function_descriptors)
3638{
3639 gdbarch->vtable_function_descriptors = vtable_function_descriptors;
3640}
3641
3642int
3643gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
3644{
3645 gdb_assert (gdbarch != NULL);
3646 /* Skip verify of vbit_in_delta, invalid_p == 0 */
3647 if (gdbarch_debug >= 2)
3648 fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
3649 return gdbarch->vbit_in_delta;
3650}
3651
3652void
3653set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
3654 int vbit_in_delta)
3655{
3656 gdbarch->vbit_in_delta = vbit_in_delta;
3657}
3658
6d350bb5
UW
3659int
3660gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
3661{
3662 gdb_assert (gdbarch != NULL);
3663 return gdbarch->skip_permanent_breakpoint != NULL;
3664}
3665
3666void
3667gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
3668{
3669 gdb_assert (gdbarch != NULL);
3670 gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
3671 if (gdbarch_debug >= 2)
3672 fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
3673 gdbarch->skip_permanent_breakpoint (regcache);
3674}
3675
3676void
3677set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
3678 gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
3679{
3680 gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
3681}
3682
237fc4c9
PA
3683int
3684gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
3685{
3686 gdb_assert (gdbarch != NULL);
3687 return gdbarch->max_insn_length != 0;
3688}
3689
3690ULONGEST
3691gdbarch_max_insn_length (struct gdbarch *gdbarch)
3692{
3693 gdb_assert (gdbarch != NULL);
3694 /* Check variable changed from pre-default. */
3695 gdb_assert (gdbarch->max_insn_length != 0);
3696 if (gdbarch_debug >= 2)
3697 fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
3698 return gdbarch->max_insn_length;
3699}
3700
3701void
3702set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
3703 ULONGEST max_insn_length)
3704{
3705 gdbarch->max_insn_length = max_insn_length;
3706}
3707
3708int
3709gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
3710{
3711 gdb_assert (gdbarch != NULL);
3712 return gdbarch->displaced_step_copy_insn != NULL;
3713}
3714
3715struct displaced_step_closure *
3716gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3717{
3718 gdb_assert (gdbarch != NULL);
3719 gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
3720 if (gdbarch_debug >= 2)
3721 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3722 return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3723}
3724
3725void
3726set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3727 gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3728{
3729 gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3730}
3731
99e40580
UW
3732int
3733gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3734{
3735 gdb_assert (gdbarch != NULL);
3736 gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
3737 if (gdbarch_debug >= 2)
3738 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
3739 return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
3740}
3741
3742void
3743set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
3744 gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
3745{
3746 gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
3747}
3748
237fc4c9
PA
3749int
3750gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3751{
3752 gdb_assert (gdbarch != NULL);
3753 return gdbarch->displaced_step_fixup != NULL;
3754}
3755
3756void
3757gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3758{
3759 gdb_assert (gdbarch != NULL);
3760 gdb_assert (gdbarch->displaced_step_fixup != NULL);
3761 /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call. */
3762 if (gdbarch_debug >= 2)
3763 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3764 gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3765}
3766
3767void
3768set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3769 gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3770{
3771 gdbarch->displaced_step_fixup = displaced_step_fixup;
3772}
3773
3774void
3775gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3776{
3777 gdb_assert (gdbarch != NULL);
3778 gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3779 if (gdbarch_debug >= 2)
3780 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3781 gdbarch->displaced_step_free_closure (gdbarch, closure);
3782}
3783
3784void
3785set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3786 gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3787{
3788 gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3789}
3790
3791CORE_ADDR
3792gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3793{
3794 gdb_assert (gdbarch != NULL);
3795 gdb_assert (gdbarch->displaced_step_location != NULL);
3796 if (gdbarch_debug >= 2)
3797 fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3798 return gdbarch->displaced_step_location (gdbarch);
3799}
3800
3801void
3802set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3803 gdbarch_displaced_step_location_ftype displaced_step_location)
3804{
3805 gdbarch->displaced_step_location = displaced_step_location;
3806}
3807
dde08ee1
PA
3808int
3809gdbarch_relocate_instruction_p (struct gdbarch *gdbarch)
3810{
3811 gdb_assert (gdbarch != NULL);
3812 return gdbarch->relocate_instruction != NULL;
3813}
3814
3815void
3816gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
3817{
3818 gdb_assert (gdbarch != NULL);
3819 gdb_assert (gdbarch->relocate_instruction != NULL);
3820 /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call. */
3821 if (gdbarch_debug >= 2)
3822 fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n");
3823 gdbarch->relocate_instruction (gdbarch, to, from);
3824}
3825
3826void
3827set_gdbarch_relocate_instruction (struct gdbarch *gdbarch,
3828 gdbarch_relocate_instruction_ftype relocate_instruction)
3829{
3830 gdbarch->relocate_instruction = relocate_instruction;
3831}
3832
1c772458
UW
3833int
3834gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3835{
3836 gdb_assert (gdbarch != NULL);
3837 return gdbarch->overlay_update != NULL;
3838}
3839
3840void
3841gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3842{
3843 gdb_assert (gdbarch != NULL);
3844 gdb_assert (gdbarch->overlay_update != NULL);
3845 if (gdbarch_debug >= 2)
3846 fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3847 gdbarch->overlay_update (osect);
3848}
3849
3850void
3851set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3852 gdbarch_overlay_update_ftype overlay_update)
3853{
3854 gdbarch->overlay_update = overlay_update;
3855}
3856
4eb0ad19
DJ
3857int
3858gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3859{
3860 gdb_assert (gdbarch != NULL);
3861 return gdbarch->core_read_description != NULL;
3862}
3863
3864const struct target_desc *
3865gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3866{
3867 gdb_assert (gdbarch != NULL);
3868 gdb_assert (gdbarch->core_read_description != NULL);
3869 if (gdbarch_debug >= 2)
3870 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3871 return gdbarch->core_read_description (gdbarch, target, abfd);
3872}
3873
3874void
3875set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3876 gdbarch_core_read_description_ftype core_read_description)
3877{
3878 gdbarch->core_read_description = core_read_description;
3879}
3880
149ad273
UW
3881int
3882gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3883{
3884 gdb_assert (gdbarch != NULL);
3885 return gdbarch->static_transform_name != NULL;
3886}
3887
0d5cff50
DE
3888const char *
3889gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name)
149ad273
UW
3890{
3891 gdb_assert (gdbarch != NULL);
3892 gdb_assert (gdbarch->static_transform_name != NULL);
3893 if (gdbarch_debug >= 2)
3894 fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3895 return gdbarch->static_transform_name (name);
3896}
3897
3898void
3899set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3900 gdbarch_static_transform_name_ftype static_transform_name)
3901{
3902 gdbarch->static_transform_name = static_transform_name;
3903}
3904
203c3895
UW
3905int
3906gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3907{
3908 gdb_assert (gdbarch != NULL);
3909 /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3910 if (gdbarch_debug >= 2)
3911 fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3912 return gdbarch->sofun_address_maybe_missing;
3913}
3914
3915void
3916set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3917 int sofun_address_maybe_missing)
3918{
3919 gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3920}
3921
0508c3ec
HZ
3922int
3923gdbarch_process_record_p (struct gdbarch *gdbarch)
3924{
3925 gdb_assert (gdbarch != NULL);
3926 return gdbarch->process_record != NULL;
3927}
3928
3929int
3930gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
3931{
3932 gdb_assert (gdbarch != NULL);
3933 gdb_assert (gdbarch->process_record != NULL);
3934 if (gdbarch_debug >= 2)
3935 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
3936 return gdbarch->process_record (gdbarch, regcache, addr);
3937}
3938
3939void
3940set_gdbarch_process_record (struct gdbarch *gdbarch,
3941 gdbarch_process_record_ftype process_record)
3942{
3943 gdbarch->process_record = process_record;
3944}
3945
3846b520
HZ
3946int
3947gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
3948{
3949 gdb_assert (gdbarch != NULL);
3950 return gdbarch->process_record_signal != NULL;
3951}
3952
3953int
2ea28649 3954gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum gdb_signal signal)
3846b520
HZ
3955{
3956 gdb_assert (gdbarch != NULL);
3957 gdb_assert (gdbarch->process_record_signal != NULL);
3958 if (gdbarch_debug >= 2)
3959 fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
3960 return gdbarch->process_record_signal (gdbarch, regcache, signal);
3961}
3962
3963void
3964set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
3965 gdbarch_process_record_signal_ftype process_record_signal)
3966{
3967 gdbarch->process_record_signal = process_record_signal;
3968}
3969
1f8cf220
PA
3970int
3971gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch)
3972{
3973 gdb_assert (gdbarch != NULL);
3974 return gdbarch->gdb_signal_from_target != NULL;
3975}
3976
2ea28649 3977enum gdb_signal
22203bbf 3978gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo)
1cded358
AR
3979{
3980 gdb_assert (gdbarch != NULL);
22203bbf 3981 gdb_assert (gdbarch->gdb_signal_from_target != NULL);
1cded358 3982 if (gdbarch_debug >= 2)
22203bbf
PA
3983 fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_from_target called\n");
3984 return gdbarch->gdb_signal_from_target (gdbarch, signo);
1cded358
AR
3985}
3986
3987void
22203bbf
PA
3988set_gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch,
3989 gdbarch_gdb_signal_from_target_ftype gdb_signal_from_target)
1cded358 3990{
22203bbf 3991 gdbarch->gdb_signal_from_target = gdb_signal_from_target;
1cded358
AR
3992}
3993
eb14d406
SDJ
3994int
3995gdbarch_gdb_signal_to_target_p (struct gdbarch *gdbarch)
3996{
3997 gdb_assert (gdbarch != NULL);
3998 return gdbarch->gdb_signal_to_target != NULL;
3999}
4000
4001int
4002gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch, enum gdb_signal signal)
4003{
4004 gdb_assert (gdbarch != NULL);
4005 gdb_assert (gdbarch->gdb_signal_to_target != NULL);
4006 if (gdbarch_debug >= 2)
4007 fprintf_unfiltered (gdb_stdlog, "gdbarch_gdb_signal_to_target called\n");
4008 return gdbarch->gdb_signal_to_target (gdbarch, signal);
4009}
4010
4011void
4012set_gdbarch_gdb_signal_to_target (struct gdbarch *gdbarch,
4013 gdbarch_gdb_signal_to_target_ftype gdb_signal_to_target)
4014{
4015 gdbarch->gdb_signal_to_target = gdb_signal_to_target;
4016}
4017
4aa995e1
PA
4018int
4019gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
4020{
4021 gdb_assert (gdbarch != NULL);
4022 return gdbarch->get_siginfo_type != NULL;
4023}
4024
4025struct type *
4026gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
4027{
4028 gdb_assert (gdbarch != NULL);
4029 gdb_assert (gdbarch->get_siginfo_type != NULL);
4030 if (gdbarch_debug >= 2)
4031 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
4032 return gdbarch->get_siginfo_type (gdbarch);
4033}
4034
4035void
4036set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
4037 gdbarch_get_siginfo_type_ftype get_siginfo_type)
4038{
4039 gdbarch->get_siginfo_type = get_siginfo_type;
4040}
4041
60c5725c
DJ
4042int
4043gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
4044{
4045 gdb_assert (gdbarch != NULL);
4046 return gdbarch->record_special_symbol != NULL;
4047}
4048
4049void
4050gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
4051{
4052 gdb_assert (gdbarch != NULL);
4053 gdb_assert (gdbarch->record_special_symbol != NULL);
4054 if (gdbarch_debug >= 2)
4055 fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
4056 gdbarch->record_special_symbol (gdbarch, objfile, sym);
4057}
4058
4059void
4060set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
4061 gdbarch_record_special_symbol_ftype record_special_symbol)
4062{
4063 gdbarch->record_special_symbol = record_special_symbol;
4064}
4065
a96d9b2e
SDJ
4066int
4067gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
4068{
4069 gdb_assert (gdbarch != NULL);
4070 return gdbarch->get_syscall_number != NULL;
4071}
4072
4073LONGEST
4074gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
4075{
4076 gdb_assert (gdbarch != NULL);
4077 gdb_assert (gdbarch->get_syscall_number != NULL);
4078 if (gdbarch_debug >= 2)
4079 fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
4080 return gdbarch->get_syscall_number (gdbarch, ptid);
4081}
4082
4083void
4084set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
4085 gdbarch_get_syscall_number_ftype get_syscall_number)
4086{
4087 gdbarch->get_syscall_number = get_syscall_number;
4088}
4089
05c0465e
SDJ
4090const char *const *
4091gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4092{
4093 gdb_assert (gdbarch != NULL);
05c0465e 4094 /* Skip verify of stap_integer_prefixes, invalid_p == 0 */
55aa24fb 4095 if (gdbarch_debug >= 2)
05c0465e
SDJ
4096 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_prefixes called\n");
4097 return gdbarch->stap_integer_prefixes;
55aa24fb
SDJ
4098}
4099
4100void
05c0465e
SDJ
4101set_gdbarch_stap_integer_prefixes (struct gdbarch *gdbarch,
4102 const char *const * stap_integer_prefixes)
55aa24fb 4103{
05c0465e 4104 gdbarch->stap_integer_prefixes = stap_integer_prefixes;
55aa24fb
SDJ
4105}
4106
05c0465e
SDJ
4107const char *const *
4108gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4109{
4110 gdb_assert (gdbarch != NULL);
05c0465e 4111 /* Skip verify of stap_integer_suffixes, invalid_p == 0 */
55aa24fb 4112 if (gdbarch_debug >= 2)
05c0465e
SDJ
4113 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_integer_suffixes called\n");
4114 return gdbarch->stap_integer_suffixes;
55aa24fb
SDJ
4115}
4116
4117void
05c0465e
SDJ
4118set_gdbarch_stap_integer_suffixes (struct gdbarch *gdbarch,
4119 const char *const * stap_integer_suffixes)
55aa24fb 4120{
05c0465e 4121 gdbarch->stap_integer_suffixes = stap_integer_suffixes;
55aa24fb
SDJ
4122}
4123
05c0465e
SDJ
4124const char *const *
4125gdbarch_stap_register_prefixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4126{
4127 gdb_assert (gdbarch != NULL);
05c0465e 4128 /* Skip verify of stap_register_prefixes, invalid_p == 0 */
55aa24fb 4129 if (gdbarch_debug >= 2)
05c0465e
SDJ
4130 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_prefixes called\n");
4131 return gdbarch->stap_register_prefixes;
55aa24fb
SDJ
4132}
4133
4134void
05c0465e
SDJ
4135set_gdbarch_stap_register_prefixes (struct gdbarch *gdbarch,
4136 const char *const * stap_register_prefixes)
55aa24fb 4137{
05c0465e 4138 gdbarch->stap_register_prefixes = stap_register_prefixes;
55aa24fb
SDJ
4139}
4140
05c0465e
SDJ
4141const char *const *
4142gdbarch_stap_register_suffixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4143{
4144 gdb_assert (gdbarch != NULL);
05c0465e 4145 /* Skip verify of stap_register_suffixes, invalid_p == 0 */
55aa24fb 4146 if (gdbarch_debug >= 2)
05c0465e
SDJ
4147 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_suffixes called\n");
4148 return gdbarch->stap_register_suffixes;
55aa24fb
SDJ
4149}
4150
4151void
05c0465e
SDJ
4152set_gdbarch_stap_register_suffixes (struct gdbarch *gdbarch,
4153 const char *const * stap_register_suffixes)
55aa24fb 4154{
05c0465e 4155 gdbarch->stap_register_suffixes = stap_register_suffixes;
55aa24fb
SDJ
4156}
4157
05c0465e
SDJ
4158const char *const *
4159gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4160{
4161 gdb_assert (gdbarch != NULL);
05c0465e 4162 /* Skip verify of stap_register_indirection_prefixes, invalid_p == 0 */
55aa24fb 4163 if (gdbarch_debug >= 2)
05c0465e
SDJ
4164 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_prefixes called\n");
4165 return gdbarch->stap_register_indirection_prefixes;
55aa24fb
SDJ
4166}
4167
4168void
05c0465e
SDJ
4169set_gdbarch_stap_register_indirection_prefixes (struct gdbarch *gdbarch,
4170 const char *const * stap_register_indirection_prefixes)
55aa24fb 4171{
05c0465e 4172 gdbarch->stap_register_indirection_prefixes = stap_register_indirection_prefixes;
55aa24fb
SDJ
4173}
4174
05c0465e
SDJ
4175const char *const *
4176gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch)
55aa24fb
SDJ
4177{
4178 gdb_assert (gdbarch != NULL);
05c0465e 4179 /* Skip verify of stap_register_indirection_suffixes, invalid_p == 0 */
55aa24fb 4180 if (gdbarch_debug >= 2)
05c0465e
SDJ
4181 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_register_indirection_suffixes called\n");
4182 return gdbarch->stap_register_indirection_suffixes;
55aa24fb
SDJ
4183}
4184
4185void
05c0465e
SDJ
4186set_gdbarch_stap_register_indirection_suffixes (struct gdbarch *gdbarch,
4187 const char *const * stap_register_indirection_suffixes)
55aa24fb 4188{
05c0465e 4189 gdbarch->stap_register_indirection_suffixes = stap_register_indirection_suffixes;
55aa24fb
SDJ
4190}
4191
4192const char *
4193gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch)
4194{
4195 gdb_assert (gdbarch != NULL);
4196 /* Skip verify of stap_gdb_register_prefix, invalid_p == 0 */
4197 if (gdbarch_debug >= 2)
4198 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_prefix called\n");
4199 return gdbarch->stap_gdb_register_prefix;
4200}
4201
4202void
4203set_gdbarch_stap_gdb_register_prefix (struct gdbarch *gdbarch,
4204 const char * stap_gdb_register_prefix)
4205{
4206 gdbarch->stap_gdb_register_prefix = stap_gdb_register_prefix;
4207}
4208
4209const char *
4210gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch)
4211{
4212 gdb_assert (gdbarch != NULL);
4213 /* Skip verify of stap_gdb_register_suffix, invalid_p == 0 */
4214 if (gdbarch_debug >= 2)
4215 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_gdb_register_suffix called\n");
4216 return gdbarch->stap_gdb_register_suffix;
4217}
4218
4219void
4220set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch,
4221 const char * stap_gdb_register_suffix)
4222{
4223 gdbarch->stap_gdb_register_suffix = stap_gdb_register_suffix;
4224}
4225
4226int
4227gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch)
4228{
4229 gdb_assert (gdbarch != NULL);
4230 return gdbarch->stap_is_single_operand != NULL;
4231}
4232
4233int
4234gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
4235{
4236 gdb_assert (gdbarch != NULL);
4237 gdb_assert (gdbarch->stap_is_single_operand != NULL);
4238 if (gdbarch_debug >= 2)
4239 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_is_single_operand called\n");
4240 return gdbarch->stap_is_single_operand (gdbarch, s);
4241}
4242
4243void
4244set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch,
4245 gdbarch_stap_is_single_operand_ftype stap_is_single_operand)
4246{
4247 gdbarch->stap_is_single_operand = stap_is_single_operand;
4248}
4249
4250int
4251gdbarch_stap_parse_special_token_p (struct gdbarch *gdbarch)
4252{
4253 gdb_assert (gdbarch != NULL);
4254 return gdbarch->stap_parse_special_token != NULL;
4255}
4256
4257int
4258gdbarch_stap_parse_special_token (struct gdbarch *gdbarch, struct stap_parse_info *p)
4259{
4260 gdb_assert (gdbarch != NULL);
4261 gdb_assert (gdbarch->stap_parse_special_token != NULL);
4262 if (gdbarch_debug >= 2)
4263 fprintf_unfiltered (gdb_stdlog, "gdbarch_stap_parse_special_token called\n");
4264 return gdbarch->stap_parse_special_token (gdbarch, p);
4265}
4266
4267void
4268set_gdbarch_stap_parse_special_token (struct gdbarch *gdbarch,
4269 gdbarch_stap_parse_special_token_ftype stap_parse_special_token)
4270{
4271 gdbarch->stap_parse_special_token = stap_parse_special_token;
4272}
4273
50c71eaf
PA
4274int
4275gdbarch_has_global_solist (struct gdbarch *gdbarch)
4276{
4277 gdb_assert (gdbarch != NULL);
4278 /* Skip verify of has_global_solist, invalid_p == 0 */
4279 if (gdbarch_debug >= 2)
4280 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
4281 return gdbarch->has_global_solist;
4282}
4283
4284void
4285set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
4286 int has_global_solist)
4287{
4288 gdbarch->has_global_solist = has_global_solist;
4289}
4290
2567c7d9
PA
4291int
4292gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
4293{
4294 gdb_assert (gdbarch != NULL);
4295 /* Skip verify of has_global_breakpoints, invalid_p == 0 */
4296 if (gdbarch_debug >= 2)
4297 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
4298 return gdbarch->has_global_breakpoints;
4299}
4300
4301void
4302set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
4303 int has_global_breakpoints)
4304{
4305 gdbarch->has_global_breakpoints = has_global_breakpoints;
4306}
4307
6c95b8df
PA
4308int
4309gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
4310{
4311 gdb_assert (gdbarch != NULL);
4312 gdb_assert (gdbarch->has_shared_address_space != NULL);
4313 if (gdbarch_debug >= 2)
4314 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
4315 return gdbarch->has_shared_address_space (gdbarch);
4316}
4317
4318void
4319set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
4320 gdbarch_has_shared_address_space_ftype has_shared_address_space)
4321{
4322 gdbarch->has_shared_address_space = has_shared_address_space;
4323}
4324
7a697b8d
SS
4325int
4326gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
4327{
4328 gdb_assert (gdbarch != NULL);
4329 gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
4330 if (gdbarch_debug >= 2)
4331 fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
4332 return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
4333}
4334
4335void
4336set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
4337 gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
4338{
4339 gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
4340}
4341
f870a310
TT
4342const char *
4343gdbarch_auto_charset (struct gdbarch *gdbarch)
4344{
4345 gdb_assert (gdbarch != NULL);
4346 gdb_assert (gdbarch->auto_charset != NULL);
4347 if (gdbarch_debug >= 2)
4348 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
4349 return gdbarch->auto_charset ();
4350}
4351
4352void
4353set_gdbarch_auto_charset (struct gdbarch *gdbarch,
4354 gdbarch_auto_charset_ftype auto_charset)
4355{
4356 gdbarch->auto_charset = auto_charset;
4357}
4358
4359const char *
4360gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
4361{
4362 gdb_assert (gdbarch != NULL);
4363 gdb_assert (gdbarch->auto_wide_charset != NULL);
4364 if (gdbarch_debug >= 2)
4365 fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
4366 return gdbarch->auto_wide_charset ();
4367}
4368
4369void
4370set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
4371 gdbarch_auto_wide_charset_ftype auto_wide_charset)
4372{
4373 gdbarch->auto_wide_charset = auto_wide_charset;
4374}
4375
08105857
PA
4376const char *
4377gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
4378{
4379 gdb_assert (gdbarch != NULL);
4380 if (gdbarch_debug >= 2)
4381 fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
4382 return gdbarch->solib_symbols_extension;
4383}
4384
4385void
4386set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
4387 const char * solib_symbols_extension)
4388{
4389 gdbarch->solib_symbols_extension = solib_symbols_extension;
4390}
4391
ab38a727
PA
4392int
4393gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
4394{
4395 gdb_assert (gdbarch != NULL);
4396 /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
4397 if (gdbarch_debug >= 2)
4398 fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
4399 return gdbarch->has_dos_based_file_system;
4400}
4401
4402void
4403set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
4404 int has_dos_based_file_system)
4405{
4406 gdbarch->has_dos_based_file_system = has_dos_based_file_system;
4407}
4408
6710bf39
SS
4409void
4410gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
4411{
4412 gdb_assert (gdbarch != NULL);
4413 gdb_assert (gdbarch->gen_return_address != NULL);
4414 if (gdbarch_debug >= 2)
4415 fprintf_unfiltered (gdb_stdlog, "gdbarch_gen_return_address called\n");
4416 gdbarch->gen_return_address (gdbarch, ax, value, scope);
4417}
4418
4419void
4420set_gdbarch_gen_return_address (struct gdbarch *gdbarch,
4421 gdbarch_gen_return_address_ftype gen_return_address)
4422{
4423 gdbarch->gen_return_address = gen_return_address;
4424}
4425
3030c96e
UW
4426int
4427gdbarch_info_proc_p (struct gdbarch *gdbarch)
4428{
4429 gdb_assert (gdbarch != NULL);
4430 return gdbarch->info_proc != NULL;
4431}
4432
4433void
4434gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
4435{
4436 gdb_assert (gdbarch != NULL);
4437 gdb_assert (gdbarch->info_proc != NULL);
4438 if (gdbarch_debug >= 2)
4439 fprintf_unfiltered (gdb_stdlog, "gdbarch_info_proc called\n");
4440 gdbarch->info_proc (gdbarch, args, what);
4441}
4442
4443void
4444set_gdbarch_info_proc (struct gdbarch *gdbarch,
4445 gdbarch_info_proc_ftype info_proc)
4446{
4447 gdbarch->info_proc = info_proc;
4448}
4449
451b7c33
TT
4450int
4451gdbarch_core_info_proc_p (struct gdbarch *gdbarch)
4452{
4453 gdb_assert (gdbarch != NULL);
4454 return gdbarch->core_info_proc != NULL;
4455}
4456
4457void
4458gdbarch_core_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
4459{
4460 gdb_assert (gdbarch != NULL);
4461 gdb_assert (gdbarch->core_info_proc != NULL);
4462 if (gdbarch_debug >= 2)
4463 fprintf_unfiltered (gdb_stdlog, "gdbarch_core_info_proc called\n");
4464 gdbarch->core_info_proc (gdbarch, args, what);
4465}
4466
4467void
4468set_gdbarch_core_info_proc (struct gdbarch *gdbarch,
4469 gdbarch_core_info_proc_ftype core_info_proc)
4470{
4471 gdbarch->core_info_proc = core_info_proc;
4472}
4473
19630284
JB
4474void
4475gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
4476{
4477 gdb_assert (gdbarch != NULL);
4478 gdb_assert (gdbarch->iterate_over_objfiles_in_search_order != NULL);
4479 if (gdbarch_debug >= 2)
4480 fprintf_unfiltered (gdb_stdlog, "gdbarch_iterate_over_objfiles_in_search_order called\n");
4481 gdbarch->iterate_over_objfiles_in_search_order (gdbarch, cb, cb_data, current_objfile);
4482}
4483
4484void
4485set_gdbarch_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch,
4486 gdbarch_iterate_over_objfiles_in_search_order_ftype iterate_over_objfiles_in_search_order)
4487{
4488 gdbarch->iterate_over_objfiles_in_search_order = iterate_over_objfiles_in_search_order;
4489}
4490
7e35103a
JB
4491struct ravenscar_arch_ops *
4492gdbarch_ravenscar_ops (struct gdbarch *gdbarch)
4493{
4494 gdb_assert (gdbarch != NULL);
4495 /* Skip verify of ravenscar_ops, invalid_p == 0 */
4496 if (gdbarch_debug >= 2)
4497 fprintf_unfiltered (gdb_stdlog, "gdbarch_ravenscar_ops called\n");
4498 return gdbarch->ravenscar_ops;
4499}
4500
4501void
4502set_gdbarch_ravenscar_ops (struct gdbarch *gdbarch,
4503 struct ravenscar_arch_ops * ravenscar_ops)
4504{
4505 gdbarch->ravenscar_ops = ravenscar_ops;
4506}
4507
c2170eef
MM
4508int
4509gdbarch_insn_is_call (struct gdbarch *gdbarch, CORE_ADDR addr)
4510{
4511 gdb_assert (gdbarch != NULL);
4512 gdb_assert (gdbarch->insn_is_call != NULL);
4513 if (gdbarch_debug >= 2)
4514 fprintf_unfiltered (gdb_stdlog, "gdbarch_insn_is_call called\n");
4515 return gdbarch->insn_is_call (gdbarch, addr);
4516}
4517
4518void
4519set_gdbarch_insn_is_call (struct gdbarch *gdbarch,
4520 gdbarch_insn_is_call_ftype insn_is_call)
4521{
4522 gdbarch->insn_is_call = insn_is_call;
4523}
4524
4525int
4526gdbarch_insn_is_ret (struct gdbarch *gdbarch, CORE_ADDR addr)
4527{
4528 gdb_assert (gdbarch != NULL);
4529 gdb_assert (gdbarch->insn_is_ret != NULL);
4530 if (gdbarch_debug >= 2)
4531 fprintf_unfiltered (gdb_stdlog, "gdbarch_insn_is_ret called\n");
4532 return gdbarch->insn_is_ret (gdbarch, addr);
4533}
4534
4535void
4536set_gdbarch_insn_is_ret (struct gdbarch *gdbarch,
4537 gdbarch_insn_is_ret_ftype insn_is_ret)
4538{
4539 gdbarch->insn_is_ret = insn_is_ret;
4540}
4541
4542int
4543gdbarch_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
4544{
4545 gdb_assert (gdbarch != NULL);
4546 gdb_assert (gdbarch->insn_is_jump != NULL);
4547 if (gdbarch_debug >= 2)
4548 fprintf_unfiltered (gdb_stdlog, "gdbarch_insn_is_jump called\n");
4549 return gdbarch->insn_is_jump (gdbarch, addr);
4550}
4551
4552void
4553set_gdbarch_insn_is_jump (struct gdbarch *gdbarch,
4554 gdbarch_insn_is_jump_ftype insn_is_jump)
4555{
4556 gdbarch->insn_is_jump = insn_is_jump;
4557}
4558
0f71a2f6 4559
be5a57e1 4560/* Keep a registry of per-architecture data-pointers required by GDB
0963b4bd 4561 modules. */
0f71a2f6
JM
4562
4563struct gdbarch_data
4564{
95160752 4565 unsigned index;
76860b5f 4566 int init_p;
030f20e1
AC
4567 gdbarch_data_pre_init_ftype *pre_init;
4568 gdbarch_data_post_init_ftype *post_init;
0f71a2f6
JM
4569};
4570
4571struct gdbarch_data_registration
adf40b2e 4572{
adf40b2e
JM
4573 struct gdbarch_data *data;
4574 struct gdbarch_data_registration *next;
4575};
0f71a2f6 4576
be5a57e1 4577struct gdbarch_data_registry
adf40b2e 4578{
95160752 4579 unsigned nr;
adf40b2e
JM
4580 struct gdbarch_data_registration *registrations;
4581};
0f71a2f6 4582
be5a57e1 4583struct gdbarch_data_registry gdbarch_data_registry =
0f71a2f6
JM
4584{
4585 0, NULL,
4586};
4587
030f20e1
AC
4588static struct gdbarch_data *
4589gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
4590 gdbarch_data_post_init_ftype *post_init)
0f71a2f6
JM
4591{
4592 struct gdbarch_data_registration **curr;
05c547f6
MS
4593
4594 /* Append the new registration. */
be5a57e1 4595 for (curr = &gdbarch_data_registry.registrations;
0f71a2f6
JM
4596 (*curr) != NULL;
4597 curr = &(*curr)->next);
70ba0933 4598 (*curr) = XNEW (struct gdbarch_data_registration);
0f71a2f6 4599 (*curr)->next = NULL;
70ba0933 4600 (*curr)->data = XNEW (struct gdbarch_data);
be5a57e1 4601 (*curr)->data->index = gdbarch_data_registry.nr++;
030f20e1
AC
4602 (*curr)->data->pre_init = pre_init;
4603 (*curr)->data->post_init = post_init;
76860b5f 4604 (*curr)->data->init_p = 1;
0f71a2f6
JM
4605 return (*curr)->data;
4606}
4607
030f20e1
AC
4608struct gdbarch_data *
4609gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
4610{
4611 return gdbarch_data_register (pre_init, NULL);
4612}
4613
4614struct gdbarch_data *
4615gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
4616{
4617 return gdbarch_data_register (NULL, post_init);
4618}
0f71a2f6 4619
0963b4bd 4620/* Create/delete the gdbarch data vector. */
95160752
AC
4621
4622static void
b3cc3077 4623alloc_gdbarch_data (struct gdbarch *gdbarch)
95160752 4624{
b3cc3077
JB
4625 gdb_assert (gdbarch->data == NULL);
4626 gdbarch->nr_data = gdbarch_data_registry.nr;
aebd7893 4627 gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
0f71a2f6
JM
4628}
4629
76860b5f 4630/* Initialize the current value of the specified per-architecture
0963b4bd 4631 data-pointer. */
b3cc3077 4632
95160752 4633void
030f20e1
AC
4634deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
4635 struct gdbarch_data *data,
4636 void *pointer)
95160752
AC
4637{
4638 gdb_assert (data->index < gdbarch->nr_data);
aebd7893 4639 gdb_assert (gdbarch->data[data->index] == NULL);
030f20e1 4640 gdb_assert (data->pre_init == NULL);
95160752
AC
4641 gdbarch->data[data->index] = pointer;
4642}
4643
0f71a2f6 4644/* Return the current value of the specified per-architecture
0963b4bd 4645 data-pointer. */
0f71a2f6
JM
4646
4647void *
451fbdda 4648gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
0f71a2f6 4649{
451fbdda 4650 gdb_assert (data->index < gdbarch->nr_data);
030f20e1 4651 if (gdbarch->data[data->index] == NULL)
76860b5f 4652 {
030f20e1
AC
4653 /* The data-pointer isn't initialized, call init() to get a
4654 value. */
4655 if (data->pre_init != NULL)
4656 /* Mid architecture creation: pass just the obstack, and not
4657 the entire architecture, as that way it isn't possible for
4658 pre-init code to refer to undefined architecture
4659 fields. */
4660 gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
4661 else if (gdbarch->initialized_p
4662 && data->post_init != NULL)
4663 /* Post architecture creation: pass the entire architecture
4664 (as all fields are valid), but be careful to also detect
4665 recursive references. */
4666 {
4667 gdb_assert (data->init_p);
4668 data->init_p = 0;
4669 gdbarch->data[data->index] = data->post_init (gdbarch);
4670 data->init_p = 1;
4671 }
4672 else
4673 /* The architecture initialization hasn't completed - punt -
4674 hope that the caller knows what they are doing. Once
4675 deprecated_set_gdbarch_data has been initialized, this can be
4676 changed to an internal error. */
4677 return NULL;
76860b5f
AC
4678 gdb_assert (gdbarch->data[data->index] != NULL);
4679 }
451fbdda 4680 return gdbarch->data[data->index];
0f71a2f6
JM
4681}
4682
4683
0963b4bd 4684/* Keep a registry of the architectures known by GDB. */
0f71a2f6 4685
4b9b3959 4686struct gdbarch_registration
0f71a2f6
JM
4687{
4688 enum bfd_architecture bfd_architecture;
4689 gdbarch_init_ftype *init;
4b9b3959 4690 gdbarch_dump_tdep_ftype *dump_tdep;
0f71a2f6 4691 struct gdbarch_list *arches;
4b9b3959 4692 struct gdbarch_registration *next;
0f71a2f6
JM
4693};
4694
be5a57e1 4695static struct gdbarch_registration *gdbarch_registry = NULL;
0f71a2f6 4696
b4a20239
AC
4697static void
4698append_name (const char ***buf, int *nr, const char *name)
4699{
4700 *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
4701 (*buf)[*nr] = name;
4702 *nr += 1;
4703}
4704
4705const char **
4706gdbarch_printable_names (void)
4707{
7996bcec 4708 /* Accumulate a list of names based on the registed list of
0963b4bd 4709 architectures. */
7996bcec
AC
4710 int nr_arches = 0;
4711 const char **arches = NULL;
4712 struct gdbarch_registration *rego;
05c547f6 4713
7996bcec
AC
4714 for (rego = gdbarch_registry;
4715 rego != NULL;
4716 rego = rego->next)
b4a20239 4717 {
7996bcec
AC
4718 const struct bfd_arch_info *ap;
4719 ap = bfd_lookup_arch (rego->bfd_architecture, 0);
4720 if (ap == NULL)
4721 internal_error (__FILE__, __LINE__,
e2e0b3e5 4722 _("gdbarch_architecture_names: multi-arch unknown"));
7996bcec
AC
4723 do
4724 {
4725 append_name (&arches, &nr_arches, ap->printable_name);
4726 ap = ap->next;
4727 }
4728 while (ap != NULL);
b4a20239 4729 }
7996bcec
AC
4730 append_name (&arches, &nr_arches, NULL);
4731 return arches;
b4a20239
AC
4732}
4733
4734
0f71a2f6 4735void
4b9b3959
AC
4736gdbarch_register (enum bfd_architecture bfd_architecture,
4737 gdbarch_init_ftype *init,
4738 gdbarch_dump_tdep_ftype *dump_tdep)
0f71a2f6 4739{
4b9b3959 4740 struct gdbarch_registration **curr;
0f71a2f6 4741 const struct bfd_arch_info *bfd_arch_info;
05c547f6 4742
ec3d358c 4743 /* Check that BFD recognizes this architecture */
0f71a2f6
JM
4744 bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
4745 if (bfd_arch_info == NULL)
4746 {
8e65ff28 4747 internal_error (__FILE__, __LINE__,
0963b4bd
MS
4748 _("gdbarch: Attempt to register "
4749 "unknown architecture (%d)"),
8e65ff28 4750 bfd_architecture);
0f71a2f6 4751 }
0963b4bd 4752 /* Check that we haven't seen this architecture before. */
be5a57e1 4753 for (curr = &gdbarch_registry;
0f71a2f6
JM
4754 (*curr) != NULL;
4755 curr = &(*curr)->next)
4756 {
4757 if (bfd_architecture == (*curr)->bfd_architecture)
8e65ff28 4758 internal_error (__FILE__, __LINE__,
64b9b334 4759 _("gdbarch: Duplicate registration "
0963b4bd 4760 "of architecture (%s)"),
8e65ff28 4761 bfd_arch_info->printable_name);
0f71a2f6
JM
4762 }
4763 /* log it */
4764 if (gdbarch_debug)
30737ed9 4765 fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
0f71a2f6 4766 bfd_arch_info->printable_name,
30737ed9 4767 host_address_to_string (init));
0f71a2f6 4768 /* Append it */
70ba0933 4769 (*curr) = XNEW (struct gdbarch_registration);
0f71a2f6
JM
4770 (*curr)->bfd_architecture = bfd_architecture;
4771 (*curr)->init = init;
4b9b3959 4772 (*curr)->dump_tdep = dump_tdep;
0f71a2f6
JM
4773 (*curr)->arches = NULL;
4774 (*curr)->next = NULL;
4b9b3959
AC
4775}
4776
4777void
4778register_gdbarch_init (enum bfd_architecture bfd_architecture,
4779 gdbarch_init_ftype *init)
4780{
4781 gdbarch_register (bfd_architecture, init, NULL);
0f71a2f6 4782}
0f71a2f6
JM
4783
4784
424163ea 4785/* Look for an architecture using gdbarch_info. */
0f71a2f6
JM
4786
4787struct gdbarch_list *
104c1213
JM
4788gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
4789 const struct gdbarch_info *info)
0f71a2f6
JM
4790{
4791 for (; arches != NULL; arches = arches->next)
4792 {
4793 if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
4794 continue;
4795 if (info->byte_order != arches->gdbarch->byte_order)
4796 continue;
4be87837
DJ
4797 if (info->osabi != arches->gdbarch->osabi)
4798 continue;
424163ea
DJ
4799 if (info->target_desc != arches->gdbarch->target_desc)
4800 continue;
0f71a2f6
JM
4801 return arches;
4802 }
4803 return NULL;
4804}
4805
4806
ebdba546 4807/* Find an architecture that matches the specified INFO. Create a new
59837fe0 4808 architecture if needed. Return that new architecture. */
0f71a2f6 4809
59837fe0
UW
4810struct gdbarch *
4811gdbarch_find_by_info (struct gdbarch_info info)
0f71a2f6
JM
4812{
4813 struct gdbarch *new_gdbarch;
4b9b3959 4814 struct gdbarch_registration *rego;
0f71a2f6 4815
b732d07d 4816 /* Fill in missing parts of the INFO struct using a number of
7a107747
DJ
4817 sources: "set ..."; INFOabfd supplied; and the global
4818 defaults. */
4819 gdbarch_info_fill (&info);
4be87837 4820
0963b4bd 4821 /* Must have found some sort of architecture. */
b732d07d 4822 gdb_assert (info.bfd_arch_info != NULL);
0f71a2f6
JM
4823
4824 if (gdbarch_debug)
4825 {
0f71a2f6 4826 fprintf_unfiltered (gdb_stdlog,
59837fe0 4827 "gdbarch_find_by_info: info.bfd_arch_info %s\n",
0f71a2f6
JM
4828 (info.bfd_arch_info != NULL
4829 ? info.bfd_arch_info->printable_name
4830 : "(null)"));
4831 fprintf_unfiltered (gdb_stdlog,
59837fe0 4832 "gdbarch_find_by_info: info.byte_order %d (%s)\n",
0f71a2f6 4833 info.byte_order,
d7449b42 4834 (info.byte_order == BFD_ENDIAN_BIG ? "big"
778eb05e 4835 : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
0f71a2f6 4836 : "default"));
4be87837 4837 fprintf_unfiltered (gdb_stdlog,
59837fe0 4838 "gdbarch_find_by_info: info.osabi %d (%s)\n",
4be87837 4839 info.osabi, gdbarch_osabi_name (info.osabi));
0f71a2f6 4840 fprintf_unfiltered (gdb_stdlog,
59837fe0 4841 "gdbarch_find_by_info: info.abfd %s\n",
30737ed9 4842 host_address_to_string (info.abfd));
0f71a2f6 4843 fprintf_unfiltered (gdb_stdlog,
59837fe0 4844 "gdbarch_find_by_info: info.tdep_info %s\n",
30737ed9 4845 host_address_to_string (info.tdep_info));
0f71a2f6
JM
4846 }
4847
ebdba546 4848 /* Find the tdep code that knows about this architecture. */
b732d07d
AC
4849 for (rego = gdbarch_registry;
4850 rego != NULL;
4851 rego = rego->next)
4852 if (rego->bfd_architecture == info.bfd_arch_info->arch)
4853 break;
4854 if (rego == NULL)
4855 {
4856 if (gdbarch_debug)
59837fe0 4857 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
ebdba546 4858 "No matching architecture\n");
b732d07d
AC
4859 return 0;
4860 }
4861
ebdba546 4862 /* Ask the tdep code for an architecture that matches "info". */
0f71a2f6
JM
4863 new_gdbarch = rego->init (info, rego->arches);
4864
ebdba546
AC
4865 /* Did the tdep code like it? No. Reject the change and revert to
4866 the old architecture. */
0f71a2f6
JM
4867 if (new_gdbarch == NULL)
4868 {
4869 if (gdbarch_debug)
59837fe0 4870 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
ebdba546
AC
4871 "Target rejected architecture\n");
4872 return NULL;
0f71a2f6
JM
4873 }
4874
ebdba546
AC
4875 /* Is this a pre-existing architecture (as determined by already
4876 being initialized)? Move it to the front of the architecture
4877 list (keeping the list sorted Most Recently Used). */
4878 if (new_gdbarch->initialized_p)
0f71a2f6 4879 {
ebdba546
AC
4880 struct gdbarch_list **list;
4881 struct gdbarch_list *this;
0f71a2f6 4882 if (gdbarch_debug)
59837fe0 4883 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
30737ed9
JB
4884 "Previous architecture %s (%s) selected\n",
4885 host_address_to_string (new_gdbarch),
0f71a2f6 4886 new_gdbarch->bfd_arch_info->printable_name);
ebdba546
AC
4887 /* Find the existing arch in the list. */
4888 for (list = &rego->arches;
4889 (*list) != NULL && (*list)->gdbarch != new_gdbarch;
4890 list = &(*list)->next);
4891 /* It had better be in the list of architectures. */
4892 gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
4893 /* Unlink THIS. */
4894 this = (*list);
4895 (*list) = this->next;
4896 /* Insert THIS at the front. */
4897 this->next = rego->arches;
4898 rego->arches = this;
4899 /* Return it. */
4900 return new_gdbarch;
0f71a2f6
JM
4901 }
4902
ebdba546
AC
4903 /* It's a new architecture. */
4904 if (gdbarch_debug)
59837fe0 4905 fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
30737ed9
JB
4906 "New architecture %s (%s) selected\n",
4907 host_address_to_string (new_gdbarch),
ebdba546
AC
4908 new_gdbarch->bfd_arch_info->printable_name);
4909
4910 /* Insert the new architecture into the front of the architecture
4911 list (keep the list sorted Most Recently Used). */
0f79675b 4912 {
70ba0933 4913 struct gdbarch_list *this = XNEW (struct gdbarch_list);
0f79675b
AC
4914 this->next = rego->arches;
4915 this->gdbarch = new_gdbarch;
4916 rego->arches = this;
4917 }
0f71a2f6 4918
4b9b3959
AC
4919 /* Check that the newly installed architecture is valid. Plug in
4920 any post init values. */
4921 new_gdbarch->dump_tdep = rego->dump_tdep;
0f71a2f6 4922 verify_gdbarch (new_gdbarch);
ebdba546 4923 new_gdbarch->initialized_p = 1;
0f71a2f6 4924
4b9b3959 4925 if (gdbarch_debug)
ebdba546 4926 gdbarch_dump (new_gdbarch, gdb_stdlog);
4b9b3959 4927
ebdba546 4928 return new_gdbarch;
0f71a2f6 4929}
c906108c 4930
e487cc15 4931/* Make the specified architecture current. */
ebdba546
AC
4932
4933void
aff68abb 4934set_target_gdbarch (struct gdbarch *new_gdbarch)
ebdba546
AC
4935{
4936 gdb_assert (new_gdbarch != NULL);
ebdba546 4937 gdb_assert (new_gdbarch->initialized_p);
6ecd4729 4938 current_inferior ()->gdbarch = new_gdbarch;
383f836e 4939 observer_notify_architecture_changed (new_gdbarch);
a3ecef73 4940 registers_changed ();
ebdba546 4941}
c906108c 4942
f5656ead 4943/* Return the current inferior's arch. */
6ecd4729
PA
4944
4945struct gdbarch *
f5656ead 4946target_gdbarch (void)
6ecd4729
PA
4947{
4948 return current_inferior ()->gdbarch;
4949}
4950
104c1213 4951extern void _initialize_gdbarch (void);
b4a20239 4952
c906108c 4953void
7c7651b2 4954_initialize_gdbarch (void)
c906108c 4955{
ccce17b0 4956 add_setshow_zuinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
85c07804
AC
4957Set architecture debugging."), _("\
4958Show architecture debugging."), _("\
4959When non-zero, architecture debugging is enabled."),
4960 NULL,
920d2a44 4961 show_gdbarch_debug,
85c07804 4962 &setdebuglist, &showdebuglist);
c906108c 4963}
This page took 1.813933 seconds and 4 git commands to generate.