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