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