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