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