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