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