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