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