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