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