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