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