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