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