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