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