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