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