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