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