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