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