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