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