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