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