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