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