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