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