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