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