* Makefile.in (arm-tdep.o): Update.
[external/binutils.git] / gdb / gdbarch.c
1 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
2
3 /* Dynamic architecture support for GDB, the GNU debugger.
4
5    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
6    Free Software Foundation, Inc.
7
8    This file is part of GDB.
9
10    This program is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 3 of the License, or
13    (at your option) any later version.
14   
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19   
20    You should have received a copy of the GNU General Public License
21    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22
23 /* This file was created with the aid of ``gdbarch.sh''.
24
25    The Bourne shell script ``gdbarch.sh'' creates the files
26    ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
27    against the existing ``gdbarch.[hc]''.  Any differences found
28    being reported.
29
30    If editing this file, please also run gdbarch.sh and merge any
31    changes into that script. Conversely, when making sweeping changes
32    to this file, modifying gdbarch.sh and using its output may prove
33    easier. */
34
35
36 #include "defs.h"
37 #include "arch-utils.h"
38
39 #include "gdbcmd.h"
40 #include "inferior.h" 
41 #include "symcat.h"
42
43 #include "floatformat.h"
44
45 #include "gdb_assert.h"
46 #include "gdb_string.h"
47 #include "gdb-events.h"
48 #include "reggroups.h"
49 #include "osabi.h"
50 #include "gdb_obstack.h"
51
52 /* Static function declarations */
53
54 static void alloc_gdbarch_data (struct gdbarch *);
55
56 /* Non-zero if we want to trace architecture code.  */
57
58 #ifndef GDBARCH_DEBUG
59 #define GDBARCH_DEBUG 0
60 #endif
61 int gdbarch_debug = GDBARCH_DEBUG;
62 static void
63 show_gdbarch_debug (struct ui_file *file, int from_tty,
64                     struct cmd_list_element *c, const char *value)
65 {
66   fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
67 }
68
69 static const char *
70 pformat (const struct floatformat **format)
71 {
72   if (format == NULL)
73     return "(null)";
74   else
75     /* Just print out one of them - this is only for diagnostics.  */
76     return format[0]->name;
77 }
78
79
80 /* Maintain the struct gdbarch object */
81
82 struct gdbarch
83 {
84   /* Has this architecture been fully initialized?  */
85   int initialized_p;
86
87   /* An obstack bound to the lifetime of the architecture.  */
88   struct obstack *obstack;
89
90   /* basic architectural information */
91   const struct bfd_arch_info * bfd_arch_info;
92   int byte_order;
93   enum gdb_osabi osabi;
94   const struct target_desc * target_desc;
95
96   /* target specific vector. */
97   struct gdbarch_tdep *tdep;
98   gdbarch_dump_tdep_ftype *dump_tdep;
99
100   /* per-architecture data-pointers */
101   unsigned nr_data;
102   void **data;
103
104   /* per-architecture swap-regions */
105   struct gdbarch_swap *swap;
106
107   /* Multi-arch values.
108
109      When extending this structure you must:
110
111      Add the field below.
112
113      Declare set/get functions and define the corresponding
114      macro in gdbarch.h.
115
116      gdbarch_alloc(): If zero/NULL is not a suitable default,
117      initialize the new field.
118
119      verify_gdbarch(): Confirm that the target updated the field
120      correctly.
121
122      gdbarch_dump(): Add a fprintf_unfiltered call so that the new
123      field is dumped out
124
125      ``startup_gdbarch()'': Append an initial value to the static
126      variable (base values on the host's c-type system).
127
128      get_gdbarch(): Implement the set/get functions (probably using
129      the macro's as shortcuts).
130
131      */
132
133   int bits_big_endian;
134   int short_bit;
135   int int_bit;
136   int long_bit;
137   int long_long_bit;
138   int float_bit;
139   const struct floatformat ** float_format;
140   int double_bit;
141   const struct floatformat ** double_format;
142   int long_double_bit;
143   const struct floatformat ** long_double_format;
144   int ptr_bit;
145   int addr_bit;
146   int char_signed;
147   gdbarch_read_pc_ftype *read_pc;
148   gdbarch_write_pc_ftype *write_pc;
149   gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
150   gdbarch_pseudo_register_read_ftype *pseudo_register_read;
151   gdbarch_pseudo_register_write_ftype *pseudo_register_write;
152   int num_regs;
153   int num_pseudo_regs;
154   int sp_regnum;
155   int pc_regnum;
156   int ps_regnum;
157   int fp0_regnum;
158   gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
159   gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
160   gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
161   gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
162   gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
163   gdbarch_register_name_ftype *register_name;
164   gdbarch_register_type_ftype *register_type;
165   gdbarch_dummy_id_ftype *dummy_id;
166   int deprecated_fp_regnum;
167   gdbarch_push_dummy_call_ftype *push_dummy_call;
168   int call_dummy_location;
169   gdbarch_push_dummy_code_ftype *push_dummy_code;
170   gdbarch_print_registers_info_ftype *print_registers_info;
171   gdbarch_print_float_info_ftype *print_float_info;
172   gdbarch_print_vector_info_ftype *print_vector_info;
173   gdbarch_register_sim_regno_ftype *register_sim_regno;
174   gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
175   gdbarch_cannot_store_register_ftype *cannot_store_register;
176   gdbarch_get_longjmp_target_ftype *get_longjmp_target;
177   int believe_pcc_promotion;
178   gdbarch_convert_register_p_ftype *convert_register_p;
179   gdbarch_register_to_value_ftype *register_to_value;
180   gdbarch_value_to_register_ftype *value_to_register;
181   gdbarch_value_from_register_ftype *value_from_register;
182   gdbarch_pointer_to_address_ftype *pointer_to_address;
183   gdbarch_address_to_pointer_ftype *address_to_pointer;
184   gdbarch_integer_to_address_ftype *integer_to_address;
185   gdbarch_return_value_ftype *return_value;
186   gdbarch_skip_prologue_ftype *skip_prologue;
187   gdbarch_inner_than_ftype *inner_than;
188   gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
189   gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
190   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
191   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
192   CORE_ADDR decr_pc_after_break;
193   CORE_ADDR deprecated_function_start_offset;
194   gdbarch_remote_register_number_ftype *remote_register_number;
195   gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
196   CORE_ADDR frame_args_skip;
197   gdbarch_unwind_pc_ftype *unwind_pc;
198   gdbarch_unwind_sp_ftype *unwind_sp;
199   gdbarch_frame_num_args_ftype *frame_num_args;
200   gdbarch_frame_align_ftype *frame_align;
201   gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
202   int frame_red_zone_size;
203   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
204   gdbarch_addr_bits_remove_ftype *addr_bits_remove;
205   gdbarch_smash_text_address_ftype *smash_text_address;
206   gdbarch_software_single_step_ftype *software_single_step;
207   gdbarch_single_step_through_delay_ftype *single_step_through_delay;
208   gdbarch_print_insn_ftype *print_insn;
209   gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
210   gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
211   gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
212   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
213   gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
214   gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
215   gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
216   const char * name_of_malloc;
217   int cannot_step_breakpoint;
218   int have_nonsteppable_watchpoint;
219   gdbarch_address_class_type_flags_ftype *address_class_type_flags;
220   gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
221   gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
222   gdbarch_register_reggroup_p_ftype *register_reggroup_p;
223   gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
224   gdbarch_regset_from_core_section_ftype *regset_from_core_section;
225   gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
226   int vtable_function_descriptors;
227   int vbit_in_delta;
228   gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
229   ULONGEST max_insn_length;
230   gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
231   gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
232   gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
233   gdbarch_displaced_step_location_ftype *displaced_step_location;
234   gdbarch_overlay_update_ftype *overlay_update;
235   gdbarch_core_read_description_ftype *core_read_description;
236   gdbarch_static_transform_name_ftype *static_transform_name;
237   int sofun_address_maybe_missing;
238   gdbarch_target_signal_from_host_ftype *target_signal_from_host;
239   gdbarch_target_signal_to_host_ftype *target_signal_to_host;
240   gdbarch_record_special_symbol_ftype *record_special_symbol;
241 };
242
243
244 /* The default architecture uses host values (for want of a better
245    choice). */
246
247 extern const struct bfd_arch_info bfd_default_arch_struct;
248
249 struct gdbarch startup_gdbarch =
250 {
251   1, /* Always initialized.  */
252   NULL, /* The obstack.  */
253   /* basic architecture information */
254   &bfd_default_arch_struct,  /* bfd_arch_info */
255   BFD_ENDIAN_BIG,  /* byte_order */
256   GDB_OSABI_UNKNOWN,  /* osabi */
257   0,  /* target_desc */
258   /* target specific vector and its dump routine */
259   NULL, NULL,
260   /*per-architecture data-pointers and swap regions */
261   0, NULL, NULL,
262   /* Multi-arch values */
263   1,  /* bits_big_endian */
264   8 * sizeof (short),  /* short_bit */
265   8 * sizeof (int),  /* int_bit */
266   8 * sizeof (long),  /* long_bit */
267   8 * sizeof (LONGEST),  /* long_long_bit */
268   8 * sizeof (float),  /* float_bit */
269   0,  /* float_format */
270   8 * sizeof (double),  /* double_bit */
271   0,  /* double_format */
272   8 * sizeof (long double),  /* long_double_bit */
273   0,  /* long_double_format */
274   8 * sizeof (void*),  /* ptr_bit */
275   8 * sizeof (void*),  /* addr_bit */
276   1,  /* char_signed */
277   0,  /* read_pc */
278   0,  /* write_pc */
279   legacy_virtual_frame_pointer,  /* virtual_frame_pointer */
280   0,  /* pseudo_register_read */
281   0,  /* pseudo_register_write */
282   0,  /* num_regs */
283   0,  /* num_pseudo_regs */
284   -1,  /* sp_regnum */
285   -1,  /* pc_regnum */
286   -1,  /* ps_regnum */
287   0,  /* fp0_regnum */
288   no_op_reg_to_regnum,  /* stab_reg_to_regnum */
289   no_op_reg_to_regnum,  /* ecoff_reg_to_regnum */
290   no_op_reg_to_regnum,  /* dwarf_reg_to_regnum */
291   no_op_reg_to_regnum,  /* sdb_reg_to_regnum */
292   no_op_reg_to_regnum,  /* dwarf2_reg_to_regnum */
293   0,  /* register_name */
294   0,  /* register_type */
295   0,  /* dummy_id */
296   -1,  /* deprecated_fp_regnum */
297   0,  /* push_dummy_call */
298   0,  /* call_dummy_location */
299   0,  /* push_dummy_code */
300   default_print_registers_info,  /* print_registers_info */
301   0,  /* print_float_info */
302   0,  /* print_vector_info */
303   legacy_register_sim_regno,  /* register_sim_regno */
304   cannot_register_not,  /* cannot_fetch_register */
305   cannot_register_not,  /* cannot_store_register */
306   0,  /* get_longjmp_target */
307   0,  /* believe_pcc_promotion */
308   generic_convert_register_p,  /* convert_register_p */
309   0,  /* register_to_value */
310   0,  /* value_to_register */
311   0,  /* value_from_register */
312   0,  /* pointer_to_address */
313   0,  /* address_to_pointer */
314   0,  /* integer_to_address */
315   0,  /* return_value */
316   0,  /* skip_prologue */
317   0,  /* inner_than */
318   0,  /* breakpoint_from_pc */
319   0,  /* adjust_breakpoint_address */
320   default_memory_insert_breakpoint,  /* memory_insert_breakpoint */
321   default_memory_remove_breakpoint,  /* memory_remove_breakpoint */
322   0,  /* decr_pc_after_break */
323   0,  /* deprecated_function_start_offset */
324   default_remote_register_number,  /* remote_register_number */
325   0,  /* fetch_tls_load_module_address */
326   0,  /* frame_args_skip */
327   0,  /* unwind_pc */
328   0,  /* unwind_sp */
329   0,  /* frame_num_args */
330   0,  /* frame_align */
331   default_stabs_argument_has_addr,  /* stabs_argument_has_addr */
332   0,  /* frame_red_zone_size */
333   convert_from_func_ptr_addr_identity,  /* convert_from_func_ptr_addr */
334   0,  /* addr_bits_remove */
335   0,  /* smash_text_address */
336   0,  /* software_single_step */
337   0,  /* single_step_through_delay */
338   0,  /* print_insn */
339   0,  /* skip_trampoline_code */
340   generic_skip_solib_resolver,  /* skip_solib_resolver */
341   0,  /* in_solib_return_trampoline */
342   generic_in_function_epilogue_p,  /* in_function_epilogue_p */
343   construct_inferior_arguments,  /* construct_inferior_arguments */
344   0,  /* elf_make_msymbol_special */
345   0,  /* coff_make_msymbol_special */
346   "malloc",  /* name_of_malloc */
347   0,  /* cannot_step_breakpoint */
348   0,  /* have_nonsteppable_watchpoint */
349   0,  /* address_class_type_flags */
350   0,  /* address_class_type_flags_to_name */
351   0,  /* address_class_name_to_type_flags */
352   default_register_reggroup_p,  /* register_reggroup_p */
353   0,  /* fetch_pointer_argument */
354   0,  /* regset_from_core_section */
355   0,  /* core_xfer_shared_libraries */
356   0,  /* vtable_function_descriptors */
357   0,  /* vbit_in_delta */
358   0,  /* skip_permanent_breakpoint */
359   0,  /* max_insn_length */
360   0,  /* displaced_step_copy_insn */
361   0,  /* displaced_step_fixup */
362   NULL,  /* displaced_step_free_closure */
363   NULL,  /* displaced_step_location */
364   0,  /* overlay_update */
365   0,  /* core_read_description */
366   0,  /* static_transform_name */
367   0,  /* sofun_address_maybe_missing */
368   default_target_signal_from_host,  /* target_signal_from_host */
369   default_target_signal_to_host,  /* target_signal_to_host */
370   0,  /* record_special_symbol */
371   /* startup_gdbarch() */
372 };
373
374 struct gdbarch *current_gdbarch = &startup_gdbarch;
375
376 /* Create a new ``struct gdbarch'' based on information provided by
377    ``struct gdbarch_info''. */
378
379 struct gdbarch *
380 gdbarch_alloc (const struct gdbarch_info *info,
381                struct gdbarch_tdep *tdep)
382 {
383   struct gdbarch *gdbarch;
384
385   /* Create an obstack for allocating all the per-architecture memory,
386      then use that to allocate the architecture vector.  */
387   struct obstack *obstack = XMALLOC (struct obstack);
388   obstack_init (obstack);
389   gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
390   memset (gdbarch, 0, sizeof (*gdbarch));
391   gdbarch->obstack = obstack;
392
393   alloc_gdbarch_data (gdbarch);
394
395   gdbarch->tdep = tdep;
396
397   gdbarch->bfd_arch_info = info->bfd_arch_info;
398   gdbarch->byte_order = info->byte_order;
399   gdbarch->osabi = info->osabi;
400   gdbarch->target_desc = info->target_desc;
401
402   /* Force the explicit initialization of these. */
403   gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
404   gdbarch->short_bit = 2*TARGET_CHAR_BIT;
405   gdbarch->int_bit = 4*TARGET_CHAR_BIT;
406   gdbarch->long_bit = 4*TARGET_CHAR_BIT;
407   gdbarch->long_long_bit = 2*gdbarch->long_bit;
408   gdbarch->float_bit = 4*TARGET_CHAR_BIT;
409   gdbarch->double_bit = 8*TARGET_CHAR_BIT;
410   gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
411   gdbarch->ptr_bit = gdbarch->int_bit;
412   gdbarch->char_signed = -1;
413   gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
414   gdbarch->num_regs = -1;
415   gdbarch->sp_regnum = -1;
416   gdbarch->pc_regnum = -1;
417   gdbarch->ps_regnum = -1;
418   gdbarch->fp0_regnum = -1;
419   gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
420   gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
421   gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
422   gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
423   gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
424   gdbarch->deprecated_fp_regnum = -1;
425   gdbarch->call_dummy_location = AT_ENTRY_POINT;
426   gdbarch->print_registers_info = default_print_registers_info;
427   gdbarch->register_sim_regno = legacy_register_sim_regno;
428   gdbarch->cannot_fetch_register = cannot_register_not;
429   gdbarch->cannot_store_register = cannot_register_not;
430   gdbarch->convert_register_p = generic_convert_register_p;
431   gdbarch->value_from_register = default_value_from_register;
432   gdbarch->pointer_to_address = unsigned_pointer_to_address;
433   gdbarch->address_to_pointer = unsigned_address_to_pointer;
434   gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
435   gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
436   gdbarch->remote_register_number = default_remote_register_number;
437   gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
438   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
439   gdbarch->addr_bits_remove = core_addr_identity;
440   gdbarch->smash_text_address = core_addr_identity;
441   gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
442   gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
443   gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
444   gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
445   gdbarch->construct_inferior_arguments = construct_inferior_arguments;
446   gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
447   gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
448   gdbarch->name_of_malloc = "malloc";
449   gdbarch->register_reggroup_p = default_register_reggroup_p;
450   gdbarch->displaced_step_fixup = NULL;
451   gdbarch->displaced_step_free_closure = NULL;
452   gdbarch->displaced_step_location = NULL;
453   gdbarch->target_signal_from_host = default_target_signal_from_host;
454   gdbarch->target_signal_to_host = default_target_signal_to_host;
455   /* gdbarch_alloc() */
456
457   return gdbarch;
458 }
459
460
461 /* Allocate extra space using the per-architecture obstack.  */
462
463 void *
464 gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
465 {
466   void *data = obstack_alloc (arch->obstack, size);
467   memset (data, 0, size);
468   return data;
469 }
470
471
472 /* Free a gdbarch struct.  This should never happen in normal
473    operation --- once you've created a gdbarch, you keep it around.
474    However, if an architecture's init function encounters an error
475    building the structure, it may need to clean up a partially
476    constructed gdbarch.  */
477
478 void
479 gdbarch_free (struct gdbarch *arch)
480 {
481   struct obstack *obstack;
482   gdb_assert (arch != NULL);
483   gdb_assert (!arch->initialized_p);
484   obstack = arch->obstack;
485   obstack_free (obstack, 0); /* Includes the ARCH.  */
486   xfree (obstack);
487 }
488
489
490 /* Ensure that all values in a GDBARCH are reasonable.  */
491
492 static void
493 verify_gdbarch (struct gdbarch *gdbarch)
494 {
495   struct ui_file *log;
496   struct cleanup *cleanups;
497   long dummy;
498   char *buf;
499   log = mem_fileopen ();
500   cleanups = make_cleanup_ui_file_delete (log);
501   /* fundamental */
502   if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
503     fprintf_unfiltered (log, "\n\tbyte-order");
504   if (gdbarch->bfd_arch_info == NULL)
505     fprintf_unfiltered (log, "\n\tbfd_arch_info");
506   /* Check those that need to be defined for the given multi-arch level. */
507   /* Skip verify of bits_big_endian, invalid_p == 0 */
508   /* Skip verify of short_bit, invalid_p == 0 */
509   /* Skip verify of int_bit, invalid_p == 0 */
510   /* Skip verify of long_bit, invalid_p == 0 */
511   /* Skip verify of long_long_bit, invalid_p == 0 */
512   /* Skip verify of float_bit, invalid_p == 0 */
513   if (gdbarch->float_format == 0)
514     gdbarch->float_format = floatformats_ieee_single;
515   /* Skip verify of double_bit, invalid_p == 0 */
516   if (gdbarch->double_format == 0)
517     gdbarch->double_format = floatformats_ieee_double;
518   /* Skip verify of long_double_bit, invalid_p == 0 */
519   if (gdbarch->long_double_format == 0)
520     gdbarch->long_double_format = floatformats_ieee_double;
521   /* Skip verify of ptr_bit, invalid_p == 0 */
522   if (gdbarch->addr_bit == 0)
523     gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
524   if (gdbarch->char_signed == -1)
525     gdbarch->char_signed = 1;
526   /* Skip verify of read_pc, has predicate */
527   /* Skip verify of write_pc, has predicate */
528   /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
529   /* Skip verify of pseudo_register_read, has predicate */
530   /* Skip verify of pseudo_register_write, has predicate */
531   if (gdbarch->num_regs == -1)
532     fprintf_unfiltered (log, "\n\tnum_regs");
533   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
534   /* Skip verify of sp_regnum, invalid_p == 0 */
535   /* Skip verify of pc_regnum, invalid_p == 0 */
536   /* Skip verify of ps_regnum, invalid_p == 0 */
537   /* Skip verify of fp0_regnum, invalid_p == 0 */
538   /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
539   /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
540   /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
541   /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
542   /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
543   if (gdbarch->register_name == 0)
544     fprintf_unfiltered (log, "\n\tregister_name");
545   /* Skip verify of register_type, has predicate */
546   /* Skip verify of dummy_id, has predicate */
547   /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
548   /* Skip verify of push_dummy_call, has predicate */
549   /* Skip verify of call_dummy_location, invalid_p == 0 */
550   /* Skip verify of push_dummy_code, has predicate */
551   /* Skip verify of print_registers_info, invalid_p == 0 */
552   /* Skip verify of print_float_info, has predicate */
553   /* Skip verify of print_vector_info, has predicate */
554   /* Skip verify of register_sim_regno, invalid_p == 0 */
555   /* Skip verify of cannot_fetch_register, invalid_p == 0 */
556   /* Skip verify of cannot_store_register, invalid_p == 0 */
557   /* Skip verify of get_longjmp_target, has predicate */
558   /* Skip verify of convert_register_p, invalid_p == 0 */
559   /* Skip verify of value_from_register, invalid_p == 0 */
560   /* Skip verify of pointer_to_address, invalid_p == 0 */
561   /* Skip verify of address_to_pointer, invalid_p == 0 */
562   /* Skip verify of integer_to_address, has predicate */
563   /* Skip verify of return_value, has predicate */
564   if (gdbarch->skip_prologue == 0)
565     fprintf_unfiltered (log, "\n\tskip_prologue");
566   if (gdbarch->inner_than == 0)
567     fprintf_unfiltered (log, "\n\tinner_than");
568   if (gdbarch->breakpoint_from_pc == 0)
569     fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
570   /* Skip verify of adjust_breakpoint_address, has predicate */
571   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
572   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
573   /* Skip verify of decr_pc_after_break, invalid_p == 0 */
574   /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
575   /* Skip verify of remote_register_number, invalid_p == 0 */
576   /* Skip verify of fetch_tls_load_module_address, has predicate */
577   /* Skip verify of frame_args_skip, invalid_p == 0 */
578   /* Skip verify of unwind_pc, has predicate */
579   /* Skip verify of unwind_sp, has predicate */
580   /* Skip verify of frame_num_args, has predicate */
581   /* Skip verify of frame_align, has predicate */
582   /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
583   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
584   /* Skip verify of addr_bits_remove, invalid_p == 0 */
585   /* Skip verify of smash_text_address, invalid_p == 0 */
586   /* Skip verify of software_single_step, has predicate */
587   /* Skip verify of single_step_through_delay, has predicate */
588   if (gdbarch->print_insn == 0)
589     fprintf_unfiltered (log, "\n\tprint_insn");
590   /* Skip verify of skip_trampoline_code, invalid_p == 0 */
591   /* Skip verify of skip_solib_resolver, invalid_p == 0 */
592   /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
593   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
594   /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
595   /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
596   /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
597   /* Skip verify of name_of_malloc, invalid_p == 0 */
598   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
599   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
600   /* Skip verify of address_class_type_flags, has predicate */
601   /* Skip verify of address_class_type_flags_to_name, has predicate */
602   /* Skip verify of address_class_name_to_type_flags, has predicate */
603   /* Skip verify of register_reggroup_p, invalid_p == 0 */
604   /* Skip verify of fetch_pointer_argument, has predicate */
605   /* Skip verify of regset_from_core_section, has predicate */
606   /* Skip verify of core_xfer_shared_libraries, has predicate */
607   /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
608   /* Skip verify of vbit_in_delta, invalid_p == 0 */
609   /* Skip verify of skip_permanent_breakpoint, has predicate */
610   /* Skip verify of max_insn_length, has predicate */
611   /* Skip verify of displaced_step_copy_insn, has predicate */
612   /* Skip verify of displaced_step_fixup, has predicate */
613   if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
614     fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
615   if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
616     fprintf_unfiltered (log, "\n\tdisplaced_step_location");
617   /* Skip verify of overlay_update, has predicate */
618   /* Skip verify of core_read_description, has predicate */
619   /* Skip verify of static_transform_name, has predicate */
620   /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
621   /* Skip verify of target_signal_from_host, invalid_p == 0 */
622   /* Skip verify of target_signal_to_host, invalid_p == 0 */
623   /* Skip verify of record_special_symbol, has predicate */
624   buf = ui_file_xstrdup (log, &dummy);
625   make_cleanup (xfree, buf);
626   if (strlen (buf) > 0)
627     internal_error (__FILE__, __LINE__,
628                     _("verify_gdbarch: the following are invalid ...%s"),
629                     buf);
630   do_cleanups (cleanups);
631 }
632
633
634 /* Print out the details of the current architecture. */
635
636 void
637 gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
638 {
639   const char *gdb_nm_file = "<not-defined>";
640 #if defined (GDB_NM_FILE)
641   gdb_nm_file = GDB_NM_FILE;
642 #endif
643   fprintf_unfiltered (file,
644                       "gdbarch_dump: GDB_NM_FILE = %s\n",
645                       gdb_nm_file);
646   fprintf_unfiltered (file,
647                       "gdbarch_dump: addr_bit = %s\n",
648                       paddr_d (gdbarch->addr_bit));
649   fprintf_unfiltered (file,
650                       "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
651                       (long) gdbarch->addr_bits_remove);
652   fprintf_unfiltered (file,
653                       "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
654                       gdbarch_address_class_name_to_type_flags_p (gdbarch));
655   fprintf_unfiltered (file,
656                       "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
657                       (long) gdbarch->address_class_name_to_type_flags);
658   fprintf_unfiltered (file,
659                       "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
660                       gdbarch_address_class_type_flags_p (gdbarch));
661   fprintf_unfiltered (file,
662                       "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
663                       (long) gdbarch->address_class_type_flags);
664   fprintf_unfiltered (file,
665                       "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
666                       gdbarch_address_class_type_flags_to_name_p (gdbarch));
667   fprintf_unfiltered (file,
668                       "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
669                       (long) gdbarch->address_class_type_flags_to_name);
670   fprintf_unfiltered (file,
671                       "gdbarch_dump: address_to_pointer = <0x%lx>\n",
672                       (long) gdbarch->address_to_pointer);
673   fprintf_unfiltered (file,
674                       "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
675                       gdbarch_adjust_breakpoint_address_p (gdbarch));
676   fprintf_unfiltered (file,
677                       "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
678                       (long) gdbarch->adjust_breakpoint_address);
679   fprintf_unfiltered (file,
680                       "gdbarch_dump: believe_pcc_promotion = %s\n",
681                       paddr_d (gdbarch->believe_pcc_promotion));
682   fprintf_unfiltered (file,
683                       "gdbarch_dump: bfd_arch_info = %s\n",
684                       gdbarch_bfd_arch_info (gdbarch)->printable_name);
685   fprintf_unfiltered (file,
686                       "gdbarch_dump: bits_big_endian = %s\n",
687                       paddr_d (gdbarch->bits_big_endian));
688   fprintf_unfiltered (file,
689                       "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
690                       (long) gdbarch->breakpoint_from_pc);
691   fprintf_unfiltered (file,
692                       "gdbarch_dump: byte_order = %s\n",
693                       paddr_d (gdbarch->byte_order));
694   fprintf_unfiltered (file,
695                       "gdbarch_dump: call_dummy_location = %s\n",
696                       paddr_d (gdbarch->call_dummy_location));
697   fprintf_unfiltered (file,
698                       "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
699                       (long) gdbarch->cannot_fetch_register);
700   fprintf_unfiltered (file,
701                       "gdbarch_dump: cannot_step_breakpoint = %s\n",
702                       paddr_d (gdbarch->cannot_step_breakpoint));
703   fprintf_unfiltered (file,
704                       "gdbarch_dump: cannot_store_register = <0x%lx>\n",
705                       (long) gdbarch->cannot_store_register);
706   fprintf_unfiltered (file,
707                       "gdbarch_dump: char_signed = %s\n",
708                       paddr_d (gdbarch->char_signed));
709   fprintf_unfiltered (file,
710                       "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
711                       (long) gdbarch->coff_make_msymbol_special);
712   fprintf_unfiltered (file,
713                       "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
714                       (long) gdbarch->construct_inferior_arguments);
715   fprintf_unfiltered (file,
716                       "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
717                       (long) gdbarch->convert_from_func_ptr_addr);
718   fprintf_unfiltered (file,
719                       "gdbarch_dump: convert_register_p = <0x%lx>\n",
720                       (long) gdbarch->convert_register_p);
721   fprintf_unfiltered (file,
722                       "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
723                       gdbarch_core_read_description_p (gdbarch));
724   fprintf_unfiltered (file,
725                       "gdbarch_dump: core_read_description = <0x%lx>\n",
726                       (long) gdbarch->core_read_description);
727   fprintf_unfiltered (file,
728                       "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
729                       gdbarch_core_xfer_shared_libraries_p (gdbarch));
730   fprintf_unfiltered (file,
731                       "gdbarch_dump: core_xfer_shared_libraries = <0x%lx>\n",
732                       (long) gdbarch->core_xfer_shared_libraries);
733   fprintf_unfiltered (file,
734                       "gdbarch_dump: decr_pc_after_break = 0x%s\n",
735                       paddr_nz (gdbarch->decr_pc_after_break));
736   fprintf_unfiltered (file,
737                       "gdbarch_dump: deprecated_fp_regnum = %s\n",
738                       paddr_d (gdbarch->deprecated_fp_regnum));
739   fprintf_unfiltered (file,
740                       "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
741                       paddr_nz (gdbarch->deprecated_function_start_offset));
742   fprintf_unfiltered (file,
743                       "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
744                       gdbarch_displaced_step_copy_insn_p (gdbarch));
745   fprintf_unfiltered (file,
746                       "gdbarch_dump: displaced_step_copy_insn = <0x%lx>\n",
747                       (long) gdbarch->displaced_step_copy_insn);
748   fprintf_unfiltered (file,
749                       "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
750                       gdbarch_displaced_step_fixup_p (gdbarch));
751   fprintf_unfiltered (file,
752                       "gdbarch_dump: displaced_step_fixup = <0x%lx>\n",
753                       (long) gdbarch->displaced_step_fixup);
754   fprintf_unfiltered (file,
755                       "gdbarch_dump: displaced_step_free_closure = <0x%lx>\n",
756                       (long) gdbarch->displaced_step_free_closure);
757   fprintf_unfiltered (file,
758                       "gdbarch_dump: displaced_step_location = <0x%lx>\n",
759                       (long) gdbarch->displaced_step_location);
760   fprintf_unfiltered (file,
761                       "gdbarch_dump: double_bit = %s\n",
762                       paddr_d (gdbarch->double_bit));
763   fprintf_unfiltered (file,
764                       "gdbarch_dump: double_format = %s\n",
765                       pformat (gdbarch->double_format));
766   fprintf_unfiltered (file,
767                       "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
768                       gdbarch_dummy_id_p (gdbarch));
769   fprintf_unfiltered (file,
770                       "gdbarch_dump: dummy_id = <0x%lx>\n",
771                       (long) gdbarch->dummy_id);
772   fprintf_unfiltered (file,
773                       "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
774                       (long) gdbarch->dwarf2_reg_to_regnum);
775   fprintf_unfiltered (file,
776                       "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
777                       (long) gdbarch->dwarf_reg_to_regnum);
778   fprintf_unfiltered (file,
779                       "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
780                       (long) gdbarch->ecoff_reg_to_regnum);
781   fprintf_unfiltered (file,
782                       "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
783                       (long) gdbarch->elf_make_msymbol_special);
784   fprintf_unfiltered (file,
785                       "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
786                       gdbarch_fetch_pointer_argument_p (gdbarch));
787   fprintf_unfiltered (file,
788                       "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
789                       (long) gdbarch->fetch_pointer_argument);
790   fprintf_unfiltered (file,
791                       "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
792                       gdbarch_fetch_tls_load_module_address_p (gdbarch));
793   fprintf_unfiltered (file,
794                       "gdbarch_dump: fetch_tls_load_module_address = <0x%lx>\n",
795                       (long) gdbarch->fetch_tls_load_module_address);
796   fprintf_unfiltered (file,
797                       "gdbarch_dump: float_bit = %s\n",
798                       paddr_d (gdbarch->float_bit));
799   fprintf_unfiltered (file,
800                       "gdbarch_dump: float_format = %s\n",
801                       pformat (gdbarch->float_format));
802   fprintf_unfiltered (file,
803                       "gdbarch_dump: fp0_regnum = %s\n",
804                       paddr_d (gdbarch->fp0_regnum));
805   fprintf_unfiltered (file,
806                       "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
807                       gdbarch_frame_align_p (gdbarch));
808   fprintf_unfiltered (file,
809                       "gdbarch_dump: frame_align = <0x%lx>\n",
810                       (long) gdbarch->frame_align);
811   fprintf_unfiltered (file,
812                       "gdbarch_dump: frame_args_skip = 0x%s\n",
813                       paddr_nz (gdbarch->frame_args_skip));
814   fprintf_unfiltered (file,
815                       "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
816                       gdbarch_frame_num_args_p (gdbarch));
817   fprintf_unfiltered (file,
818                       "gdbarch_dump: frame_num_args = <0x%lx>\n",
819                       (long) gdbarch->frame_num_args);
820   fprintf_unfiltered (file,
821                       "gdbarch_dump: frame_red_zone_size = %s\n",
822                       paddr_d (gdbarch->frame_red_zone_size));
823   fprintf_unfiltered (file,
824                       "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
825                       gdbarch_get_longjmp_target_p (gdbarch));
826   fprintf_unfiltered (file,
827                       "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
828                       (long) gdbarch->get_longjmp_target);
829   fprintf_unfiltered (file,
830                       "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
831                       paddr_d (gdbarch->have_nonsteppable_watchpoint));
832   fprintf_unfiltered (file,
833                       "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
834                       (long) gdbarch->in_function_epilogue_p);
835   fprintf_unfiltered (file,
836                       "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
837                       (long) gdbarch->in_solib_return_trampoline);
838   fprintf_unfiltered (file,
839                       "gdbarch_dump: inner_than = <0x%lx>\n",
840                       (long) gdbarch->inner_than);
841   fprintf_unfiltered (file,
842                       "gdbarch_dump: int_bit = %s\n",
843                       paddr_d (gdbarch->int_bit));
844   fprintf_unfiltered (file,
845                       "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
846                       gdbarch_integer_to_address_p (gdbarch));
847   fprintf_unfiltered (file,
848                       "gdbarch_dump: integer_to_address = <0x%lx>\n",
849                       (long) gdbarch->integer_to_address);
850   fprintf_unfiltered (file,
851                       "gdbarch_dump: long_bit = %s\n",
852                       paddr_d (gdbarch->long_bit));
853   fprintf_unfiltered (file,
854                       "gdbarch_dump: long_double_bit = %s\n",
855                       paddr_d (gdbarch->long_double_bit));
856   fprintf_unfiltered (file,
857                       "gdbarch_dump: long_double_format = %s\n",
858                       pformat (gdbarch->long_double_format));
859   fprintf_unfiltered (file,
860                       "gdbarch_dump: long_long_bit = %s\n",
861                       paddr_d (gdbarch->long_long_bit));
862   fprintf_unfiltered (file,
863                       "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
864                       gdbarch_max_insn_length_p (gdbarch));
865   fprintf_unfiltered (file,
866                       "gdbarch_dump: max_insn_length = %s\n",
867                       paddr_d (gdbarch->max_insn_length));
868   fprintf_unfiltered (file,
869                       "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
870                       (long) gdbarch->memory_insert_breakpoint);
871   fprintf_unfiltered (file,
872                       "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
873                       (long) gdbarch->memory_remove_breakpoint);
874   fprintf_unfiltered (file,
875                       "gdbarch_dump: name_of_malloc = %s\n",
876                       gdbarch->name_of_malloc);
877   fprintf_unfiltered (file,
878                       "gdbarch_dump: num_pseudo_regs = %s\n",
879                       paddr_d (gdbarch->num_pseudo_regs));
880   fprintf_unfiltered (file,
881                       "gdbarch_dump: num_regs = %s\n",
882                       paddr_d (gdbarch->num_regs));
883   fprintf_unfiltered (file,
884                       "gdbarch_dump: osabi = %s\n",
885                       paddr_d (gdbarch->osabi));
886   fprintf_unfiltered (file,
887                       "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
888                       gdbarch_overlay_update_p (gdbarch));
889   fprintf_unfiltered (file,
890                       "gdbarch_dump: overlay_update = <0x%lx>\n",
891                       (long) gdbarch->overlay_update);
892   fprintf_unfiltered (file,
893                       "gdbarch_dump: pc_regnum = %s\n",
894                       paddr_d (gdbarch->pc_regnum));
895   fprintf_unfiltered (file,
896                       "gdbarch_dump: pointer_to_address = <0x%lx>\n",
897                       (long) gdbarch->pointer_to_address);
898   fprintf_unfiltered (file,
899                       "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
900                       gdbarch_print_float_info_p (gdbarch));
901   fprintf_unfiltered (file,
902                       "gdbarch_dump: print_float_info = <0x%lx>\n",
903                       (long) gdbarch->print_float_info);
904   fprintf_unfiltered (file,
905                       "gdbarch_dump: print_insn = <0x%lx>\n",
906                       (long) gdbarch->print_insn);
907   fprintf_unfiltered (file,
908                       "gdbarch_dump: print_registers_info = <0x%lx>\n",
909                       (long) gdbarch->print_registers_info);
910   fprintf_unfiltered (file,
911                       "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
912                       gdbarch_print_vector_info_p (gdbarch));
913   fprintf_unfiltered (file,
914                       "gdbarch_dump: print_vector_info = <0x%lx>\n",
915                       (long) gdbarch->print_vector_info);
916   fprintf_unfiltered (file,
917                       "gdbarch_dump: ps_regnum = %s\n",
918                       paddr_d (gdbarch->ps_regnum));
919   fprintf_unfiltered (file,
920                       "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
921                       gdbarch_pseudo_register_read_p (gdbarch));
922   fprintf_unfiltered (file,
923                       "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
924                       (long) gdbarch->pseudo_register_read);
925   fprintf_unfiltered (file,
926                       "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
927                       gdbarch_pseudo_register_write_p (gdbarch));
928   fprintf_unfiltered (file,
929                       "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
930                       (long) gdbarch->pseudo_register_write);
931   fprintf_unfiltered (file,
932                       "gdbarch_dump: ptr_bit = %s\n",
933                       paddr_d (gdbarch->ptr_bit));
934   fprintf_unfiltered (file,
935                       "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
936                       gdbarch_push_dummy_call_p (gdbarch));
937   fprintf_unfiltered (file,
938                       "gdbarch_dump: push_dummy_call = <0x%lx>\n",
939                       (long) gdbarch->push_dummy_call);
940   fprintf_unfiltered (file,
941                       "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
942                       gdbarch_push_dummy_code_p (gdbarch));
943   fprintf_unfiltered (file,
944                       "gdbarch_dump: push_dummy_code = <0x%lx>\n",
945                       (long) gdbarch->push_dummy_code);
946   fprintf_unfiltered (file,
947                       "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
948                       gdbarch_read_pc_p (gdbarch));
949   fprintf_unfiltered (file,
950                       "gdbarch_dump: read_pc = <0x%lx>\n",
951                       (long) gdbarch->read_pc);
952   fprintf_unfiltered (file,
953                       "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
954                       gdbarch_record_special_symbol_p (gdbarch));
955   fprintf_unfiltered (file,
956                       "gdbarch_dump: record_special_symbol = <0x%lx>\n",
957                       (long) gdbarch->record_special_symbol);
958   fprintf_unfiltered (file,
959                       "gdbarch_dump: register_name = <0x%lx>\n",
960                       (long) gdbarch->register_name);
961   fprintf_unfiltered (file,
962                       "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
963                       (long) gdbarch->register_reggroup_p);
964   fprintf_unfiltered (file,
965                       "gdbarch_dump: register_sim_regno = <0x%lx>\n",
966                       (long) gdbarch->register_sim_regno);
967   fprintf_unfiltered (file,
968                       "gdbarch_dump: register_to_value = <0x%lx>\n",
969                       (long) gdbarch->register_to_value);
970   fprintf_unfiltered (file,
971                       "gdbarch_dump: gdbarch_register_type_p() = %d\n",
972                       gdbarch_register_type_p (gdbarch));
973   fprintf_unfiltered (file,
974                       "gdbarch_dump: register_type = <0x%lx>\n",
975                       (long) gdbarch->register_type);
976   fprintf_unfiltered (file,
977                       "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
978                       gdbarch_regset_from_core_section_p (gdbarch));
979   fprintf_unfiltered (file,
980                       "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
981                       (long) gdbarch->regset_from_core_section);
982   fprintf_unfiltered (file,
983                       "gdbarch_dump: remote_register_number = <0x%lx>\n",
984                       (long) gdbarch->remote_register_number);
985   fprintf_unfiltered (file,
986                       "gdbarch_dump: gdbarch_return_value_p() = %d\n",
987                       gdbarch_return_value_p (gdbarch));
988   fprintf_unfiltered (file,
989                       "gdbarch_dump: return_value = <0x%lx>\n",
990                       (long) gdbarch->return_value);
991   fprintf_unfiltered (file,
992                       "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
993                       (long) gdbarch->sdb_reg_to_regnum);
994   fprintf_unfiltered (file,
995                       "gdbarch_dump: short_bit = %s\n",
996                       paddr_d (gdbarch->short_bit));
997   fprintf_unfiltered (file,
998                       "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
999                       gdbarch_single_step_through_delay_p (gdbarch));
1000   fprintf_unfiltered (file,
1001                       "gdbarch_dump: single_step_through_delay = <0x%lx>\n",
1002                       (long) gdbarch->single_step_through_delay);
1003   fprintf_unfiltered (file,
1004                       "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
1005                       gdbarch_skip_permanent_breakpoint_p (gdbarch));
1006   fprintf_unfiltered (file,
1007                       "gdbarch_dump: skip_permanent_breakpoint = <0x%lx>\n",
1008                       (long) gdbarch->skip_permanent_breakpoint);
1009   fprintf_unfiltered (file,
1010                       "gdbarch_dump: skip_prologue = <0x%lx>\n",
1011                       (long) gdbarch->skip_prologue);
1012   fprintf_unfiltered (file,
1013                       "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
1014                       (long) gdbarch->skip_solib_resolver);
1015   fprintf_unfiltered (file,
1016                       "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
1017                       (long) gdbarch->skip_trampoline_code);
1018   fprintf_unfiltered (file,
1019                       "gdbarch_dump: smash_text_address = <0x%lx>\n",
1020                       (long) gdbarch->smash_text_address);
1021   fprintf_unfiltered (file,
1022                       "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
1023                       gdbarch_software_single_step_p (gdbarch));
1024   fprintf_unfiltered (file,
1025                       "gdbarch_dump: software_single_step = <0x%lx>\n",
1026                       (long) gdbarch->software_single_step);
1027   fprintf_unfiltered (file,
1028                       "gdbarch_dump: sofun_address_maybe_missing = %s\n",
1029                       paddr_d (gdbarch->sofun_address_maybe_missing));
1030   fprintf_unfiltered (file,
1031                       "gdbarch_dump: sp_regnum = %s\n",
1032                       paddr_d (gdbarch->sp_regnum));
1033   fprintf_unfiltered (file,
1034                       "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
1035                       (long) gdbarch->stab_reg_to_regnum);
1036   fprintf_unfiltered (file,
1037                       "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
1038                       (long) gdbarch->stabs_argument_has_addr);
1039   fprintf_unfiltered (file,
1040                       "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
1041                       gdbarch_static_transform_name_p (gdbarch));
1042   fprintf_unfiltered (file,
1043                       "gdbarch_dump: static_transform_name = <0x%lx>\n",
1044                       (long) gdbarch->static_transform_name);
1045   fprintf_unfiltered (file,
1046                       "gdbarch_dump: target_desc = %s\n",
1047                       paddr_d ((long) gdbarch->target_desc));
1048   fprintf_unfiltered (file,
1049                       "gdbarch_dump: target_signal_from_host = <0x%lx>\n",
1050                       (long) gdbarch->target_signal_from_host);
1051   fprintf_unfiltered (file,
1052                       "gdbarch_dump: target_signal_to_host = <0x%lx>\n",
1053                       (long) gdbarch->target_signal_to_host);
1054   fprintf_unfiltered (file,
1055                       "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
1056                       gdbarch_unwind_pc_p (gdbarch));
1057   fprintf_unfiltered (file,
1058                       "gdbarch_dump: unwind_pc = <0x%lx>\n",
1059                       (long) gdbarch->unwind_pc);
1060   fprintf_unfiltered (file,
1061                       "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
1062                       gdbarch_unwind_sp_p (gdbarch));
1063   fprintf_unfiltered (file,
1064                       "gdbarch_dump: unwind_sp = <0x%lx>\n",
1065                       (long) gdbarch->unwind_sp);
1066   fprintf_unfiltered (file,
1067                       "gdbarch_dump: value_from_register = <0x%lx>\n",
1068                       (long) gdbarch->value_from_register);
1069   fprintf_unfiltered (file,
1070                       "gdbarch_dump: value_to_register = <0x%lx>\n",
1071                       (long) gdbarch->value_to_register);
1072   fprintf_unfiltered (file,
1073                       "gdbarch_dump: vbit_in_delta = %s\n",
1074                       paddr_d (gdbarch->vbit_in_delta));
1075   fprintf_unfiltered (file,
1076                       "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
1077                       (long) gdbarch->virtual_frame_pointer);
1078   fprintf_unfiltered (file,
1079                       "gdbarch_dump: vtable_function_descriptors = %s\n",
1080                       paddr_d (gdbarch->vtable_function_descriptors));
1081   fprintf_unfiltered (file,
1082                       "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
1083                       gdbarch_write_pc_p (gdbarch));
1084   fprintf_unfiltered (file,
1085                       "gdbarch_dump: write_pc = <0x%lx>\n",
1086                       (long) gdbarch->write_pc);
1087   if (gdbarch->dump_tdep != NULL)
1088     gdbarch->dump_tdep (gdbarch, file);
1089 }
1090
1091 struct gdbarch_tdep *
1092 gdbarch_tdep (struct gdbarch *gdbarch)
1093 {
1094   if (gdbarch_debug >= 2)
1095     fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
1096   return gdbarch->tdep;
1097 }
1098
1099
1100 const struct bfd_arch_info *
1101 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
1102 {
1103   gdb_assert (gdbarch != NULL);
1104   if (gdbarch_debug >= 2)
1105     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
1106   return gdbarch->bfd_arch_info;
1107 }
1108
1109 int
1110 gdbarch_byte_order (struct gdbarch *gdbarch)
1111 {
1112   gdb_assert (gdbarch != NULL);
1113   if (gdbarch_debug >= 2)
1114     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
1115   return gdbarch->byte_order;
1116 }
1117
1118 enum gdb_osabi
1119 gdbarch_osabi (struct gdbarch *gdbarch)
1120 {
1121   gdb_assert (gdbarch != NULL);
1122   if (gdbarch_debug >= 2)
1123     fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
1124   return gdbarch->osabi;
1125 }
1126
1127 const struct target_desc *
1128 gdbarch_target_desc (struct gdbarch *gdbarch)
1129 {
1130   gdb_assert (gdbarch != NULL);
1131   if (gdbarch_debug >= 2)
1132     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
1133   return gdbarch->target_desc;
1134 }
1135
1136 int
1137 gdbarch_bits_big_endian (struct gdbarch *gdbarch)
1138 {
1139   gdb_assert (gdbarch != NULL);
1140   /* Skip verify of bits_big_endian, invalid_p == 0 */
1141   if (gdbarch_debug >= 2)
1142     fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
1143   return gdbarch->bits_big_endian;
1144 }
1145
1146 void
1147 set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
1148                              int bits_big_endian)
1149 {
1150   gdbarch->bits_big_endian = bits_big_endian;
1151 }
1152
1153 int
1154 gdbarch_short_bit (struct gdbarch *gdbarch)
1155 {
1156   gdb_assert (gdbarch != NULL);
1157   /* Skip verify of short_bit, invalid_p == 0 */
1158   if (gdbarch_debug >= 2)
1159     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
1160   return gdbarch->short_bit;
1161 }
1162
1163 void
1164 set_gdbarch_short_bit (struct gdbarch *gdbarch,
1165                        int short_bit)
1166 {
1167   gdbarch->short_bit = short_bit;
1168 }
1169
1170 int
1171 gdbarch_int_bit (struct gdbarch *gdbarch)
1172 {
1173   gdb_assert (gdbarch != NULL);
1174   /* Skip verify of int_bit, invalid_p == 0 */
1175   if (gdbarch_debug >= 2)
1176     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
1177   return gdbarch->int_bit;
1178 }
1179
1180 void
1181 set_gdbarch_int_bit (struct gdbarch *gdbarch,
1182                      int int_bit)
1183 {
1184   gdbarch->int_bit = int_bit;
1185 }
1186
1187 int
1188 gdbarch_long_bit (struct gdbarch *gdbarch)
1189 {
1190   gdb_assert (gdbarch != NULL);
1191   /* Skip verify of long_bit, invalid_p == 0 */
1192   if (gdbarch_debug >= 2)
1193     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
1194   return gdbarch->long_bit;
1195 }
1196
1197 void
1198 set_gdbarch_long_bit (struct gdbarch *gdbarch,
1199                       int long_bit)
1200 {
1201   gdbarch->long_bit = long_bit;
1202 }
1203
1204 int
1205 gdbarch_long_long_bit (struct gdbarch *gdbarch)
1206 {
1207   gdb_assert (gdbarch != NULL);
1208   /* Skip verify of long_long_bit, invalid_p == 0 */
1209   if (gdbarch_debug >= 2)
1210     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
1211   return gdbarch->long_long_bit;
1212 }
1213
1214 void
1215 set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
1216                            int long_long_bit)
1217 {
1218   gdbarch->long_long_bit = long_long_bit;
1219 }
1220
1221 int
1222 gdbarch_float_bit (struct gdbarch *gdbarch)
1223 {
1224   gdb_assert (gdbarch != NULL);
1225   /* Skip verify of float_bit, invalid_p == 0 */
1226   if (gdbarch_debug >= 2)
1227     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
1228   return gdbarch->float_bit;
1229 }
1230
1231 void
1232 set_gdbarch_float_bit (struct gdbarch *gdbarch,
1233                        int float_bit)
1234 {
1235   gdbarch->float_bit = float_bit;
1236 }
1237
1238 const struct floatformat **
1239 gdbarch_float_format (struct gdbarch *gdbarch)
1240 {
1241   gdb_assert (gdbarch != NULL);
1242   if (gdbarch_debug >= 2)
1243     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
1244   return gdbarch->float_format;
1245 }
1246
1247 void
1248 set_gdbarch_float_format (struct gdbarch *gdbarch,
1249                           const struct floatformat ** float_format)
1250 {
1251   gdbarch->float_format = float_format;
1252 }
1253
1254 int
1255 gdbarch_double_bit (struct gdbarch *gdbarch)
1256 {
1257   gdb_assert (gdbarch != NULL);
1258   /* Skip verify of double_bit, invalid_p == 0 */
1259   if (gdbarch_debug >= 2)
1260     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
1261   return gdbarch->double_bit;
1262 }
1263
1264 void
1265 set_gdbarch_double_bit (struct gdbarch *gdbarch,
1266                         int double_bit)
1267 {
1268   gdbarch->double_bit = double_bit;
1269 }
1270
1271 const struct floatformat **
1272 gdbarch_double_format (struct gdbarch *gdbarch)
1273 {
1274   gdb_assert (gdbarch != NULL);
1275   if (gdbarch_debug >= 2)
1276     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
1277   return gdbarch->double_format;
1278 }
1279
1280 void
1281 set_gdbarch_double_format (struct gdbarch *gdbarch,
1282                            const struct floatformat ** double_format)
1283 {
1284   gdbarch->double_format = double_format;
1285 }
1286
1287 int
1288 gdbarch_long_double_bit (struct gdbarch *gdbarch)
1289 {
1290   gdb_assert (gdbarch != NULL);
1291   /* Skip verify of long_double_bit, invalid_p == 0 */
1292   if (gdbarch_debug >= 2)
1293     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
1294   return gdbarch->long_double_bit;
1295 }
1296
1297 void
1298 set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
1299                              int long_double_bit)
1300 {
1301   gdbarch->long_double_bit = long_double_bit;
1302 }
1303
1304 const struct floatformat **
1305 gdbarch_long_double_format (struct gdbarch *gdbarch)
1306 {
1307   gdb_assert (gdbarch != NULL);
1308   if (gdbarch_debug >= 2)
1309     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
1310   return gdbarch->long_double_format;
1311 }
1312
1313 void
1314 set_gdbarch_long_double_format (struct gdbarch *gdbarch,
1315                                 const struct floatformat ** long_double_format)
1316 {
1317   gdbarch->long_double_format = long_double_format;
1318 }
1319
1320 int
1321 gdbarch_ptr_bit (struct gdbarch *gdbarch)
1322 {
1323   gdb_assert (gdbarch != NULL);
1324   /* Skip verify of ptr_bit, invalid_p == 0 */
1325   if (gdbarch_debug >= 2)
1326     fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
1327   return gdbarch->ptr_bit;
1328 }
1329
1330 void
1331 set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
1332                      int ptr_bit)
1333 {
1334   gdbarch->ptr_bit = ptr_bit;
1335 }
1336
1337 int
1338 gdbarch_addr_bit (struct gdbarch *gdbarch)
1339 {
1340   gdb_assert (gdbarch != NULL);
1341   /* Check variable changed from pre-default.  */
1342   gdb_assert (gdbarch->addr_bit != 0);
1343   if (gdbarch_debug >= 2)
1344     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
1345   return gdbarch->addr_bit;
1346 }
1347
1348 void
1349 set_gdbarch_addr_bit (struct gdbarch *gdbarch,
1350                       int addr_bit)
1351 {
1352   gdbarch->addr_bit = addr_bit;
1353 }
1354
1355 int
1356 gdbarch_char_signed (struct gdbarch *gdbarch)
1357 {
1358   gdb_assert (gdbarch != NULL);
1359   /* Check variable changed from pre-default.  */
1360   gdb_assert (gdbarch->char_signed != -1);
1361   if (gdbarch_debug >= 2)
1362     fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
1363   return gdbarch->char_signed;
1364 }
1365
1366 void
1367 set_gdbarch_char_signed (struct gdbarch *gdbarch,
1368                          int char_signed)
1369 {
1370   gdbarch->char_signed = char_signed;
1371 }
1372
1373 int
1374 gdbarch_read_pc_p (struct gdbarch *gdbarch)
1375 {
1376   gdb_assert (gdbarch != NULL);
1377   return gdbarch->read_pc != NULL;
1378 }
1379
1380 CORE_ADDR
1381 gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
1382 {
1383   gdb_assert (gdbarch != NULL);
1384   gdb_assert (gdbarch->read_pc != NULL);
1385   if (gdbarch_debug >= 2)
1386     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
1387   return gdbarch->read_pc (regcache);
1388 }
1389
1390 void
1391 set_gdbarch_read_pc (struct gdbarch *gdbarch,
1392                      gdbarch_read_pc_ftype read_pc)
1393 {
1394   gdbarch->read_pc = read_pc;
1395 }
1396
1397 int
1398 gdbarch_write_pc_p (struct gdbarch *gdbarch)
1399 {
1400   gdb_assert (gdbarch != NULL);
1401   return gdbarch->write_pc != NULL;
1402 }
1403
1404 void
1405 gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
1406 {
1407   gdb_assert (gdbarch != NULL);
1408   gdb_assert (gdbarch->write_pc != NULL);
1409   if (gdbarch_debug >= 2)
1410     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
1411   gdbarch->write_pc (regcache, val);
1412 }
1413
1414 void
1415 set_gdbarch_write_pc (struct gdbarch *gdbarch,
1416                       gdbarch_write_pc_ftype write_pc)
1417 {
1418   gdbarch->write_pc = write_pc;
1419 }
1420
1421 void
1422 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
1423 {
1424   gdb_assert (gdbarch != NULL);
1425   gdb_assert (gdbarch->virtual_frame_pointer != NULL);
1426   if (gdbarch_debug >= 2)
1427     fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
1428   gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
1429 }
1430
1431 void
1432 set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
1433                                    gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
1434 {
1435   gdbarch->virtual_frame_pointer = virtual_frame_pointer;
1436 }
1437
1438 int
1439 gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
1440 {
1441   gdb_assert (gdbarch != NULL);
1442   return gdbarch->pseudo_register_read != NULL;
1443 }
1444
1445 void
1446 gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
1447 {
1448   gdb_assert (gdbarch != NULL);
1449   gdb_assert (gdbarch->pseudo_register_read != NULL);
1450   if (gdbarch_debug >= 2)
1451     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1452   gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
1453 }
1454
1455 void
1456 set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
1457                                   gdbarch_pseudo_register_read_ftype pseudo_register_read)
1458 {
1459   gdbarch->pseudo_register_read = pseudo_register_read;
1460 }
1461
1462 int
1463 gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
1464 {
1465   gdb_assert (gdbarch != NULL);
1466   return gdbarch->pseudo_register_write != NULL;
1467 }
1468
1469 void
1470 gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
1471 {
1472   gdb_assert (gdbarch != NULL);
1473   gdb_assert (gdbarch->pseudo_register_write != NULL);
1474   if (gdbarch_debug >= 2)
1475     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
1476   gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
1477 }
1478
1479 void
1480 set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
1481                                    gdbarch_pseudo_register_write_ftype pseudo_register_write)
1482 {
1483   gdbarch->pseudo_register_write = pseudo_register_write;
1484 }
1485
1486 int
1487 gdbarch_num_regs (struct gdbarch *gdbarch)
1488 {
1489   gdb_assert (gdbarch != NULL);
1490   /* Check variable changed from pre-default.  */
1491   gdb_assert (gdbarch->num_regs != -1);
1492   if (gdbarch_debug >= 2)
1493     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
1494   return gdbarch->num_regs;
1495 }
1496
1497 void
1498 set_gdbarch_num_regs (struct gdbarch *gdbarch,
1499                       int num_regs)
1500 {
1501   gdbarch->num_regs = num_regs;
1502 }
1503
1504 int
1505 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
1506 {
1507   gdb_assert (gdbarch != NULL);
1508   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
1509   if (gdbarch_debug >= 2)
1510     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
1511   return gdbarch->num_pseudo_regs;
1512 }
1513
1514 void
1515 set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
1516                              int num_pseudo_regs)
1517 {
1518   gdbarch->num_pseudo_regs = num_pseudo_regs;
1519 }
1520
1521 int
1522 gdbarch_sp_regnum (struct gdbarch *gdbarch)
1523 {
1524   gdb_assert (gdbarch != NULL);
1525   /* Skip verify of sp_regnum, invalid_p == 0 */
1526   if (gdbarch_debug >= 2)
1527     fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
1528   return gdbarch->sp_regnum;
1529 }
1530
1531 void
1532 set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
1533                        int sp_regnum)
1534 {
1535   gdbarch->sp_regnum = sp_regnum;
1536 }
1537
1538 int
1539 gdbarch_pc_regnum (struct gdbarch *gdbarch)
1540 {
1541   gdb_assert (gdbarch != NULL);
1542   /* Skip verify of pc_regnum, invalid_p == 0 */
1543   if (gdbarch_debug >= 2)
1544     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
1545   return gdbarch->pc_regnum;
1546 }
1547
1548 void
1549 set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
1550                        int pc_regnum)
1551 {
1552   gdbarch->pc_regnum = pc_regnum;
1553 }
1554
1555 int
1556 gdbarch_ps_regnum (struct gdbarch *gdbarch)
1557 {
1558   gdb_assert (gdbarch != NULL);
1559   /* Skip verify of ps_regnum, invalid_p == 0 */
1560   if (gdbarch_debug >= 2)
1561     fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
1562   return gdbarch->ps_regnum;
1563 }
1564
1565 void
1566 set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
1567                        int ps_regnum)
1568 {
1569   gdbarch->ps_regnum = ps_regnum;
1570 }
1571
1572 int
1573 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
1574 {
1575   gdb_assert (gdbarch != NULL);
1576   /* Skip verify of fp0_regnum, invalid_p == 0 */
1577   if (gdbarch_debug >= 2)
1578     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
1579   return gdbarch->fp0_regnum;
1580 }
1581
1582 void
1583 set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
1584                         int fp0_regnum)
1585 {
1586   gdbarch->fp0_regnum = fp0_regnum;
1587 }
1588
1589 int
1590 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
1591 {
1592   gdb_assert (gdbarch != NULL);
1593   gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
1594   if (gdbarch_debug >= 2)
1595     fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
1596   return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
1597 }
1598
1599 void
1600 set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
1601                                 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
1602 {
1603   gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
1604 }
1605
1606 int
1607 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
1608 {
1609   gdb_assert (gdbarch != NULL);
1610   gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
1611   if (gdbarch_debug >= 2)
1612     fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
1613   return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
1614 }
1615
1616 void
1617 set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
1618                                  gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
1619 {
1620   gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
1621 }
1622
1623 int
1624 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
1625 {
1626   gdb_assert (gdbarch != NULL);
1627   gdb_assert (gdbarch->dwarf_reg_to_regnum != NULL);
1628   if (gdbarch_debug >= 2)
1629     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
1630   return gdbarch->dwarf_reg_to_regnum (gdbarch, dwarf_regnr);
1631 }
1632
1633 void
1634 set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
1635                                  gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
1636 {
1637   gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
1638 }
1639
1640 int
1641 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
1642 {
1643   gdb_assert (gdbarch != NULL);
1644   gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
1645   if (gdbarch_debug >= 2)
1646     fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
1647   return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
1648 }
1649
1650 void
1651 set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
1652                                gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
1653 {
1654   gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
1655 }
1656
1657 int
1658 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
1659 {
1660   gdb_assert (gdbarch != NULL);
1661   gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
1662   if (gdbarch_debug >= 2)
1663     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
1664   return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
1665 }
1666
1667 void
1668 set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
1669                                   gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
1670 {
1671   gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
1672 }
1673
1674 const char *
1675 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
1676 {
1677   gdb_assert (gdbarch != NULL);
1678   gdb_assert (gdbarch->register_name != NULL);
1679   if (gdbarch_debug >= 2)
1680     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
1681   return gdbarch->register_name (gdbarch, regnr);
1682 }
1683
1684 void
1685 set_gdbarch_register_name (struct gdbarch *gdbarch,
1686                            gdbarch_register_name_ftype register_name)
1687 {
1688   gdbarch->register_name = register_name;
1689 }
1690
1691 int
1692 gdbarch_register_type_p (struct gdbarch *gdbarch)
1693 {
1694   gdb_assert (gdbarch != NULL);
1695   return gdbarch->register_type != NULL;
1696 }
1697
1698 struct type *
1699 gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
1700 {
1701   gdb_assert (gdbarch != NULL);
1702   gdb_assert (gdbarch->register_type != NULL);
1703   if (gdbarch_debug >= 2)
1704     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
1705   return gdbarch->register_type (gdbarch, reg_nr);
1706 }
1707
1708 void
1709 set_gdbarch_register_type (struct gdbarch *gdbarch,
1710                            gdbarch_register_type_ftype register_type)
1711 {
1712   gdbarch->register_type = register_type;
1713 }
1714
1715 int
1716 gdbarch_dummy_id_p (struct gdbarch *gdbarch)
1717 {
1718   gdb_assert (gdbarch != NULL);
1719   return gdbarch->dummy_id != NULL;
1720 }
1721
1722 struct frame_id
1723 gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
1724 {
1725   gdb_assert (gdbarch != NULL);
1726   gdb_assert (gdbarch->dummy_id != NULL);
1727   if (gdbarch_debug >= 2)
1728     fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
1729   return gdbarch->dummy_id (gdbarch, this_frame);
1730 }
1731
1732 void
1733 set_gdbarch_dummy_id (struct gdbarch *gdbarch,
1734                       gdbarch_dummy_id_ftype dummy_id)
1735 {
1736   gdbarch->dummy_id = dummy_id;
1737 }
1738
1739 int
1740 gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
1741 {
1742   gdb_assert (gdbarch != NULL);
1743   /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
1744   if (gdbarch_debug >= 2)
1745     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
1746   return gdbarch->deprecated_fp_regnum;
1747 }
1748
1749 void
1750 set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
1751                                   int deprecated_fp_regnum)
1752 {
1753   gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
1754 }
1755
1756 int
1757 gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
1758 {
1759   gdb_assert (gdbarch != NULL);
1760   return gdbarch->push_dummy_call != NULL;
1761 }
1762
1763 CORE_ADDR
1764 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)
1765 {
1766   gdb_assert (gdbarch != NULL);
1767   gdb_assert (gdbarch->push_dummy_call != NULL);
1768   if (gdbarch_debug >= 2)
1769     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
1770   return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
1771 }
1772
1773 void
1774 set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
1775                              gdbarch_push_dummy_call_ftype push_dummy_call)
1776 {
1777   gdbarch->push_dummy_call = push_dummy_call;
1778 }
1779
1780 int
1781 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
1782 {
1783   gdb_assert (gdbarch != NULL);
1784   /* Skip verify of call_dummy_location, invalid_p == 0 */
1785   if (gdbarch_debug >= 2)
1786     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
1787   return gdbarch->call_dummy_location;
1788 }
1789
1790 void
1791 set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
1792                                  int call_dummy_location)
1793 {
1794   gdbarch->call_dummy_location = call_dummy_location;
1795 }
1796
1797 int
1798 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
1799 {
1800   gdb_assert (gdbarch != NULL);
1801   return gdbarch->push_dummy_code != NULL;
1802 }
1803
1804 CORE_ADDR
1805 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)
1806 {
1807   gdb_assert (gdbarch != NULL);
1808   gdb_assert (gdbarch->push_dummy_code != NULL);
1809   if (gdbarch_debug >= 2)
1810     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
1811   return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
1812 }
1813
1814 void
1815 set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
1816                              gdbarch_push_dummy_code_ftype push_dummy_code)
1817 {
1818   gdbarch->push_dummy_code = push_dummy_code;
1819 }
1820
1821 void
1822 gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
1823 {
1824   gdb_assert (gdbarch != NULL);
1825   gdb_assert (gdbarch->print_registers_info != NULL);
1826   if (gdbarch_debug >= 2)
1827     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
1828   gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
1829 }
1830
1831 void
1832 set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
1833                                   gdbarch_print_registers_info_ftype print_registers_info)
1834 {
1835   gdbarch->print_registers_info = print_registers_info;
1836 }
1837
1838 int
1839 gdbarch_print_float_info_p (struct gdbarch *gdbarch)
1840 {
1841   gdb_assert (gdbarch != NULL);
1842   return gdbarch->print_float_info != NULL;
1843 }
1844
1845 void
1846 gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1847 {
1848   gdb_assert (gdbarch != NULL);
1849   gdb_assert (gdbarch->print_float_info != NULL);
1850   if (gdbarch_debug >= 2)
1851     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
1852   gdbarch->print_float_info (gdbarch, file, frame, args);
1853 }
1854
1855 void
1856 set_gdbarch_print_float_info (struct gdbarch *gdbarch,
1857                               gdbarch_print_float_info_ftype print_float_info)
1858 {
1859   gdbarch->print_float_info = print_float_info;
1860 }
1861
1862 int
1863 gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
1864 {
1865   gdb_assert (gdbarch != NULL);
1866   return gdbarch->print_vector_info != NULL;
1867 }
1868
1869 void
1870 gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
1871 {
1872   gdb_assert (gdbarch != NULL);
1873   gdb_assert (gdbarch->print_vector_info != NULL);
1874   if (gdbarch_debug >= 2)
1875     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
1876   gdbarch->print_vector_info (gdbarch, file, frame, args);
1877 }
1878
1879 void
1880 set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
1881                                gdbarch_print_vector_info_ftype print_vector_info)
1882 {
1883   gdbarch->print_vector_info = print_vector_info;
1884 }
1885
1886 int
1887 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
1888 {
1889   gdb_assert (gdbarch != NULL);
1890   gdb_assert (gdbarch->register_sim_regno != NULL);
1891   if (gdbarch_debug >= 2)
1892     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
1893   return gdbarch->register_sim_regno (gdbarch, reg_nr);
1894 }
1895
1896 void
1897 set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
1898                                 gdbarch_register_sim_regno_ftype register_sim_regno)
1899 {
1900   gdbarch->register_sim_regno = register_sim_regno;
1901 }
1902
1903 int
1904 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
1905 {
1906   gdb_assert (gdbarch != NULL);
1907   gdb_assert (gdbarch->cannot_fetch_register != NULL);
1908   if (gdbarch_debug >= 2)
1909     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
1910   return gdbarch->cannot_fetch_register (gdbarch, regnum);
1911 }
1912
1913 void
1914 set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
1915                                    gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
1916 {
1917   gdbarch->cannot_fetch_register = cannot_fetch_register;
1918 }
1919
1920 int
1921 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
1922 {
1923   gdb_assert (gdbarch != NULL);
1924   gdb_assert (gdbarch->cannot_store_register != NULL);
1925   if (gdbarch_debug >= 2)
1926     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
1927   return gdbarch->cannot_store_register (gdbarch, regnum);
1928 }
1929
1930 void
1931 set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
1932                                    gdbarch_cannot_store_register_ftype cannot_store_register)
1933 {
1934   gdbarch->cannot_store_register = cannot_store_register;
1935 }
1936
1937 int
1938 gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
1939 {
1940   gdb_assert (gdbarch != NULL);
1941   return gdbarch->get_longjmp_target != NULL;
1942 }
1943
1944 int
1945 gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
1946 {
1947   gdb_assert (gdbarch != NULL);
1948   gdb_assert (gdbarch->get_longjmp_target != NULL);
1949   if (gdbarch_debug >= 2)
1950     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
1951   return gdbarch->get_longjmp_target (frame, pc);
1952 }
1953
1954 void
1955 set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
1956                                 gdbarch_get_longjmp_target_ftype get_longjmp_target)
1957 {
1958   gdbarch->get_longjmp_target = get_longjmp_target;
1959 }
1960
1961 int
1962 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
1963 {
1964   gdb_assert (gdbarch != NULL);
1965   if (gdbarch_debug >= 2)
1966     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
1967   return gdbarch->believe_pcc_promotion;
1968 }
1969
1970 void
1971 set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
1972                                    int believe_pcc_promotion)
1973 {
1974   gdbarch->believe_pcc_promotion = believe_pcc_promotion;
1975 }
1976
1977 int
1978 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
1979 {
1980   gdb_assert (gdbarch != NULL);
1981   gdb_assert (gdbarch->convert_register_p != NULL);
1982   if (gdbarch_debug >= 2)
1983     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
1984   return gdbarch->convert_register_p (gdbarch, regnum, type);
1985 }
1986
1987 void
1988 set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
1989                                 gdbarch_convert_register_p_ftype convert_register_p)
1990 {
1991   gdbarch->convert_register_p = convert_register_p;
1992 }
1993
1994 void
1995 gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf)
1996 {
1997   gdb_assert (gdbarch != NULL);
1998   gdb_assert (gdbarch->register_to_value != NULL);
1999   if (gdbarch_debug >= 2)
2000     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2001   gdbarch->register_to_value (frame, regnum, type, buf);
2002 }
2003
2004 void
2005 set_gdbarch_register_to_value (struct gdbarch *gdbarch,
2006                                gdbarch_register_to_value_ftype register_to_value)
2007 {
2008   gdbarch->register_to_value = register_to_value;
2009 }
2010
2011 void
2012 gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
2013 {
2014   gdb_assert (gdbarch != NULL);
2015   gdb_assert (gdbarch->value_to_register != NULL);
2016   if (gdbarch_debug >= 2)
2017     fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
2018   gdbarch->value_to_register (frame, regnum, type, buf);
2019 }
2020
2021 void
2022 set_gdbarch_value_to_register (struct gdbarch *gdbarch,
2023                                gdbarch_value_to_register_ftype value_to_register)
2024 {
2025   gdbarch->value_to_register = value_to_register;
2026 }
2027
2028 struct value *
2029 gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
2030 {
2031   gdb_assert (gdbarch != NULL);
2032   gdb_assert (gdbarch->value_from_register != NULL);
2033   if (gdbarch_debug >= 2)
2034     fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
2035   return gdbarch->value_from_register (type, regnum, frame);
2036 }
2037
2038 void
2039 set_gdbarch_value_from_register (struct gdbarch *gdbarch,
2040                                  gdbarch_value_from_register_ftype value_from_register)
2041 {
2042   gdbarch->value_from_register = value_from_register;
2043 }
2044
2045 CORE_ADDR
2046 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2047 {
2048   gdb_assert (gdbarch != NULL);
2049   gdb_assert (gdbarch->pointer_to_address != NULL);
2050   if (gdbarch_debug >= 2)
2051     fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
2052   return gdbarch->pointer_to_address (type, buf);
2053 }
2054
2055 void
2056 set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
2057                                 gdbarch_pointer_to_address_ftype pointer_to_address)
2058 {
2059   gdbarch->pointer_to_address = pointer_to_address;
2060 }
2061
2062 void
2063 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
2064 {
2065   gdb_assert (gdbarch != NULL);
2066   gdb_assert (gdbarch->address_to_pointer != NULL);
2067   if (gdbarch_debug >= 2)
2068     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
2069   gdbarch->address_to_pointer (type, buf, addr);
2070 }
2071
2072 void
2073 set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
2074                                 gdbarch_address_to_pointer_ftype address_to_pointer)
2075 {
2076   gdbarch->address_to_pointer = address_to_pointer;
2077 }
2078
2079 int
2080 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
2081 {
2082   gdb_assert (gdbarch != NULL);
2083   return gdbarch->integer_to_address != NULL;
2084 }
2085
2086 CORE_ADDR
2087 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
2088 {
2089   gdb_assert (gdbarch != NULL);
2090   gdb_assert (gdbarch->integer_to_address != NULL);
2091   if (gdbarch_debug >= 2)
2092     fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
2093   return gdbarch->integer_to_address (gdbarch, type, buf);
2094 }
2095
2096 void
2097 set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
2098                                 gdbarch_integer_to_address_ftype integer_to_address)
2099 {
2100   gdbarch->integer_to_address = integer_to_address;
2101 }
2102
2103 int
2104 gdbarch_return_value_p (struct gdbarch *gdbarch)
2105 {
2106   gdb_assert (gdbarch != NULL);
2107   return gdbarch->return_value != NULL;
2108 }
2109
2110 enum return_value_convention
2111 gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
2112 {
2113   gdb_assert (gdbarch != NULL);
2114   gdb_assert (gdbarch->return_value != NULL);
2115   if (gdbarch_debug >= 2)
2116     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
2117   return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
2118 }
2119
2120 void
2121 set_gdbarch_return_value (struct gdbarch *gdbarch,
2122                           gdbarch_return_value_ftype return_value)
2123 {
2124   gdbarch->return_value = return_value;
2125 }
2126
2127 CORE_ADDR
2128 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
2129 {
2130   gdb_assert (gdbarch != NULL);
2131   gdb_assert (gdbarch->skip_prologue != NULL);
2132   if (gdbarch_debug >= 2)
2133     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
2134   return gdbarch->skip_prologue (gdbarch, ip);
2135 }
2136
2137 void
2138 set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
2139                            gdbarch_skip_prologue_ftype skip_prologue)
2140 {
2141   gdbarch->skip_prologue = skip_prologue;
2142 }
2143
2144 int
2145 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
2146 {
2147   gdb_assert (gdbarch != NULL);
2148   gdb_assert (gdbarch->inner_than != NULL);
2149   if (gdbarch_debug >= 2)
2150     fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
2151   return gdbarch->inner_than (lhs, rhs);
2152 }
2153
2154 void
2155 set_gdbarch_inner_than (struct gdbarch *gdbarch,
2156                         gdbarch_inner_than_ftype inner_than)
2157 {
2158   gdbarch->inner_than = inner_than;
2159 }
2160
2161 const gdb_byte *
2162 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
2163 {
2164   gdb_assert (gdbarch != NULL);
2165   gdb_assert (gdbarch->breakpoint_from_pc != NULL);
2166   if (gdbarch_debug >= 2)
2167     fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
2168   return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
2169 }
2170
2171 void
2172 set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
2173                                 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
2174 {
2175   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
2176 }
2177
2178 int
2179 gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
2180 {
2181   gdb_assert (gdbarch != NULL);
2182   return gdbarch->adjust_breakpoint_address != NULL;
2183 }
2184
2185 CORE_ADDR
2186 gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
2187 {
2188   gdb_assert (gdbarch != NULL);
2189   gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
2190   if (gdbarch_debug >= 2)
2191     fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
2192   return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
2193 }
2194
2195 void
2196 set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
2197                                        gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
2198 {
2199   gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
2200 }
2201
2202 int
2203 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2204 {
2205   gdb_assert (gdbarch != NULL);
2206   gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
2207   if (gdbarch_debug >= 2)
2208     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
2209   return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
2210 }
2211
2212 void
2213 set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
2214                                       gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
2215 {
2216   gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
2217 }
2218
2219 int
2220 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
2221 {
2222   gdb_assert (gdbarch != NULL);
2223   gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
2224   if (gdbarch_debug >= 2)
2225     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
2226   return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
2227 }
2228
2229 void
2230 set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
2231                                       gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
2232 {
2233   gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
2234 }
2235
2236 CORE_ADDR
2237 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
2238 {
2239   gdb_assert (gdbarch != NULL);
2240   /* Skip verify of decr_pc_after_break, invalid_p == 0 */
2241   if (gdbarch_debug >= 2)
2242     fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
2243   return gdbarch->decr_pc_after_break;
2244 }
2245
2246 void
2247 set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
2248                                  CORE_ADDR decr_pc_after_break)
2249 {
2250   gdbarch->decr_pc_after_break = decr_pc_after_break;
2251 }
2252
2253 CORE_ADDR
2254 gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
2255 {
2256   gdb_assert (gdbarch != NULL);
2257   /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
2258   if (gdbarch_debug >= 2)
2259     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
2260   return gdbarch->deprecated_function_start_offset;
2261 }
2262
2263 void
2264 set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
2265                                               CORE_ADDR deprecated_function_start_offset)
2266 {
2267   gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
2268 }
2269
2270 int
2271 gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
2272 {
2273   gdb_assert (gdbarch != NULL);
2274   gdb_assert (gdbarch->remote_register_number != NULL);
2275   if (gdbarch_debug >= 2)
2276     fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
2277   return gdbarch->remote_register_number (gdbarch, regno);
2278 }
2279
2280 void
2281 set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
2282                                     gdbarch_remote_register_number_ftype remote_register_number)
2283 {
2284   gdbarch->remote_register_number = remote_register_number;
2285 }
2286
2287 int
2288 gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
2289 {
2290   gdb_assert (gdbarch != NULL);
2291   return gdbarch->fetch_tls_load_module_address != NULL;
2292 }
2293
2294 CORE_ADDR
2295 gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
2296 {
2297   gdb_assert (gdbarch != NULL);
2298   gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
2299   if (gdbarch_debug >= 2)
2300     fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
2301   return gdbarch->fetch_tls_load_module_address (objfile);
2302 }
2303
2304 void
2305 set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
2306                                            gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
2307 {
2308   gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
2309 }
2310
2311 CORE_ADDR
2312 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
2313 {
2314   gdb_assert (gdbarch != NULL);
2315   /* Skip verify of frame_args_skip, invalid_p == 0 */
2316   if (gdbarch_debug >= 2)
2317     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
2318   return gdbarch->frame_args_skip;
2319 }
2320
2321 void
2322 set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
2323                              CORE_ADDR frame_args_skip)
2324 {
2325   gdbarch->frame_args_skip = frame_args_skip;
2326 }
2327
2328 int
2329 gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
2330 {
2331   gdb_assert (gdbarch != NULL);
2332   return gdbarch->unwind_pc != NULL;
2333 }
2334
2335 CORE_ADDR
2336 gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
2337 {
2338   gdb_assert (gdbarch != NULL);
2339   gdb_assert (gdbarch->unwind_pc != NULL);
2340   if (gdbarch_debug >= 2)
2341     fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
2342   return gdbarch->unwind_pc (gdbarch, next_frame);
2343 }
2344
2345 void
2346 set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
2347                        gdbarch_unwind_pc_ftype unwind_pc)
2348 {
2349   gdbarch->unwind_pc = unwind_pc;
2350 }
2351
2352 int
2353 gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
2354 {
2355   gdb_assert (gdbarch != NULL);
2356   return gdbarch->unwind_sp != NULL;
2357 }
2358
2359 CORE_ADDR
2360 gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
2361 {
2362   gdb_assert (gdbarch != NULL);
2363   gdb_assert (gdbarch->unwind_sp != NULL);
2364   if (gdbarch_debug >= 2)
2365     fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
2366   return gdbarch->unwind_sp (gdbarch, next_frame);
2367 }
2368
2369 void
2370 set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
2371                        gdbarch_unwind_sp_ftype unwind_sp)
2372 {
2373   gdbarch->unwind_sp = unwind_sp;
2374 }
2375
2376 int
2377 gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
2378 {
2379   gdb_assert (gdbarch != NULL);
2380   return gdbarch->frame_num_args != NULL;
2381 }
2382
2383 int
2384 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
2385 {
2386   gdb_assert (gdbarch != NULL);
2387   gdb_assert (gdbarch->frame_num_args != NULL);
2388   if (gdbarch_debug >= 2)
2389     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
2390   return gdbarch->frame_num_args (frame);
2391 }
2392
2393 void
2394 set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
2395                             gdbarch_frame_num_args_ftype frame_num_args)
2396 {
2397   gdbarch->frame_num_args = frame_num_args;
2398 }
2399
2400 int
2401 gdbarch_frame_align_p (struct gdbarch *gdbarch)
2402 {
2403   gdb_assert (gdbarch != NULL);
2404   return gdbarch->frame_align != NULL;
2405 }
2406
2407 CORE_ADDR
2408 gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
2409 {
2410   gdb_assert (gdbarch != NULL);
2411   gdb_assert (gdbarch->frame_align != NULL);
2412   if (gdbarch_debug >= 2)
2413     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
2414   return gdbarch->frame_align (gdbarch, address);
2415 }
2416
2417 void
2418 set_gdbarch_frame_align (struct gdbarch *gdbarch,
2419                          gdbarch_frame_align_ftype frame_align)
2420 {
2421   gdbarch->frame_align = frame_align;
2422 }
2423
2424 int
2425 gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
2426 {
2427   gdb_assert (gdbarch != NULL);
2428   gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
2429   if (gdbarch_debug >= 2)
2430     fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
2431   return gdbarch->stabs_argument_has_addr (gdbarch, type);
2432 }
2433
2434 void
2435 set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
2436                                      gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
2437 {
2438   gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
2439 }
2440
2441 int
2442 gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
2443 {
2444   gdb_assert (gdbarch != NULL);
2445   if (gdbarch_debug >= 2)
2446     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
2447   return gdbarch->frame_red_zone_size;
2448 }
2449
2450 void
2451 set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
2452                                  int frame_red_zone_size)
2453 {
2454   gdbarch->frame_red_zone_size = frame_red_zone_size;
2455 }
2456
2457 CORE_ADDR
2458 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
2459 {
2460   gdb_assert (gdbarch != NULL);
2461   gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
2462   if (gdbarch_debug >= 2)
2463     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
2464   return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
2465 }
2466
2467 void
2468 set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
2469                                         gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
2470 {
2471   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
2472 }
2473
2474 CORE_ADDR
2475 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
2476 {
2477   gdb_assert (gdbarch != NULL);
2478   gdb_assert (gdbarch->addr_bits_remove != NULL);
2479   if (gdbarch_debug >= 2)
2480     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
2481   return gdbarch->addr_bits_remove (addr);
2482 }
2483
2484 void
2485 set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
2486                               gdbarch_addr_bits_remove_ftype addr_bits_remove)
2487 {
2488   gdbarch->addr_bits_remove = addr_bits_remove;
2489 }
2490
2491 CORE_ADDR
2492 gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
2493 {
2494   gdb_assert (gdbarch != NULL);
2495   gdb_assert (gdbarch->smash_text_address != NULL);
2496   if (gdbarch_debug >= 2)
2497     fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
2498   return gdbarch->smash_text_address (addr);
2499 }
2500
2501 void
2502 set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
2503                                 gdbarch_smash_text_address_ftype smash_text_address)
2504 {
2505   gdbarch->smash_text_address = smash_text_address;
2506 }
2507
2508 int
2509 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
2510 {
2511   gdb_assert (gdbarch != NULL);
2512   return gdbarch->software_single_step != NULL;
2513 }
2514
2515 int
2516 gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
2517 {
2518   gdb_assert (gdbarch != NULL);
2519   gdb_assert (gdbarch->software_single_step != NULL);
2520   if (gdbarch_debug >= 2)
2521     fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
2522   return gdbarch->software_single_step (frame);
2523 }
2524
2525 void
2526 set_gdbarch_software_single_step (struct gdbarch *gdbarch,
2527                                   gdbarch_software_single_step_ftype software_single_step)
2528 {
2529   gdbarch->software_single_step = software_single_step;
2530 }
2531
2532 int
2533 gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
2534 {
2535   gdb_assert (gdbarch != NULL);
2536   return gdbarch->single_step_through_delay != NULL;
2537 }
2538
2539 int
2540 gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
2541 {
2542   gdb_assert (gdbarch != NULL);
2543   gdb_assert (gdbarch->single_step_through_delay != NULL);
2544   if (gdbarch_debug >= 2)
2545     fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
2546   return gdbarch->single_step_through_delay (gdbarch, frame);
2547 }
2548
2549 void
2550 set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
2551                                        gdbarch_single_step_through_delay_ftype single_step_through_delay)
2552 {
2553   gdbarch->single_step_through_delay = single_step_through_delay;
2554 }
2555
2556 int
2557 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
2558 {
2559   gdb_assert (gdbarch != NULL);
2560   gdb_assert (gdbarch->print_insn != NULL);
2561   if (gdbarch_debug >= 2)
2562     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
2563   return gdbarch->print_insn (vma, info);
2564 }
2565
2566 void
2567 set_gdbarch_print_insn (struct gdbarch *gdbarch,
2568                         gdbarch_print_insn_ftype print_insn)
2569 {
2570   gdbarch->print_insn = print_insn;
2571 }
2572
2573 CORE_ADDR
2574 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
2575 {
2576   gdb_assert (gdbarch != NULL);
2577   gdb_assert (gdbarch->skip_trampoline_code != NULL);
2578   if (gdbarch_debug >= 2)
2579     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
2580   return gdbarch->skip_trampoline_code (frame, pc);
2581 }
2582
2583 void
2584 set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
2585                                   gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
2586 {
2587   gdbarch->skip_trampoline_code = skip_trampoline_code;
2588 }
2589
2590 CORE_ADDR
2591 gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
2592 {
2593   gdb_assert (gdbarch != NULL);
2594   gdb_assert (gdbarch->skip_solib_resolver != NULL);
2595   if (gdbarch_debug >= 2)
2596     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
2597   return gdbarch->skip_solib_resolver (gdbarch, pc);
2598 }
2599
2600 void
2601 set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
2602                                  gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
2603 {
2604   gdbarch->skip_solib_resolver = skip_solib_resolver;
2605 }
2606
2607 int
2608 gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
2609 {
2610   gdb_assert (gdbarch != NULL);
2611   gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
2612   if (gdbarch_debug >= 2)
2613     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
2614   return gdbarch->in_solib_return_trampoline (pc, name);
2615 }
2616
2617 void
2618 set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
2619                                         gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
2620 {
2621   gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
2622 }
2623
2624 int
2625 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
2626 {
2627   gdb_assert (gdbarch != NULL);
2628   gdb_assert (gdbarch->in_function_epilogue_p != NULL);
2629   if (gdbarch_debug >= 2)
2630     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
2631   return gdbarch->in_function_epilogue_p (gdbarch, addr);
2632 }
2633
2634 void
2635 set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
2636                                     gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
2637 {
2638   gdbarch->in_function_epilogue_p = in_function_epilogue_p;
2639 }
2640
2641 char *
2642 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
2643 {
2644   gdb_assert (gdbarch != NULL);
2645   gdb_assert (gdbarch->construct_inferior_arguments != NULL);
2646   if (gdbarch_debug >= 2)
2647     fprintf_unfiltered (gdb_stdlog, "gdbarch_construct_inferior_arguments called\n");
2648   return gdbarch->construct_inferior_arguments (gdbarch, argc, argv);
2649 }
2650
2651 void
2652 set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
2653                                           gdbarch_construct_inferior_arguments_ftype construct_inferior_arguments)
2654 {
2655   gdbarch->construct_inferior_arguments = construct_inferior_arguments;
2656 }
2657
2658 void
2659 gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
2660 {
2661   gdb_assert (gdbarch != NULL);
2662   gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
2663   if (gdbarch_debug >= 2)
2664     fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
2665   gdbarch->elf_make_msymbol_special (sym, msym);
2666 }
2667
2668 void
2669 set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
2670                                       gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
2671 {
2672   gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
2673 }
2674
2675 void
2676 gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
2677 {
2678   gdb_assert (gdbarch != NULL);
2679   gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
2680   if (gdbarch_debug >= 2)
2681     fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
2682   gdbarch->coff_make_msymbol_special (val, msym);
2683 }
2684
2685 void
2686 set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
2687                                        gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
2688 {
2689   gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
2690 }
2691
2692 const char *
2693 gdbarch_name_of_malloc (struct gdbarch *gdbarch)
2694 {
2695   gdb_assert (gdbarch != NULL);
2696   /* Skip verify of name_of_malloc, invalid_p == 0 */
2697   if (gdbarch_debug >= 2)
2698     fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n");
2699   return gdbarch->name_of_malloc;
2700 }
2701
2702 void
2703 set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
2704                             const char * name_of_malloc)
2705 {
2706   gdbarch->name_of_malloc = name_of_malloc;
2707 }
2708
2709 int
2710 gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
2711 {
2712   gdb_assert (gdbarch != NULL);
2713   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
2714   if (gdbarch_debug >= 2)
2715     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
2716   return gdbarch->cannot_step_breakpoint;
2717 }
2718
2719 void
2720 set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
2721                                     int cannot_step_breakpoint)
2722 {
2723   gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
2724 }
2725
2726 int
2727 gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
2728 {
2729   gdb_assert (gdbarch != NULL);
2730   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
2731   if (gdbarch_debug >= 2)
2732     fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
2733   return gdbarch->have_nonsteppable_watchpoint;
2734 }
2735
2736 void
2737 set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
2738                                           int have_nonsteppable_watchpoint)
2739 {
2740   gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
2741 }
2742
2743 int
2744 gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
2745 {
2746   gdb_assert (gdbarch != NULL);
2747   return gdbarch->address_class_type_flags != NULL;
2748 }
2749
2750 int
2751 gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
2752 {
2753   gdb_assert (gdbarch != NULL);
2754   gdb_assert (gdbarch->address_class_type_flags != NULL);
2755   if (gdbarch_debug >= 2)
2756     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
2757   return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
2758 }
2759
2760 void
2761 set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
2762                                       gdbarch_address_class_type_flags_ftype address_class_type_flags)
2763 {
2764   gdbarch->address_class_type_flags = address_class_type_flags;
2765 }
2766
2767 int
2768 gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
2769 {
2770   gdb_assert (gdbarch != NULL);
2771   return gdbarch->address_class_type_flags_to_name != NULL;
2772 }
2773
2774 const char *
2775 gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
2776 {
2777   gdb_assert (gdbarch != NULL);
2778   gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
2779   if (gdbarch_debug >= 2)
2780     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
2781   return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
2782 }
2783
2784 void
2785 set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
2786                                               gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
2787 {
2788   gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
2789 }
2790
2791 int
2792 gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
2793 {
2794   gdb_assert (gdbarch != NULL);
2795   return gdbarch->address_class_name_to_type_flags != NULL;
2796 }
2797
2798 int
2799 gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
2800 {
2801   gdb_assert (gdbarch != NULL);
2802   gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
2803   if (gdbarch_debug >= 2)
2804     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
2805   return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
2806 }
2807
2808 void
2809 set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
2810                                               gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
2811 {
2812   gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
2813 }
2814
2815 int
2816 gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
2817 {
2818   gdb_assert (gdbarch != NULL);
2819   gdb_assert (gdbarch->register_reggroup_p != NULL);
2820   if (gdbarch_debug >= 2)
2821     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
2822   return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
2823 }
2824
2825 void
2826 set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
2827                                  gdbarch_register_reggroup_p_ftype register_reggroup_p)
2828 {
2829   gdbarch->register_reggroup_p = register_reggroup_p;
2830 }
2831
2832 int
2833 gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
2834 {
2835   gdb_assert (gdbarch != NULL);
2836   return gdbarch->fetch_pointer_argument != NULL;
2837 }
2838
2839 CORE_ADDR
2840 gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
2841 {
2842   gdb_assert (gdbarch != NULL);
2843   gdb_assert (gdbarch->fetch_pointer_argument != NULL);
2844   if (gdbarch_debug >= 2)
2845     fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
2846   return gdbarch->fetch_pointer_argument (frame, argi, type);
2847 }
2848
2849 void
2850 set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
2851                                     gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
2852 {
2853   gdbarch->fetch_pointer_argument = fetch_pointer_argument;
2854 }
2855
2856 int
2857 gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
2858 {
2859   gdb_assert (gdbarch != NULL);
2860   return gdbarch->regset_from_core_section != NULL;
2861 }
2862
2863 const struct regset *
2864 gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
2865 {
2866   gdb_assert (gdbarch != NULL);
2867   gdb_assert (gdbarch->regset_from_core_section != NULL);
2868   if (gdbarch_debug >= 2)
2869     fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
2870   return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
2871 }
2872
2873 void
2874 set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
2875                                       gdbarch_regset_from_core_section_ftype regset_from_core_section)
2876 {
2877   gdbarch->regset_from_core_section = regset_from_core_section;
2878 }
2879
2880 int
2881 gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
2882 {
2883   gdb_assert (gdbarch != NULL);
2884   return gdbarch->core_xfer_shared_libraries != NULL;
2885 }
2886
2887 LONGEST
2888 gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
2889 {
2890   gdb_assert (gdbarch != NULL);
2891   gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
2892   if (gdbarch_debug >= 2)
2893     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
2894   return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
2895 }
2896
2897 void
2898 set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
2899                                         gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
2900 {
2901   gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
2902 }
2903
2904 int
2905 gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
2906 {
2907   gdb_assert (gdbarch != NULL);
2908   /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
2909   if (gdbarch_debug >= 2)
2910     fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
2911   return gdbarch->vtable_function_descriptors;
2912 }
2913
2914 void
2915 set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
2916                                          int vtable_function_descriptors)
2917 {
2918   gdbarch->vtable_function_descriptors = vtable_function_descriptors;
2919 }
2920
2921 int
2922 gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
2923 {
2924   gdb_assert (gdbarch != NULL);
2925   /* Skip verify of vbit_in_delta, invalid_p == 0 */
2926   if (gdbarch_debug >= 2)
2927     fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
2928   return gdbarch->vbit_in_delta;
2929 }
2930
2931 void
2932 set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
2933                            int vbit_in_delta)
2934 {
2935   gdbarch->vbit_in_delta = vbit_in_delta;
2936 }
2937
2938 int
2939 gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
2940 {
2941   gdb_assert (gdbarch != NULL);
2942   return gdbarch->skip_permanent_breakpoint != NULL;
2943 }
2944
2945 void
2946 gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
2947 {
2948   gdb_assert (gdbarch != NULL);
2949   gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
2950   if (gdbarch_debug >= 2)
2951     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
2952   gdbarch->skip_permanent_breakpoint (regcache);
2953 }
2954
2955 void
2956 set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
2957                                        gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
2958 {
2959   gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
2960 }
2961
2962 int
2963 gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
2964 {
2965   gdb_assert (gdbarch != NULL);
2966   return gdbarch->max_insn_length != 0;
2967 }
2968
2969 ULONGEST
2970 gdbarch_max_insn_length (struct gdbarch *gdbarch)
2971 {
2972   gdb_assert (gdbarch != NULL);
2973   /* Check variable changed from pre-default.  */
2974   gdb_assert (gdbarch->max_insn_length != 0);
2975   if (gdbarch_debug >= 2)
2976     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
2977   return gdbarch->max_insn_length;
2978 }
2979
2980 void
2981 set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
2982                              ULONGEST max_insn_length)
2983 {
2984   gdbarch->max_insn_length = max_insn_length;
2985 }
2986
2987 int
2988 gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
2989 {
2990   gdb_assert (gdbarch != NULL);
2991   return gdbarch->displaced_step_copy_insn != NULL;
2992 }
2993
2994 struct displaced_step_closure *
2995 gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
2996 {
2997   gdb_assert (gdbarch != NULL);
2998   gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
2999   if (gdbarch_debug >= 2)
3000     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
3001   return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
3002 }
3003
3004 void
3005 set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
3006                                       gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
3007 {
3008   gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
3009 }
3010
3011 int
3012 gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
3013 {
3014   gdb_assert (gdbarch != NULL);
3015   return gdbarch->displaced_step_fixup != NULL;
3016 }
3017
3018 void
3019 gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
3020 {
3021   gdb_assert (gdbarch != NULL);
3022   gdb_assert (gdbarch->displaced_step_fixup != NULL);
3023   /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call.  */
3024   if (gdbarch_debug >= 2)
3025     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
3026   gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
3027 }
3028
3029 void
3030 set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
3031                                   gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
3032 {
3033   gdbarch->displaced_step_fixup = displaced_step_fixup;
3034 }
3035
3036 void
3037 gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
3038 {
3039   gdb_assert (gdbarch != NULL);
3040   gdb_assert (gdbarch->displaced_step_free_closure != NULL);
3041   if (gdbarch_debug >= 2)
3042     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
3043   gdbarch->displaced_step_free_closure (gdbarch, closure);
3044 }
3045
3046 void
3047 set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
3048                                          gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
3049 {
3050   gdbarch->displaced_step_free_closure = displaced_step_free_closure;
3051 }
3052
3053 CORE_ADDR
3054 gdbarch_displaced_step_location (struct gdbarch *gdbarch)
3055 {
3056   gdb_assert (gdbarch != NULL);
3057   gdb_assert (gdbarch->displaced_step_location != NULL);
3058   if (gdbarch_debug >= 2)
3059     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
3060   return gdbarch->displaced_step_location (gdbarch);
3061 }
3062
3063 void
3064 set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
3065                                      gdbarch_displaced_step_location_ftype displaced_step_location)
3066 {
3067   gdbarch->displaced_step_location = displaced_step_location;
3068 }
3069
3070 int
3071 gdbarch_overlay_update_p (struct gdbarch *gdbarch)
3072 {
3073   gdb_assert (gdbarch != NULL);
3074   return gdbarch->overlay_update != NULL;
3075 }
3076
3077 void
3078 gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
3079 {
3080   gdb_assert (gdbarch != NULL);
3081   gdb_assert (gdbarch->overlay_update != NULL);
3082   if (gdbarch_debug >= 2)
3083     fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
3084   gdbarch->overlay_update (osect);
3085 }
3086
3087 void
3088 set_gdbarch_overlay_update (struct gdbarch *gdbarch,
3089                             gdbarch_overlay_update_ftype overlay_update)
3090 {
3091   gdbarch->overlay_update = overlay_update;
3092 }
3093
3094 int
3095 gdbarch_core_read_description_p (struct gdbarch *gdbarch)
3096 {
3097   gdb_assert (gdbarch != NULL);
3098   return gdbarch->core_read_description != NULL;
3099 }
3100
3101 const struct target_desc *
3102 gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
3103 {
3104   gdb_assert (gdbarch != NULL);
3105   gdb_assert (gdbarch->core_read_description != NULL);
3106   if (gdbarch_debug >= 2)
3107     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
3108   return gdbarch->core_read_description (gdbarch, target, abfd);
3109 }
3110
3111 void
3112 set_gdbarch_core_read_description (struct gdbarch *gdbarch,
3113                                    gdbarch_core_read_description_ftype core_read_description)
3114 {
3115   gdbarch->core_read_description = core_read_description;
3116 }
3117
3118 int
3119 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
3120 {
3121   gdb_assert (gdbarch != NULL);
3122   return gdbarch->static_transform_name != NULL;
3123 }
3124
3125 char *
3126 gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
3127 {
3128   gdb_assert (gdbarch != NULL);
3129   gdb_assert (gdbarch->static_transform_name != NULL);
3130   if (gdbarch_debug >= 2)
3131     fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
3132   return gdbarch->static_transform_name (name);
3133 }
3134
3135 void
3136 set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
3137                                    gdbarch_static_transform_name_ftype static_transform_name)
3138 {
3139   gdbarch->static_transform_name = static_transform_name;
3140 }
3141
3142 int
3143 gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
3144 {
3145   gdb_assert (gdbarch != NULL);
3146   /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
3147   if (gdbarch_debug >= 2)
3148     fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
3149   return gdbarch->sofun_address_maybe_missing;
3150 }
3151
3152 void
3153 set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
3154                                          int sofun_address_maybe_missing)
3155 {
3156   gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
3157 }
3158
3159 enum target_signal
3160 gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
3161 {
3162   gdb_assert (gdbarch != NULL);
3163   gdb_assert (gdbarch->target_signal_from_host != NULL);
3164   if (gdbarch_debug >= 2)
3165     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
3166   return gdbarch->target_signal_from_host (gdbarch, signo);
3167 }
3168
3169 void
3170 set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
3171                                      gdbarch_target_signal_from_host_ftype target_signal_from_host)
3172 {
3173   gdbarch->target_signal_from_host = target_signal_from_host;
3174 }
3175
3176 int
3177 gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
3178 {
3179   gdb_assert (gdbarch != NULL);
3180   gdb_assert (gdbarch->target_signal_to_host != NULL);
3181   if (gdbarch_debug >= 2)
3182     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
3183   return gdbarch->target_signal_to_host (gdbarch, ts);
3184 }
3185
3186 void
3187 set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
3188                                    gdbarch_target_signal_to_host_ftype target_signal_to_host)
3189 {
3190   gdbarch->target_signal_to_host = target_signal_to_host;
3191 }
3192
3193 int
3194 gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
3195 {
3196   gdb_assert (gdbarch != NULL);
3197   return gdbarch->record_special_symbol != NULL;
3198 }
3199
3200 void
3201 gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
3202 {
3203   gdb_assert (gdbarch != NULL);
3204   gdb_assert (gdbarch->record_special_symbol != NULL);
3205   if (gdbarch_debug >= 2)
3206     fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
3207   gdbarch->record_special_symbol (gdbarch, objfile, sym);
3208 }
3209
3210 void
3211 set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
3212                                    gdbarch_record_special_symbol_ftype record_special_symbol)
3213 {
3214   gdbarch->record_special_symbol = record_special_symbol;
3215 }
3216
3217
3218 /* Keep a registry of per-architecture data-pointers required by GDB
3219    modules. */
3220
3221 struct gdbarch_data
3222 {
3223   unsigned index;
3224   int init_p;
3225   gdbarch_data_pre_init_ftype *pre_init;
3226   gdbarch_data_post_init_ftype *post_init;
3227 };
3228
3229 struct gdbarch_data_registration
3230 {
3231   struct gdbarch_data *data;
3232   struct gdbarch_data_registration *next;
3233 };
3234
3235 struct gdbarch_data_registry
3236 {
3237   unsigned nr;
3238   struct gdbarch_data_registration *registrations;
3239 };
3240
3241 struct gdbarch_data_registry gdbarch_data_registry =
3242 {
3243   0, NULL,
3244 };
3245
3246 static struct gdbarch_data *
3247 gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
3248                        gdbarch_data_post_init_ftype *post_init)
3249 {
3250   struct gdbarch_data_registration **curr;
3251   /* Append the new registraration.  */
3252   for (curr = &gdbarch_data_registry.registrations;
3253        (*curr) != NULL;
3254        curr = &(*curr)->next);
3255   (*curr) = XMALLOC (struct gdbarch_data_registration);
3256   (*curr)->next = NULL;
3257   (*curr)->data = XMALLOC (struct gdbarch_data);
3258   (*curr)->data->index = gdbarch_data_registry.nr++;
3259   (*curr)->data->pre_init = pre_init;
3260   (*curr)->data->post_init = post_init;
3261   (*curr)->data->init_p = 1;
3262   return (*curr)->data;
3263 }
3264
3265 struct gdbarch_data *
3266 gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
3267 {
3268   return gdbarch_data_register (pre_init, NULL);
3269 }
3270
3271 struct gdbarch_data *
3272 gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
3273 {
3274   return gdbarch_data_register (NULL, post_init);
3275 }
3276
3277 /* Create/delete the gdbarch data vector. */
3278
3279 static void
3280 alloc_gdbarch_data (struct gdbarch *gdbarch)
3281 {
3282   gdb_assert (gdbarch->data == NULL);
3283   gdbarch->nr_data = gdbarch_data_registry.nr;
3284   gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
3285 }
3286
3287 /* Initialize the current value of the specified per-architecture
3288    data-pointer. */
3289
3290 void
3291 deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
3292                              struct gdbarch_data *data,
3293                              void *pointer)
3294 {
3295   gdb_assert (data->index < gdbarch->nr_data);
3296   gdb_assert (gdbarch->data[data->index] == NULL);
3297   gdb_assert (data->pre_init == NULL);
3298   gdbarch->data[data->index] = pointer;
3299 }
3300
3301 /* Return the current value of the specified per-architecture
3302    data-pointer. */
3303
3304 void *
3305 gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
3306 {
3307   gdb_assert (data->index < gdbarch->nr_data);
3308   if (gdbarch->data[data->index] == NULL)
3309     {
3310       /* The data-pointer isn't initialized, call init() to get a
3311          value.  */
3312       if (data->pre_init != NULL)
3313         /* Mid architecture creation: pass just the obstack, and not
3314            the entire architecture, as that way it isn't possible for
3315            pre-init code to refer to undefined architecture
3316            fields.  */
3317         gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
3318       else if (gdbarch->initialized_p
3319                && data->post_init != NULL)
3320         /* Post architecture creation: pass the entire architecture
3321            (as all fields are valid), but be careful to also detect
3322            recursive references.  */
3323         {
3324           gdb_assert (data->init_p);
3325           data->init_p = 0;
3326           gdbarch->data[data->index] = data->post_init (gdbarch);
3327           data->init_p = 1;
3328         }
3329       else
3330         /* The architecture initialization hasn't completed - punt -
3331          hope that the caller knows what they are doing.  Once
3332          deprecated_set_gdbarch_data has been initialized, this can be
3333          changed to an internal error.  */
3334         return NULL;
3335       gdb_assert (gdbarch->data[data->index] != NULL);
3336     }
3337   return gdbarch->data[data->index];
3338 }
3339
3340
3341 /* Keep a registry of the architectures known by GDB. */
3342
3343 struct gdbarch_registration
3344 {
3345   enum bfd_architecture bfd_architecture;
3346   gdbarch_init_ftype *init;
3347   gdbarch_dump_tdep_ftype *dump_tdep;
3348   struct gdbarch_list *arches;
3349   struct gdbarch_registration *next;
3350 };
3351
3352 static struct gdbarch_registration *gdbarch_registry = NULL;
3353
3354 static void
3355 append_name (const char ***buf, int *nr, const char *name)
3356 {
3357   *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
3358   (*buf)[*nr] = name;
3359   *nr += 1;
3360 }
3361
3362 const char **
3363 gdbarch_printable_names (void)
3364 {
3365   /* Accumulate a list of names based on the registed list of
3366      architectures. */
3367   enum bfd_architecture a;
3368   int nr_arches = 0;
3369   const char **arches = NULL;
3370   struct gdbarch_registration *rego;
3371   for (rego = gdbarch_registry;
3372        rego != NULL;
3373        rego = rego->next)
3374     {
3375       const struct bfd_arch_info *ap;
3376       ap = bfd_lookup_arch (rego->bfd_architecture, 0);
3377       if (ap == NULL)
3378         internal_error (__FILE__, __LINE__,
3379                         _("gdbarch_architecture_names: multi-arch unknown"));
3380       do
3381         {
3382           append_name (&arches, &nr_arches, ap->printable_name);
3383           ap = ap->next;
3384         }
3385       while (ap != NULL);
3386     }
3387   append_name (&arches, &nr_arches, NULL);
3388   return arches;
3389 }
3390
3391
3392 void
3393 gdbarch_register (enum bfd_architecture bfd_architecture,
3394                   gdbarch_init_ftype *init,
3395                   gdbarch_dump_tdep_ftype *dump_tdep)
3396 {
3397   struct gdbarch_registration **curr;
3398   const struct bfd_arch_info *bfd_arch_info;
3399   /* Check that BFD recognizes this architecture */
3400   bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
3401   if (bfd_arch_info == NULL)
3402     {
3403       internal_error (__FILE__, __LINE__,
3404                       _("gdbarch: Attempt to register unknown architecture (%d)"),
3405                       bfd_architecture);
3406     }
3407   /* Check that we haven't seen this architecture before */
3408   for (curr = &gdbarch_registry;
3409        (*curr) != NULL;
3410        curr = &(*curr)->next)
3411     {
3412       if (bfd_architecture == (*curr)->bfd_architecture)
3413         internal_error (__FILE__, __LINE__,
3414                         _("gdbarch: Duplicate registraration of architecture (%s)"),
3415                         bfd_arch_info->printable_name);
3416     }
3417   /* log it */
3418   if (gdbarch_debug)
3419     fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n",
3420                         bfd_arch_info->printable_name,
3421                         (long) init);
3422   /* Append it */
3423   (*curr) = XMALLOC (struct gdbarch_registration);
3424   (*curr)->bfd_architecture = bfd_architecture;
3425   (*curr)->init = init;
3426   (*curr)->dump_tdep = dump_tdep;
3427   (*curr)->arches = NULL;
3428   (*curr)->next = NULL;
3429 }
3430
3431 void
3432 register_gdbarch_init (enum bfd_architecture bfd_architecture,
3433                        gdbarch_init_ftype *init)
3434 {
3435   gdbarch_register (bfd_architecture, init, NULL);
3436 }
3437
3438
3439 /* Look for an architecture using gdbarch_info.  */
3440
3441 struct gdbarch_list *
3442 gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
3443                              const struct gdbarch_info *info)
3444 {
3445   for (; arches != NULL; arches = arches->next)
3446     {
3447       if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
3448         continue;
3449       if (info->byte_order != arches->gdbarch->byte_order)
3450         continue;
3451       if (info->osabi != arches->gdbarch->osabi)
3452         continue;
3453       if (info->target_desc != arches->gdbarch->target_desc)
3454         continue;
3455       return arches;
3456     }
3457   return NULL;
3458 }
3459
3460
3461 /* Find an architecture that matches the specified INFO.  Create a new
3462    architecture if needed.  Return that new architecture.  Assumes
3463    that there is no current architecture.  */
3464
3465 static struct gdbarch *
3466 find_arch_by_info (struct gdbarch_info info)
3467 {
3468   struct gdbarch *new_gdbarch;
3469   struct gdbarch_registration *rego;
3470
3471   /* The existing architecture has been swapped out - all this code
3472      works from a clean slate.  */
3473   gdb_assert (current_gdbarch == NULL);
3474
3475   /* Fill in missing parts of the INFO struct using a number of
3476      sources: "set ..."; INFOabfd supplied; and the global
3477      defaults.  */
3478   gdbarch_info_fill (&info);
3479
3480   /* Must have found some sort of architecture. */
3481   gdb_assert (info.bfd_arch_info != NULL);
3482
3483   if (gdbarch_debug)
3484     {
3485       fprintf_unfiltered (gdb_stdlog,
3486                           "find_arch_by_info: info.bfd_arch_info %s\n",
3487                           (info.bfd_arch_info != NULL
3488                            ? info.bfd_arch_info->printable_name
3489                            : "(null)"));
3490       fprintf_unfiltered (gdb_stdlog,
3491                           "find_arch_by_info: info.byte_order %d (%s)\n",
3492                           info.byte_order,
3493                           (info.byte_order == BFD_ENDIAN_BIG ? "big"
3494                            : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
3495                            : "default"));
3496       fprintf_unfiltered (gdb_stdlog,
3497                           "find_arch_by_info: info.osabi %d (%s)\n",
3498                           info.osabi, gdbarch_osabi_name (info.osabi));
3499       fprintf_unfiltered (gdb_stdlog,
3500                           "find_arch_by_info: info.abfd 0x%lx\n",
3501                           (long) info.abfd);
3502       fprintf_unfiltered (gdb_stdlog,
3503                           "find_arch_by_info: info.tdep_info 0x%lx\n",
3504                           (long) info.tdep_info);
3505     }
3506
3507   /* Find the tdep code that knows about this architecture.  */
3508   for (rego = gdbarch_registry;
3509        rego != NULL;
3510        rego = rego->next)
3511     if (rego->bfd_architecture == info.bfd_arch_info->arch)
3512       break;
3513   if (rego == NULL)
3514     {
3515       if (gdbarch_debug)
3516         fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3517                             "No matching architecture\n");
3518       return 0;
3519     }
3520
3521   /* Ask the tdep code for an architecture that matches "info".  */
3522   new_gdbarch = rego->init (info, rego->arches);
3523
3524   /* Did the tdep code like it?  No.  Reject the change and revert to
3525      the old architecture.  */
3526   if (new_gdbarch == NULL)
3527     {
3528       if (gdbarch_debug)
3529         fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3530                             "Target rejected architecture\n");
3531       return NULL;
3532     }
3533
3534   /* Is this a pre-existing architecture (as determined by already
3535      being initialized)?  Move it to the front of the architecture
3536      list (keeping the list sorted Most Recently Used).  */
3537   if (new_gdbarch->initialized_p)
3538     {
3539       struct gdbarch_list **list;
3540       struct gdbarch_list *this;
3541       if (gdbarch_debug)
3542         fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3543                             "Previous architecture 0x%08lx (%s) selected\n",
3544                             (long) new_gdbarch,
3545                             new_gdbarch->bfd_arch_info->printable_name);
3546       /* Find the existing arch in the list.  */
3547       for (list = &rego->arches;
3548            (*list) != NULL && (*list)->gdbarch != new_gdbarch;
3549            list = &(*list)->next);
3550       /* It had better be in the list of architectures.  */
3551       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
3552       /* Unlink THIS.  */
3553       this = (*list);
3554       (*list) = this->next;
3555       /* Insert THIS at the front.  */
3556       this->next = rego->arches;
3557       rego->arches = this;
3558       /* Return it.  */
3559       return new_gdbarch;
3560     }
3561
3562   /* It's a new architecture.  */
3563   if (gdbarch_debug)
3564     fprintf_unfiltered (gdb_stdlog, "find_arch_by_info: "
3565                         "New architecture 0x%08lx (%s) selected\n",
3566                         (long) new_gdbarch,
3567                         new_gdbarch->bfd_arch_info->printable_name);
3568   
3569   /* Insert the new architecture into the front of the architecture
3570      list (keep the list sorted Most Recently Used).  */
3571   {
3572     struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
3573     this->next = rego->arches;
3574     this->gdbarch = new_gdbarch;
3575     rego->arches = this;
3576   }    
3577
3578   /* Check that the newly installed architecture is valid.  Plug in
3579      any post init values.  */
3580   new_gdbarch->dump_tdep = rego->dump_tdep;
3581   verify_gdbarch (new_gdbarch);
3582   new_gdbarch->initialized_p = 1;
3583
3584   if (gdbarch_debug)
3585     gdbarch_dump (new_gdbarch, gdb_stdlog);
3586
3587   return new_gdbarch;
3588 }
3589
3590 struct gdbarch *
3591 gdbarch_find_by_info (struct gdbarch_info info)
3592 {
3593   struct gdbarch *new_gdbarch;
3594
3595   /* Save the previously selected architecture, setting the global to
3596      NULL.  This stops things like gdbarch->init() trying to use the
3597      previous architecture's configuration.  The previous architecture
3598      may not even be of the same architecture family.  The most recent
3599      architecture of the same family is found at the head of the
3600      rego->arches list.  */
3601   struct gdbarch *old_gdbarch = current_gdbarch;
3602   current_gdbarch = NULL;
3603
3604   /* Find the specified architecture.  */
3605   new_gdbarch = find_arch_by_info (info);
3606
3607   /* Restore the existing architecture.  */
3608   gdb_assert (current_gdbarch == NULL);
3609   current_gdbarch = old_gdbarch;
3610
3611   return new_gdbarch;
3612 }
3613
3614 /* Make the specified architecture current.  */
3615
3616 void
3617 deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
3618 {
3619   gdb_assert (new_gdbarch != NULL);
3620   gdb_assert (current_gdbarch != NULL);
3621   gdb_assert (new_gdbarch->initialized_p);
3622   current_gdbarch = new_gdbarch;
3623   architecture_changed_event ();
3624   reinit_frame_cache ();
3625 }
3626
3627 extern void _initialize_gdbarch (void);
3628
3629 void
3630 _initialize_gdbarch (void)
3631 {
3632   struct cmd_list_element *c;
3633
3634   add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
3635 Set architecture debugging."), _("\
3636 Show architecture debugging."), _("\
3637 When non-zero, architecture debugging is enabled."),
3638                             NULL,
3639                             show_gdbarch_debug,
3640                             &setdebuglist, &showdebuglist);
3641 }