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