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