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