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