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