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