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