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