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