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 #ifdef TARGET_ADDR_BIT
697   fprintf_unfiltered (file,
698                       "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
699                       XSTRING (TARGET_ADDR_BIT));
700   fprintf_unfiltered (file,
701                       "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
702                       TARGET_ADDR_BIT);
703 #endif
704 #ifdef ADDR_BITS_REMOVE
705   fprintf_unfiltered (file,
706                       "gdbarch_dump: %s # %s\n",
707                       "ADDR_BITS_REMOVE(addr)",
708                       XSTRING (ADDR_BITS_REMOVE (addr)));
709   fprintf_unfiltered (file,
710                       "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
711                       (long) current_gdbarch->addr_bits_remove
712                       /*ADDR_BITS_REMOVE ()*/);
713 #endif
714   fprintf_unfiltered (file,
715                       "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
716                       gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
717   fprintf_unfiltered (file,
718                       "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
719                       (long) current_gdbarch->address_class_name_to_type_flags);
720 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
721   fprintf_unfiltered (file,
722                       "gdbarch_dump: %s # %s\n",
723                       "ADDRESS_CLASS_TYPE_FLAGS_P()",
724                       XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
725   fprintf_unfiltered (file,
726                       "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n",
727                       ADDRESS_CLASS_TYPE_FLAGS_P ());
728 #endif
729 #ifdef ADDRESS_CLASS_TYPE_FLAGS
730   fprintf_unfiltered (file,
731                       "gdbarch_dump: %s # %s\n",
732                       "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
733                       XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
734   fprintf_unfiltered (file,
735                       "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
736                       (long) current_gdbarch->address_class_type_flags
737                       /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
738 #endif
739   fprintf_unfiltered (file,
740                       "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
741                       gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
742   fprintf_unfiltered (file,
743                       "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
744                       (long) current_gdbarch->address_class_type_flags_to_name);
745 #ifdef ADDRESS_TO_POINTER
746   fprintf_unfiltered (file,
747                       "gdbarch_dump: %s # %s\n",
748                       "ADDRESS_TO_POINTER(type, buf, addr)",
749                       XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
750   fprintf_unfiltered (file,
751                       "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
752                       (long) current_gdbarch->address_to_pointer
753                       /*ADDRESS_TO_POINTER ()*/);
754 #endif
755   fprintf_unfiltered (file,
756                       "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
757                       gdbarch_adjust_breakpoint_address_p (current_gdbarch));
758   fprintf_unfiltered (file,
759                       "gdbarch_dump: adjust_breakpoint_address = 0x%08lx\n",
760                       (long) current_gdbarch->adjust_breakpoint_address);
761 #ifdef BELIEVE_PCC_PROMOTION
762   fprintf_unfiltered (file,
763                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
764                       XSTRING (BELIEVE_PCC_PROMOTION));
765   fprintf_unfiltered (file,
766                       "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
767                       BELIEVE_PCC_PROMOTION);
768 #endif
769 #ifdef TARGET_ARCHITECTURE
770   fprintf_unfiltered (file,
771                       "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
772                       XSTRING (TARGET_ARCHITECTURE));
773   if (TARGET_ARCHITECTURE != NULL)
774     fprintf_unfiltered (file,
775                         "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
776                         TARGET_ARCHITECTURE->printable_name);
777 #endif
778 #ifdef TARGET_BFD_VMA_BIT
779   fprintf_unfiltered (file,
780                       "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
781                       XSTRING (TARGET_BFD_VMA_BIT));
782   fprintf_unfiltered (file,
783                       "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
784                       TARGET_BFD_VMA_BIT);
785 #endif
786 #ifdef BREAKPOINT_FROM_PC
787   fprintf_unfiltered (file,
788                       "gdbarch_dump: %s # %s\n",
789                       "BREAKPOINT_FROM_PC(pcptr, lenptr)",
790                       XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
791   fprintf_unfiltered (file,
792                       "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
793                       (long) current_gdbarch->breakpoint_from_pc
794                       /*BREAKPOINT_FROM_PC ()*/);
795 #endif
796 #ifdef TARGET_BYTE_ORDER
797   fprintf_unfiltered (file,
798                       "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
799                       XSTRING (TARGET_BYTE_ORDER));
800   fprintf_unfiltered (file,
801                       "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
802                       (long) TARGET_BYTE_ORDER);
803 #endif
804 #ifdef CALL_DUMMY_LOCATION
805   fprintf_unfiltered (file,
806                       "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
807                       XSTRING (CALL_DUMMY_LOCATION));
808   fprintf_unfiltered (file,
809                       "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
810                       CALL_DUMMY_LOCATION);
811 #endif
812 #ifdef CANNOT_FETCH_REGISTER
813   fprintf_unfiltered (file,
814                       "gdbarch_dump: %s # %s\n",
815                       "CANNOT_FETCH_REGISTER(regnum)",
816                       XSTRING (CANNOT_FETCH_REGISTER (regnum)));
817   fprintf_unfiltered (file,
818                       "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
819                       (long) current_gdbarch->cannot_fetch_register
820                       /*CANNOT_FETCH_REGISTER ()*/);
821 #endif
822 #ifdef CANNOT_STEP_BREAKPOINT
823   fprintf_unfiltered (file,
824                       "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
825                       XSTRING (CANNOT_STEP_BREAKPOINT));
826   fprintf_unfiltered (file,
827                       "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
828                       CANNOT_STEP_BREAKPOINT);
829 #endif
830 #ifdef CANNOT_STORE_REGISTER
831   fprintf_unfiltered (file,
832                       "gdbarch_dump: %s # %s\n",
833                       "CANNOT_STORE_REGISTER(regnum)",
834                       XSTRING (CANNOT_STORE_REGISTER (regnum)));
835   fprintf_unfiltered (file,
836                       "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
837                       (long) current_gdbarch->cannot_store_register
838                       /*CANNOT_STORE_REGISTER ()*/);
839 #endif
840 #ifdef TARGET_CHAR_SIGNED
841   fprintf_unfiltered (file,
842                       "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
843                       XSTRING (TARGET_CHAR_SIGNED));
844   fprintf_unfiltered (file,
845                       "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
846                       TARGET_CHAR_SIGNED);
847 #endif
848 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
849   fprintf_unfiltered (file,
850                       "gdbarch_dump: %s # %s\n",
851                       "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
852                       XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
853   fprintf_unfiltered (file,
854                       "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
855                       (long) current_gdbarch->coff_make_msymbol_special
856                       /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
857 #endif
858   fprintf_unfiltered (file,
859                       "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
860                       (long) current_gdbarch->construct_inferior_arguments);
861   fprintf_unfiltered (file,
862                       "gdbarch_dump: convert_from_func_ptr_addr = 0x%08lx\n",
863                       (long) current_gdbarch->convert_from_func_ptr_addr);
864 #ifdef CONVERT_REGISTER_P
865   fprintf_unfiltered (file,
866                       "gdbarch_dump: %s # %s\n",
867                       "CONVERT_REGISTER_P(regnum, type)",
868                       XSTRING (CONVERT_REGISTER_P (regnum, type)));
869   fprintf_unfiltered (file,
870                       "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
871                       (long) current_gdbarch->convert_register_p
872                       /*CONVERT_REGISTER_P ()*/);
873 #endif
874 #ifdef DECR_PC_AFTER_BREAK
875   fprintf_unfiltered (file,
876                       "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
877                       XSTRING (DECR_PC_AFTER_BREAK));
878   fprintf_unfiltered (file,
879                       "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
880                       (long) DECR_PC_AFTER_BREAK);
881 #endif
882 #ifdef DEPRECATED_DO_REGISTERS_INFO_P
883   fprintf_unfiltered (file,
884                       "gdbarch_dump: %s # %s\n",
885                       "DEPRECATED_DO_REGISTERS_INFO_P()",
886                       XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
887   fprintf_unfiltered (file,
888                       "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n",
889                       DEPRECATED_DO_REGISTERS_INFO_P ());
890 #endif
891 #ifdef DEPRECATED_DO_REGISTERS_INFO
892   fprintf_unfiltered (file,
893                       "gdbarch_dump: %s # %s\n",
894                       "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
895                       XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
896   fprintf_unfiltered (file,
897                       "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
898                       (long) current_gdbarch->deprecated_do_registers_info
899                       /*DEPRECATED_DO_REGISTERS_INFO ()*/);
900 #endif
901 #ifdef DEPRECATED_DUMMY_WRITE_SP_P
902   fprintf_unfiltered (file,
903                       "gdbarch_dump: %s # %s\n",
904                       "DEPRECATED_DUMMY_WRITE_SP_P()",
905                       XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ()));
906   fprintf_unfiltered (file,
907                       "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n",
908                       DEPRECATED_DUMMY_WRITE_SP_P ());
909 #endif
910 #ifdef DEPRECATED_DUMMY_WRITE_SP
911   fprintf_unfiltered (file,
912                       "gdbarch_dump: %s # %s\n",
913                       "DEPRECATED_DUMMY_WRITE_SP(val)",
914                       XSTRING (DEPRECATED_DUMMY_WRITE_SP (val)));
915   fprintf_unfiltered (file,
916                       "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
917                       (long) current_gdbarch->deprecated_dummy_write_sp
918                       /*DEPRECATED_DUMMY_WRITE_SP ()*/);
919 #endif
920 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
921   fprintf_unfiltered (file,
922                       "gdbarch_dump: %s # %s\n",
923                       "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
924                       XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
925   fprintf_unfiltered (file,
926                       "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
927                       (long) current_gdbarch->deprecated_extract_return_value
928                       /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
929 #endif
930 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
931   fprintf_unfiltered (file,
932                       "gdbarch_dump: %s # %s\n",
933                       "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
934                       XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
935   fprintf_unfiltered (file,
936                       "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
937                       DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ());
938 #endif
939 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
940   fprintf_unfiltered (file,
941                       "gdbarch_dump: %s # %s\n",
942                       "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
943                       XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
944   fprintf_unfiltered (file,
945                       "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
946                       (long) current_gdbarch->deprecated_extract_struct_value_address
947                       /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
948 #endif
949 #ifdef DEPRECATED_FP_REGNUM
950   fprintf_unfiltered (file,
951                       "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
952                       XSTRING (DEPRECATED_FP_REGNUM));
953   fprintf_unfiltered (file,
954                       "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n",
955                       DEPRECATED_FP_REGNUM);
956 #endif
957 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P
958   fprintf_unfiltered (file,
959                       "gdbarch_dump: %s # %s\n",
960                       "DEPRECATED_FRAME_ARGS_ADDRESS_P()",
961                       XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ()));
962   fprintf_unfiltered (file,
963                       "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS_P() = %d\n",
964                       DEPRECATED_FRAME_ARGS_ADDRESS_P ());
965 #endif
966 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS
967   fprintf_unfiltered (file,
968                       "gdbarch_dump: %s # %s\n",
969                       "DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
970                       XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
971   fprintf_unfiltered (file,
972                       "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
973                       (long) current_gdbarch->deprecated_frame_args_address
974                       /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
975 #endif
976 #ifdef DEPRECATED_FRAME_CHAIN_P
977   fprintf_unfiltered (file,
978                       "gdbarch_dump: %s # %s\n",
979                       "DEPRECATED_FRAME_CHAIN_P()",
980                       XSTRING (DEPRECATED_FRAME_CHAIN_P ()));
981   fprintf_unfiltered (file,
982                       "gdbarch_dump: DEPRECATED_FRAME_CHAIN_P() = %d\n",
983                       DEPRECATED_FRAME_CHAIN_P ());
984 #endif
985 #ifdef DEPRECATED_FRAME_CHAIN
986   fprintf_unfiltered (file,
987                       "gdbarch_dump: %s # %s\n",
988                       "DEPRECATED_FRAME_CHAIN(frame)",
989                       XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
990   fprintf_unfiltered (file,
991                       "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
992                       (long) current_gdbarch->deprecated_frame_chain
993                       /*DEPRECATED_FRAME_CHAIN ()*/);
994 #endif
995 #ifdef DEPRECATED_FRAME_CHAIN_VALID_P
996   fprintf_unfiltered (file,
997                       "gdbarch_dump: %s # %s\n",
998                       "DEPRECATED_FRAME_CHAIN_VALID_P()",
999                       XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ()));
1000   fprintf_unfiltered (file,
1001                       "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID_P() = %d\n",
1002                       DEPRECATED_FRAME_CHAIN_VALID_P ());
1003 #endif
1004 #ifdef DEPRECATED_FRAME_CHAIN_VALID
1005   fprintf_unfiltered (file,
1006                       "gdbarch_dump: %s # %s\n",
1007                       "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
1008                       XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
1009   fprintf_unfiltered (file,
1010                       "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
1011                       (long) current_gdbarch->deprecated_frame_chain_valid
1012                       /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
1013 #endif
1014 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
1015   fprintf_unfiltered (file,
1016                       "gdbarch_dump: %s # %s\n",
1017                       "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
1018                       XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
1019   fprintf_unfiltered (file,
1020                       "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n",
1021                       DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
1022 #endif
1023 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
1024   fprintf_unfiltered (file,
1025                       "gdbarch_dump: %s # %s\n",
1026                       "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
1027                       XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
1028   fprintf_unfiltered (file,
1029                       "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
1030                       (long) current_gdbarch->deprecated_frame_init_saved_regs
1031                       /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
1032 #endif
1033 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
1034   fprintf_unfiltered (file,
1035                       "gdbarch_dump: %s # %s\n",
1036                       "DEPRECATED_FRAME_LOCALS_ADDRESS_P()",
1037                       XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()));
1038   fprintf_unfiltered (file,
1039                       "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS_P() = %d\n",
1040                       DEPRECATED_FRAME_LOCALS_ADDRESS_P ());
1041 #endif
1042 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS
1043   fprintf_unfiltered (file,
1044                       "gdbarch_dump: %s # %s\n",
1045                       "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
1046                       XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
1047   fprintf_unfiltered (file,
1048                       "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
1049                       (long) current_gdbarch->deprecated_frame_locals_address
1050                       /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
1051 #endif
1052 #ifdef DEPRECATED_FRAME_SAVED_PC_P
1053   fprintf_unfiltered (file,
1054                       "gdbarch_dump: %s # %s\n",
1055                       "DEPRECATED_FRAME_SAVED_PC_P()",
1056                       XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
1057   fprintf_unfiltered (file,
1058                       "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC_P() = %d\n",
1059                       DEPRECATED_FRAME_SAVED_PC_P ());
1060 #endif
1061 #ifdef DEPRECATED_FRAME_SAVED_PC
1062   fprintf_unfiltered (file,
1063                       "gdbarch_dump: %s # %s\n",
1064                       "DEPRECATED_FRAME_SAVED_PC(fi)",
1065                       XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
1066   fprintf_unfiltered (file,
1067                       "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
1068                       (long) current_gdbarch->deprecated_frame_saved_pc
1069                       /*DEPRECATED_FRAME_SAVED_PC ()*/);
1070 #endif
1071 #ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P
1072   fprintf_unfiltered (file,
1073                       "gdbarch_dump: %s # %s\n",
1074                       "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P()",
1075                       XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()));
1076   fprintf_unfiltered (file,
1077                       "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() = %d\n",
1078                       DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ());
1079 #endif
1080 #ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
1081   fprintf_unfiltered (file,
1082                       "gdbarch_dump: %s # %s\n",
1083                       "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi)",
1084                       XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)));
1085   fprintf_unfiltered (file,
1086                       "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
1087                       (long) current_gdbarch->deprecated_frameless_function_invocation
1088                       /*DEPRECATED_FRAMELESS_FUNCTION_INVOCATION ()*/);
1089 #endif
1090 #ifdef DEPRECATED_FUNCTION_START_OFFSET
1091   fprintf_unfiltered (file,
1092                       "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
1093                       XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
1094   fprintf_unfiltered (file,
1095                       "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET = %ld\n",
1096                       (long) DEPRECATED_FUNCTION_START_OFFSET);
1097 #endif
1098 #ifdef DEPRECATED_GET_SAVED_REGISTER_P
1099   fprintf_unfiltered (file,
1100                       "gdbarch_dump: %s # %s\n",
1101                       "DEPRECATED_GET_SAVED_REGISTER_P()",
1102                       XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
1103   fprintf_unfiltered (file,
1104                       "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
1105                       DEPRECATED_GET_SAVED_REGISTER_P ());
1106 #endif
1107 #ifdef DEPRECATED_GET_SAVED_REGISTER
1108   fprintf_unfiltered (file,
1109                       "gdbarch_dump: %s # %s\n",
1110                       "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
1111                       XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
1112   fprintf_unfiltered (file,
1113                       "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
1114                       (long) current_gdbarch->deprecated_get_saved_register
1115                       /*DEPRECATED_GET_SAVED_REGISTER ()*/);
1116 #endif
1117 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
1118   fprintf_unfiltered (file,
1119                       "gdbarch_dump: %s # %s\n",
1120                       "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
1121                       XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
1122   fprintf_unfiltered (file,
1123                       "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n",
1124                       DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
1125 #endif
1126 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
1127   fprintf_unfiltered (file,
1128                       "gdbarch_dump: %s # %s\n",
1129                       "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
1130                       XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
1131   fprintf_unfiltered (file,
1132                       "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
1133                       (long) current_gdbarch->deprecated_init_extra_frame_info
1134                       /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
1135 #endif
1136 #ifdef DEPRECATED_INIT_FRAME_PC_P
1137   fprintf_unfiltered (file,
1138                       "gdbarch_dump: %s # %s\n",
1139                       "DEPRECATED_INIT_FRAME_PC_P()",
1140                       XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
1141   fprintf_unfiltered (file,
1142                       "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n",
1143                       DEPRECATED_INIT_FRAME_PC_P ());
1144 #endif
1145 #ifdef DEPRECATED_INIT_FRAME_PC
1146   fprintf_unfiltered (file,
1147                       "gdbarch_dump: %s # %s\n",
1148                       "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
1149                       XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
1150   fprintf_unfiltered (file,
1151                       "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
1152                       (long) current_gdbarch->deprecated_init_frame_pc
1153                       /*DEPRECATED_INIT_FRAME_PC ()*/);
1154 #endif
1155 #ifdef DEPRECATED_POP_FRAME_P
1156   fprintf_unfiltered (file,
1157                       "gdbarch_dump: %s # %s\n",
1158                       "DEPRECATED_POP_FRAME_P()",
1159                       XSTRING (DEPRECATED_POP_FRAME_P ()));
1160   fprintf_unfiltered (file,
1161                       "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
1162                       DEPRECATED_POP_FRAME_P ());
1163 #endif
1164 #ifdef DEPRECATED_POP_FRAME
1165   fprintf_unfiltered (file,
1166                       "gdbarch_dump: %s # %s\n",
1167                       "DEPRECATED_POP_FRAME(-)",
1168                       XSTRING (DEPRECATED_POP_FRAME (-)));
1169   fprintf_unfiltered (file,
1170                       "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
1171                       (long) current_gdbarch->deprecated_pop_frame
1172                       /*DEPRECATED_POP_FRAME ()*/);
1173 #endif
1174 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
1175   fprintf_unfiltered (file,
1176                       "gdbarch_dump: %s # %s\n",
1177                       "DEPRECATED_PUSH_ARGUMENTS_P()",
1178                       XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
1179   fprintf_unfiltered (file,
1180                       "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS_P() = %d\n",
1181                       DEPRECATED_PUSH_ARGUMENTS_P ());
1182 #endif
1183 #ifdef DEPRECATED_PUSH_ARGUMENTS
1184   fprintf_unfiltered (file,
1185                       "gdbarch_dump: %s # %s\n",
1186                       "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
1187                       XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
1188   fprintf_unfiltered (file,
1189                       "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
1190                       (long) current_gdbarch->deprecated_push_arguments
1191                       /*DEPRECATED_PUSH_ARGUMENTS ()*/);
1192 #endif
1193 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P
1194   fprintf_unfiltered (file,
1195                       "gdbarch_dump: %s # %s\n",
1196                       "DEPRECATED_PUSH_RETURN_ADDRESS_P()",
1197                       XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS_P ()));
1198   fprintf_unfiltered (file,
1199                       "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS_P() = %d\n",
1200                       DEPRECATED_PUSH_RETURN_ADDRESS_P ());
1201 #endif
1202 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS
1203   fprintf_unfiltered (file,
1204                       "gdbarch_dump: %s # %s\n",
1205                       "DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)",
1206                       XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp)));
1207   fprintf_unfiltered (file,
1208                       "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
1209                       (long) current_gdbarch->deprecated_push_return_address
1210                       /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
1211 #endif
1212 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
1213   fprintf_unfiltered (file,
1214                       "gdbarch_dump: %s # %s\n",
1215                       "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
1216                       XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
1217   fprintf_unfiltered (file,
1218                       "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR_P() = %d\n",
1219                       DEPRECATED_REG_STRUCT_HAS_ADDR_P ());
1220 #endif
1221 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
1222   fprintf_unfiltered (file,
1223                       "gdbarch_dump: %s # %s\n",
1224                       "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
1225                       XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
1226   fprintf_unfiltered (file,
1227                       "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
1228                       (long) current_gdbarch->deprecated_reg_struct_has_addr
1229                       /*DEPRECATED_REG_STRUCT_HAS_ADDR ()*/);
1230 #endif
1231 #ifdef DEPRECATED_REGISTER_BYTE_P
1232   fprintf_unfiltered (file,
1233                       "gdbarch_dump: %s # %s\n",
1234                       "DEPRECATED_REGISTER_BYTE_P()",
1235                       XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
1236   fprintf_unfiltered (file,
1237                       "gdbarch_dump: DEPRECATED_REGISTER_BYTE_P() = %d\n",
1238                       DEPRECATED_REGISTER_BYTE_P ());
1239 #endif
1240 #ifdef DEPRECATED_REGISTER_BYTE
1241   fprintf_unfiltered (file,
1242                       "gdbarch_dump: %s # %s\n",
1243                       "DEPRECATED_REGISTER_BYTE(reg_nr)",
1244                       XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
1245   fprintf_unfiltered (file,
1246                       "gdbarch_dump: DEPRECATED_REGISTER_BYTE = <0x%08lx>\n",
1247                       (long) current_gdbarch->deprecated_register_byte
1248                       /*DEPRECATED_REGISTER_BYTE ()*/);
1249 #endif
1250 #ifdef DEPRECATED_REGISTER_BYTES
1251   fprintf_unfiltered (file,
1252                       "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
1253                       XSTRING (DEPRECATED_REGISTER_BYTES));
1254   fprintf_unfiltered (file,
1255                       "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
1256                       DEPRECATED_REGISTER_BYTES);
1257 #endif
1258 #ifdef DEPRECATED_REGISTER_RAW_SIZE_P
1259   fprintf_unfiltered (file,
1260                       "gdbarch_dump: %s # %s\n",
1261                       "DEPRECATED_REGISTER_RAW_SIZE_P()",
1262                       XSTRING (DEPRECATED_REGISTER_RAW_SIZE_P ()));
1263   fprintf_unfiltered (file,
1264                       "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE_P() = %d\n",
1265                       DEPRECATED_REGISTER_RAW_SIZE_P ());
1266 #endif
1267 #ifdef DEPRECATED_REGISTER_RAW_SIZE
1268   fprintf_unfiltered (file,
1269                       "gdbarch_dump: %s # %s\n",
1270                       "DEPRECATED_REGISTER_RAW_SIZE(reg_nr)",
1271                       XSTRING (DEPRECATED_REGISTER_RAW_SIZE (reg_nr)));
1272   fprintf_unfiltered (file,
1273                       "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE = <0x%08lx>\n",
1274                       (long) current_gdbarch->deprecated_register_raw_size
1275                       /*DEPRECATED_REGISTER_RAW_SIZE ()*/);
1276 #endif
1277 #ifdef DEPRECATED_REGISTER_SIZE
1278   fprintf_unfiltered (file,
1279                       "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
1280                       XSTRING (DEPRECATED_REGISTER_SIZE));
1281   fprintf_unfiltered (file,
1282                       "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
1283                       DEPRECATED_REGISTER_SIZE);
1284 #endif
1285 #ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE_P
1286   fprintf_unfiltered (file,
1287                       "gdbarch_dump: %s # %s\n",
1288                       "DEPRECATED_REGISTER_VIRTUAL_SIZE_P()",
1289                       XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE_P ()));
1290   fprintf_unfiltered (file,
1291                       "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE_P() = %d\n",
1292                       DEPRECATED_REGISTER_VIRTUAL_SIZE_P ());
1293 #endif
1294 #ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE
1295   fprintf_unfiltered (file,
1296                       "gdbarch_dump: %s # %s\n",
1297                       "DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr)",
1298                       XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr)));
1299   fprintf_unfiltered (file,
1300                       "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
1301                       (long) current_gdbarch->deprecated_register_virtual_size
1302                       /*DEPRECATED_REGISTER_VIRTUAL_SIZE ()*/);
1303 #endif
1304 #ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE_P
1305   fprintf_unfiltered (file,
1306                       "gdbarch_dump: %s # %s\n",
1307                       "DEPRECATED_REGISTER_VIRTUAL_TYPE_P()",
1308                       XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE_P ()));
1309   fprintf_unfiltered (file,
1310                       "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE_P() = %d\n",
1311                       DEPRECATED_REGISTER_VIRTUAL_TYPE_P ());
1312 #endif
1313 #ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE
1314   fprintf_unfiltered (file,
1315                       "gdbarch_dump: %s # %s\n",
1316                       "DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr)",
1317                       XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr)));
1318   fprintf_unfiltered (file,
1319                       "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
1320                       (long) current_gdbarch->deprecated_register_virtual_type
1321                       /*DEPRECATED_REGISTER_VIRTUAL_TYPE ()*/);
1322 #endif
1323 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P
1324   fprintf_unfiltered (file,
1325                       "gdbarch_dump: %s # %s\n",
1326                       "DEPRECATED_SAVE_DUMMY_FRAME_TOS_P()",
1327                       XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()));
1328   fprintf_unfiltered (file,
1329                       "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() = %d\n",
1330                       DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ());
1331 #endif
1332 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS
1333   fprintf_unfiltered (file,
1334                       "gdbarch_dump: %s # %s\n",
1335                       "DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)",
1336                       XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp)));
1337   fprintf_unfiltered (file,
1338                       "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
1339                       (long) current_gdbarch->deprecated_save_dummy_frame_tos
1340                       /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
1341 #endif
1342 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
1343   fprintf_unfiltered (file,
1344                       "gdbarch_dump: %s # %s\n",
1345                       "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
1346                       XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
1347   fprintf_unfiltered (file,
1348                       "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL_P() = %d\n",
1349                       DEPRECATED_SAVED_PC_AFTER_CALL_P ());
1350 #endif
1351 #ifdef DEPRECATED_SAVED_PC_AFTER_CALL
1352   fprintf_unfiltered (file,
1353                       "gdbarch_dump: %s # %s\n",
1354                       "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
1355                       XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
1356   fprintf_unfiltered (file,
1357                       "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
1358                       (long) current_gdbarch->deprecated_saved_pc_after_call
1359                       /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
1360 #endif
1361 #ifdef DEPRECATED_STACK_ALIGN_P
1362   fprintf_unfiltered (file,
1363                       "gdbarch_dump: %s # %s\n",
1364                       "DEPRECATED_STACK_ALIGN_P()",
1365                       XSTRING (DEPRECATED_STACK_ALIGN_P ()));
1366   fprintf_unfiltered (file,
1367                       "gdbarch_dump: DEPRECATED_STACK_ALIGN_P() = %d\n",
1368                       DEPRECATED_STACK_ALIGN_P ());
1369 #endif
1370 #ifdef DEPRECATED_STACK_ALIGN
1371   fprintf_unfiltered (file,
1372                       "gdbarch_dump: %s # %s\n",
1373                       "DEPRECATED_STACK_ALIGN(sp)",
1374                       XSTRING (DEPRECATED_STACK_ALIGN (sp)));
1375   fprintf_unfiltered (file,
1376                       "gdbarch_dump: DEPRECATED_STACK_ALIGN = <0x%08lx>\n",
1377                       (long) current_gdbarch->deprecated_stack_align
1378                       /*DEPRECATED_STACK_ALIGN ()*/);
1379 #endif
1380 #ifdef DEPRECATED_STORE_RETURN_VALUE
1381   fprintf_unfiltered (file,
1382                       "gdbarch_dump: %s # %s\n",
1383                       "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
1384                       XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
1385   fprintf_unfiltered (file,
1386                       "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
1387                       (long) current_gdbarch->deprecated_store_return_value
1388                       /*DEPRECATED_STORE_RETURN_VALUE ()*/);
1389 #endif
1390 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
1391   fprintf_unfiltered (file,
1392                       "gdbarch_dump: %s # %s\n",
1393                       "DEPRECATED_STORE_STRUCT_RETURN_P()",
1394                       XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
1395   fprintf_unfiltered (file,
1396                       "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN_P() = %d\n",
1397                       DEPRECATED_STORE_STRUCT_RETURN_P ());
1398 #endif
1399 #ifdef DEPRECATED_STORE_STRUCT_RETURN
1400   fprintf_unfiltered (file,
1401                       "gdbarch_dump: %s # %s\n",
1402                       "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
1403                       XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
1404   fprintf_unfiltered (file,
1405                       "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
1406                       (long) current_gdbarch->deprecated_store_struct_return
1407                       /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
1408 #endif
1409 #ifdef DEPRECATED_TARGET_READ_FP_P
1410   fprintf_unfiltered (file,
1411                       "gdbarch_dump: %s # %s\n",
1412                       "DEPRECATED_TARGET_READ_FP_P()",
1413                       XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
1414   fprintf_unfiltered (file,
1415                       "gdbarch_dump: DEPRECATED_TARGET_READ_FP_P() = %d\n",
1416                       DEPRECATED_TARGET_READ_FP_P ());
1417 #endif
1418 #ifdef DEPRECATED_TARGET_READ_FP
1419   fprintf_unfiltered (file,
1420                       "gdbarch_dump: %s # %s\n",
1421                       "DEPRECATED_TARGET_READ_FP()",
1422                       XSTRING (DEPRECATED_TARGET_READ_FP ()));
1423   fprintf_unfiltered (file,
1424                       "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
1425                       (long) current_gdbarch->deprecated_target_read_fp
1426                       /*DEPRECATED_TARGET_READ_FP ()*/);
1427 #endif
1428 #ifdef DEPRECATED_USE_STRUCT_CONVENTION
1429   fprintf_unfiltered (file,
1430                       "gdbarch_dump: %s # %s\n",
1431                       "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
1432                       XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
1433   fprintf_unfiltered (file,
1434                       "gdbarch_dump: DEPRECATED_USE_STRUCT_CONVENTION = <0x%08lx>\n",
1435                       (long) current_gdbarch->deprecated_use_struct_convention
1436                       /*DEPRECATED_USE_STRUCT_CONVENTION ()*/);
1437 #endif
1438 #ifdef TARGET_DOUBLE_BIT
1439   fprintf_unfiltered (file,
1440                       "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
1441                       XSTRING (TARGET_DOUBLE_BIT));
1442   fprintf_unfiltered (file,
1443                       "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
1444                       TARGET_DOUBLE_BIT);
1445 #endif
1446 #ifdef TARGET_DOUBLE_FORMAT
1447   fprintf_unfiltered (file,
1448                       "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
1449                       XSTRING (TARGET_DOUBLE_FORMAT));
1450   fprintf_unfiltered (file,
1451                       "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n",
1452                       (TARGET_DOUBLE_FORMAT)->name);
1453 #endif
1454 #ifdef DWARF2_REG_TO_REGNUM
1455   fprintf_unfiltered (file,
1456                       "gdbarch_dump: %s # %s\n",
1457                       "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
1458                       XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
1459   fprintf_unfiltered (file,
1460                       "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
1461                       (long) current_gdbarch->dwarf2_reg_to_regnum
1462                       /*DWARF2_REG_TO_REGNUM ()*/);
1463 #endif
1464 #ifdef DWARF_REG_TO_REGNUM
1465   fprintf_unfiltered (file,
1466                       "gdbarch_dump: %s # %s\n",
1467                       "DWARF_REG_TO_REGNUM(dwarf_regnr)",
1468                       XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
1469   fprintf_unfiltered (file,
1470                       "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
1471                       (long) current_gdbarch->dwarf_reg_to_regnum
1472                       /*DWARF_REG_TO_REGNUM ()*/);
1473 #endif
1474 #ifdef ECOFF_REG_TO_REGNUM
1475   fprintf_unfiltered (file,
1476                       "gdbarch_dump: %s # %s\n",
1477                       "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
1478                       XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
1479   fprintf_unfiltered (file,
1480                       "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
1481                       (long) current_gdbarch->ecoff_reg_to_regnum
1482                       /*ECOFF_REG_TO_REGNUM ()*/);
1483 #endif
1484 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
1485   fprintf_unfiltered (file,
1486                       "gdbarch_dump: %s # %s\n",
1487                       "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
1488                       XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
1489   fprintf_unfiltered (file,
1490                       "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
1491                       (long) current_gdbarch->elf_make_msymbol_special
1492                       /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
1493 #endif
1494 #ifdef EXTRACT_RETURN_VALUE
1495   fprintf_unfiltered (file,
1496                       "gdbarch_dump: %s # %s\n",
1497                       "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
1498                       XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
1499   fprintf_unfiltered (file,
1500                       "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
1501                       (long) current_gdbarch->extract_return_value
1502                       /*EXTRACT_RETURN_VALUE ()*/);
1503 #endif
1504 #ifdef FETCH_POINTER_ARGUMENT_P
1505   fprintf_unfiltered (file,
1506                       "gdbarch_dump: %s # %s\n",
1507                       "FETCH_POINTER_ARGUMENT_P()",
1508                       XSTRING (FETCH_POINTER_ARGUMENT_P ()));
1509   fprintf_unfiltered (file,
1510                       "gdbarch_dump: FETCH_POINTER_ARGUMENT_P() = %d\n",
1511                       FETCH_POINTER_ARGUMENT_P ());
1512 #endif
1513 #ifdef FETCH_POINTER_ARGUMENT
1514   fprintf_unfiltered (file,
1515                       "gdbarch_dump: %s # %s\n",
1516                       "FETCH_POINTER_ARGUMENT(frame, argi, type)",
1517                       XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
1518   fprintf_unfiltered (file,
1519                       "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
1520                       (long) current_gdbarch->fetch_pointer_argument
1521                       /*FETCH_POINTER_ARGUMENT ()*/);
1522 #endif
1523 #ifdef TARGET_FLOAT_BIT
1524   fprintf_unfiltered (file,
1525                       "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
1526                       XSTRING (TARGET_FLOAT_BIT));
1527   fprintf_unfiltered (file,
1528                       "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
1529                       TARGET_FLOAT_BIT);
1530 #endif
1531 #ifdef TARGET_FLOAT_FORMAT
1532   fprintf_unfiltered (file,
1533                       "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
1534                       XSTRING (TARGET_FLOAT_FORMAT));
1535   fprintf_unfiltered (file,
1536                       "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n",
1537                       (TARGET_FLOAT_FORMAT)->name);
1538 #endif
1539 #ifdef FP0_REGNUM
1540   fprintf_unfiltered (file,
1541                       "gdbarch_dump: FP0_REGNUM # %s\n",
1542                       XSTRING (FP0_REGNUM));
1543   fprintf_unfiltered (file,
1544                       "gdbarch_dump: FP0_REGNUM = %d\n",
1545                       FP0_REGNUM);
1546 #endif
1547   fprintf_unfiltered (file,
1548                       "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
1549                       gdbarch_frame_align_p (current_gdbarch));
1550   fprintf_unfiltered (file,
1551                       "gdbarch_dump: frame_align = 0x%08lx\n",
1552                       (long) current_gdbarch->frame_align);
1553 #ifdef FRAME_ARGS_SKIP
1554   fprintf_unfiltered (file,
1555                       "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
1556                       XSTRING (FRAME_ARGS_SKIP));
1557   fprintf_unfiltered (file,
1558                       "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
1559                       (long) FRAME_ARGS_SKIP);
1560 #endif
1561 #ifdef FRAME_NUM_ARGS_P
1562   fprintf_unfiltered (file,
1563                       "gdbarch_dump: %s # %s\n",
1564                       "FRAME_NUM_ARGS_P()",
1565                       XSTRING (FRAME_NUM_ARGS_P ()));
1566   fprintf_unfiltered (file,
1567                       "gdbarch_dump: FRAME_NUM_ARGS_P() = %d\n",
1568                       FRAME_NUM_ARGS_P ());
1569 #endif
1570 #ifdef FRAME_NUM_ARGS
1571   fprintf_unfiltered (file,
1572                       "gdbarch_dump: %s # %s\n",
1573                       "FRAME_NUM_ARGS(frame)",
1574                       XSTRING (FRAME_NUM_ARGS (frame)));
1575   fprintf_unfiltered (file,
1576                       "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
1577                       (long) current_gdbarch->frame_num_args
1578                       /*FRAME_NUM_ARGS ()*/);
1579 #endif
1580 #ifdef FRAME_RED_ZONE_SIZE
1581   fprintf_unfiltered (file,
1582                       "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
1583                       XSTRING (FRAME_RED_ZONE_SIZE));
1584   fprintf_unfiltered (file,
1585                       "gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
1586                       FRAME_RED_ZONE_SIZE);
1587 #endif
1588 #ifdef GET_LONGJMP_TARGET_P
1589   fprintf_unfiltered (file,
1590                       "gdbarch_dump: %s # %s\n",
1591                       "GET_LONGJMP_TARGET_P()",
1592                       XSTRING (GET_LONGJMP_TARGET_P ()));
1593   fprintf_unfiltered (file,
1594                       "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n",
1595                       GET_LONGJMP_TARGET_P ());
1596 #endif
1597 #ifdef GET_LONGJMP_TARGET
1598   fprintf_unfiltered (file,
1599                       "gdbarch_dump: %s # %s\n",
1600                       "GET_LONGJMP_TARGET(pc)",
1601                       XSTRING (GET_LONGJMP_TARGET (pc)));
1602   fprintf_unfiltered (file,
1603                       "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
1604                       (long) current_gdbarch->get_longjmp_target
1605                       /*GET_LONGJMP_TARGET ()*/);
1606 #endif
1607 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
1608   fprintf_unfiltered (file,
1609                       "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
1610                       XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
1611   fprintf_unfiltered (file,
1612                       "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
1613                       HAVE_NONSTEPPABLE_WATCHPOINT);
1614 #endif
1615   fprintf_unfiltered (file,
1616                       "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
1617                       (long) current_gdbarch->in_function_epilogue_p);
1618 #ifdef IN_SOLIB_CALL_TRAMPOLINE
1619   fprintf_unfiltered (file,
1620                       "gdbarch_dump: %s # %s\n",
1621                       "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
1622                       XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
1623   fprintf_unfiltered (file,
1624                       "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
1625                       (long) current_gdbarch->in_solib_call_trampoline
1626                       /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
1627 #endif
1628 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
1629   fprintf_unfiltered (file,
1630                       "gdbarch_dump: %s # %s\n",
1631                       "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
1632                       XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
1633   fprintf_unfiltered (file,
1634                       "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
1635                       (long) current_gdbarch->in_solib_return_trampoline
1636                       /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
1637 #endif
1638 #ifdef INNER_THAN
1639   fprintf_unfiltered (file,
1640                       "gdbarch_dump: %s # %s\n",
1641                       "INNER_THAN(lhs, rhs)",
1642                       XSTRING (INNER_THAN (lhs, rhs)));
1643   fprintf_unfiltered (file,
1644                       "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
1645                       (long) current_gdbarch->inner_than
1646                       /*INNER_THAN ()*/);
1647 #endif
1648 #ifdef TARGET_INT_BIT
1649   fprintf_unfiltered (file,
1650                       "gdbarch_dump: TARGET_INT_BIT # %s\n",
1651                       XSTRING (TARGET_INT_BIT));
1652   fprintf_unfiltered (file,
1653                       "gdbarch_dump: TARGET_INT_BIT = %d\n",
1654                       TARGET_INT_BIT);
1655 #endif
1656 #ifdef INTEGER_TO_ADDRESS_P
1657   fprintf_unfiltered (file,
1658                       "gdbarch_dump: %s # %s\n",
1659                       "INTEGER_TO_ADDRESS_P()",
1660                       XSTRING (INTEGER_TO_ADDRESS_P ()));
1661   fprintf_unfiltered (file,
1662                       "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n",
1663                       INTEGER_TO_ADDRESS_P ());
1664 #endif
1665 #ifdef INTEGER_TO_ADDRESS
1666   fprintf_unfiltered (file,
1667                       "gdbarch_dump: %s # %s\n",
1668                       "INTEGER_TO_ADDRESS(type, buf)",
1669                       XSTRING (INTEGER_TO_ADDRESS (type, buf)));
1670   fprintf_unfiltered (file,
1671                       "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
1672                       (long) current_gdbarch->integer_to_address
1673                       /*INTEGER_TO_ADDRESS ()*/);
1674 #endif
1675 #ifdef TARGET_LONG_BIT
1676   fprintf_unfiltered (file,
1677                       "gdbarch_dump: TARGET_LONG_BIT # %s\n",
1678                       XSTRING (TARGET_LONG_BIT));
1679   fprintf_unfiltered (file,
1680                       "gdbarch_dump: TARGET_LONG_BIT = %d\n",
1681                       TARGET_LONG_BIT);
1682 #endif
1683 #ifdef TARGET_LONG_DOUBLE_BIT
1684   fprintf_unfiltered (file,
1685                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
1686                       XSTRING (TARGET_LONG_DOUBLE_BIT));
1687   fprintf_unfiltered (file,
1688                       "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
1689                       TARGET_LONG_DOUBLE_BIT);
1690 #endif
1691 #ifdef TARGET_LONG_DOUBLE_FORMAT
1692   fprintf_unfiltered (file,
1693                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
1694                       XSTRING (TARGET_LONG_DOUBLE_FORMAT));
1695   fprintf_unfiltered (file,
1696                       "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n",
1697                       (TARGET_LONG_DOUBLE_FORMAT)->name);
1698 #endif
1699 #ifdef TARGET_LONG_LONG_BIT
1700   fprintf_unfiltered (file,
1701                       "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
1702                       XSTRING (TARGET_LONG_LONG_BIT));
1703   fprintf_unfiltered (file,
1704                       "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
1705                       TARGET_LONG_LONG_BIT);
1706 #endif
1707 #ifdef MEMORY_INSERT_BREAKPOINT
1708   fprintf_unfiltered (file,
1709                       "gdbarch_dump: %s # %s\n",
1710                       "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
1711                       XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
1712   fprintf_unfiltered (file,
1713                       "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
1714                       (long) current_gdbarch->memory_insert_breakpoint
1715                       /*MEMORY_INSERT_BREAKPOINT ()*/);
1716 #endif
1717 #ifdef MEMORY_REMOVE_BREAKPOINT
1718   fprintf_unfiltered (file,
1719                       "gdbarch_dump: %s # %s\n",
1720                       "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
1721                       XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
1722   fprintf_unfiltered (file,
1723                       "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
1724                       (long) current_gdbarch->memory_remove_breakpoint
1725                       /*MEMORY_REMOVE_BREAKPOINT ()*/);
1726 #endif
1727 #ifdef NAME_OF_MALLOC
1728   fprintf_unfiltered (file,
1729                       "gdbarch_dump: NAME_OF_MALLOC # %s\n",
1730                       XSTRING (NAME_OF_MALLOC));
1731   fprintf_unfiltered (file,
1732                       "gdbarch_dump: NAME_OF_MALLOC = %s\n",
1733                       NAME_OF_MALLOC);
1734 #endif
1735 #ifdef NUM_PSEUDO_REGS
1736   fprintf_unfiltered (file,
1737                       "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
1738                       XSTRING (NUM_PSEUDO_REGS));
1739   fprintf_unfiltered (file,
1740                       "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
1741                       NUM_PSEUDO_REGS);
1742 #endif
1743 #ifdef NUM_REGS
1744   fprintf_unfiltered (file,
1745                       "gdbarch_dump: NUM_REGS # %s\n",
1746                       XSTRING (NUM_REGS));
1747   fprintf_unfiltered (file,
1748                       "gdbarch_dump: NUM_REGS = %d\n",
1749                       NUM_REGS);
1750 #endif
1751 #ifdef TARGET_OSABI
1752   fprintf_unfiltered (file,
1753                       "gdbarch_dump: TARGET_OSABI # %s\n",
1754                       XSTRING (TARGET_OSABI));
1755   fprintf_unfiltered (file,
1756                       "gdbarch_dump: TARGET_OSABI = %ld\n",
1757                       (long) TARGET_OSABI);
1758 #endif
1759 #ifdef PC_REGNUM
1760   fprintf_unfiltered (file,
1761                       "gdbarch_dump: PC_REGNUM # %s\n",
1762                       XSTRING (PC_REGNUM));
1763   fprintf_unfiltered (file,
1764                       "gdbarch_dump: PC_REGNUM = %d\n",
1765                       PC_REGNUM);
1766 #endif
1767 #ifdef POINTER_TO_ADDRESS
1768   fprintf_unfiltered (file,
1769                       "gdbarch_dump: %s # %s\n",
1770                       "POINTER_TO_ADDRESS(type, buf)",
1771                       XSTRING (POINTER_TO_ADDRESS (type, buf)));
1772   fprintf_unfiltered (file,
1773                       "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
1774                       (long) current_gdbarch->pointer_to_address
1775                       /*POINTER_TO_ADDRESS ()*/);
1776 #endif
1777   fprintf_unfiltered (file,
1778                       "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
1779                       gdbarch_print_float_info_p (current_gdbarch));
1780   fprintf_unfiltered (file,
1781                       "gdbarch_dump: print_float_info = 0x%08lx\n",
1782                       (long) current_gdbarch->print_float_info);
1783 #ifdef TARGET_PRINT_INSN
1784   fprintf_unfiltered (file,
1785                       "gdbarch_dump: %s # %s\n",
1786                       "TARGET_PRINT_INSN(vma, info)",
1787                       XSTRING (TARGET_PRINT_INSN (vma, info)));
1788   fprintf_unfiltered (file,
1789                       "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
1790                       (long) current_gdbarch->print_insn
1791                       /*TARGET_PRINT_INSN ()*/);
1792 #endif
1793   fprintf_unfiltered (file,
1794                       "gdbarch_dump: print_registers_info = 0x%08lx\n",
1795                       (long) current_gdbarch->print_registers_info);
1796   fprintf_unfiltered (file,
1797                       "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
1798                       gdbarch_print_vector_info_p (current_gdbarch));
1799   fprintf_unfiltered (file,
1800                       "gdbarch_dump: print_vector_info = 0x%08lx\n",
1801                       (long) current_gdbarch->print_vector_info);
1802 #ifdef PS_REGNUM
1803   fprintf_unfiltered (file,
1804                       "gdbarch_dump: PS_REGNUM # %s\n",
1805                       XSTRING (PS_REGNUM));
1806   fprintf_unfiltered (file,
1807                       "gdbarch_dump: PS_REGNUM = %d\n",
1808                       PS_REGNUM);
1809 #endif
1810   fprintf_unfiltered (file,
1811                       "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
1812                       gdbarch_pseudo_register_read_p (current_gdbarch));
1813   fprintf_unfiltered (file,
1814                       "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
1815                       (long) current_gdbarch->pseudo_register_read);
1816   fprintf_unfiltered (file,
1817                       "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
1818                       gdbarch_pseudo_register_write_p (current_gdbarch));
1819   fprintf_unfiltered (file,
1820                       "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
1821                       (long) current_gdbarch->pseudo_register_write);
1822 #ifdef TARGET_PTR_BIT
1823   fprintf_unfiltered (file,
1824                       "gdbarch_dump: TARGET_PTR_BIT # %s\n",
1825                       XSTRING (TARGET_PTR_BIT));
1826   fprintf_unfiltered (file,
1827                       "gdbarch_dump: TARGET_PTR_BIT = %d\n",
1828                       TARGET_PTR_BIT);
1829 #endif
1830   fprintf_unfiltered (file,
1831                       "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
1832                       gdbarch_push_dummy_call_p (current_gdbarch));
1833   fprintf_unfiltered (file,
1834                       "gdbarch_dump: push_dummy_call = 0x%08lx\n",
1835                       (long) current_gdbarch->push_dummy_call);
1836   fprintf_unfiltered (file,
1837                       "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
1838                       gdbarch_push_dummy_code_p (current_gdbarch));
1839   fprintf_unfiltered (file,
1840                       "gdbarch_dump: push_dummy_code = 0x%08lx\n",
1841                       (long) current_gdbarch->push_dummy_code);
1842 #ifdef TARGET_READ_PC_P
1843   fprintf_unfiltered (file,
1844                       "gdbarch_dump: %s # %s\n",
1845                       "TARGET_READ_PC_P()",
1846                       XSTRING (TARGET_READ_PC_P ()));
1847   fprintf_unfiltered (file,
1848                       "gdbarch_dump: TARGET_READ_PC_P() = %d\n",
1849                       TARGET_READ_PC_P ());
1850 #endif
1851 #ifdef TARGET_READ_PC
1852   fprintf_unfiltered (file,
1853                       "gdbarch_dump: %s # %s\n",
1854                       "TARGET_READ_PC(ptid)",
1855                       XSTRING (TARGET_READ_PC (ptid)));
1856   fprintf_unfiltered (file,
1857                       "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
1858                       (long) current_gdbarch->read_pc
1859                       /*TARGET_READ_PC ()*/);
1860 #endif
1861 #ifdef TARGET_READ_SP_P
1862   fprintf_unfiltered (file,
1863                       "gdbarch_dump: %s # %s\n",
1864                       "TARGET_READ_SP_P()",
1865                       XSTRING (TARGET_READ_SP_P ()));
1866   fprintf_unfiltered (file,
1867                       "gdbarch_dump: TARGET_READ_SP_P() = %d\n",
1868                       TARGET_READ_SP_P ());
1869 #endif
1870 #ifdef TARGET_READ_SP
1871   fprintf_unfiltered (file,
1872                       "gdbarch_dump: %s # %s\n",
1873                       "TARGET_READ_SP()",
1874                       XSTRING (TARGET_READ_SP ()));
1875   fprintf_unfiltered (file,
1876                       "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
1877                       (long) current_gdbarch->read_sp
1878                       /*TARGET_READ_SP ()*/);
1879 #endif
1880 #ifdef REGISTER_BYTES_OK_P
1881   fprintf_unfiltered (file,
1882                       "gdbarch_dump: %s # %s\n",
1883                       "REGISTER_BYTES_OK_P()",
1884                       XSTRING (REGISTER_BYTES_OK_P ()));
1885   fprintf_unfiltered (file,
1886                       "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n",
1887                       REGISTER_BYTES_OK_P ());
1888 #endif
1889 #ifdef REGISTER_BYTES_OK
1890   fprintf_unfiltered (file,
1891                       "gdbarch_dump: %s # %s\n",
1892                       "REGISTER_BYTES_OK(nr_bytes)",
1893                       XSTRING (REGISTER_BYTES_OK (nr_bytes)));
1894   fprintf_unfiltered (file,
1895                       "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
1896                       (long) current_gdbarch->register_bytes_ok
1897                       /*REGISTER_BYTES_OK ()*/);
1898 #endif
1899 #ifdef REGISTER_NAME
1900   fprintf_unfiltered (file,
1901                       "gdbarch_dump: %s # %s\n",
1902                       "REGISTER_NAME(regnr)",
1903                       XSTRING (REGISTER_NAME (regnr)));
1904   fprintf_unfiltered (file,
1905                       "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
1906                       (long) current_gdbarch->register_name
1907                       /*REGISTER_NAME ()*/);
1908 #endif
1909   fprintf_unfiltered (file,
1910                       "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
1911                       (long) current_gdbarch->register_reggroup_p);
1912 #ifdef REGISTER_SIM_REGNO
1913   fprintf_unfiltered (file,
1914                       "gdbarch_dump: %s # %s\n",
1915                       "REGISTER_SIM_REGNO(reg_nr)",
1916                       XSTRING (REGISTER_SIM_REGNO (reg_nr)));
1917   fprintf_unfiltered (file,
1918                       "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
1919                       (long) current_gdbarch->register_sim_regno
1920                       /*REGISTER_SIM_REGNO ()*/);
1921 #endif
1922 #ifdef REGISTER_TO_VALUE
1923   fprintf_unfiltered (file,
1924                       "gdbarch_dump: %s # %s\n",
1925                       "REGISTER_TO_VALUE(frame, regnum, type, buf)",
1926                       XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
1927   fprintf_unfiltered (file,
1928                       "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
1929                       (long) current_gdbarch->register_to_value
1930                       /*REGISTER_TO_VALUE ()*/);
1931 #endif
1932   fprintf_unfiltered (file,
1933                       "gdbarch_dump: gdbarch_register_type_p() = %d\n",
1934                       gdbarch_register_type_p (current_gdbarch));
1935   fprintf_unfiltered (file,
1936                       "gdbarch_dump: register_type = 0x%08lx\n",
1937                       (long) current_gdbarch->register_type);
1938   fprintf_unfiltered (file,
1939                       "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
1940                       gdbarch_regset_from_core_section_p (current_gdbarch));
1941   fprintf_unfiltered (file,
1942                       "gdbarch_dump: regset_from_core_section = 0x%08lx\n",
1943                       (long) current_gdbarch->regset_from_core_section);
1944   fprintf_unfiltered (file,
1945                       "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
1946                       (long) current_gdbarch->remote_translate_xfer_address);
1947   fprintf_unfiltered (file,
1948                       "gdbarch_dump: gdbarch_return_value_p() = %d\n",
1949                       gdbarch_return_value_p (current_gdbarch));
1950   fprintf_unfiltered (file,
1951                       "gdbarch_dump: return_value = 0x%08lx\n",
1952                       (long) current_gdbarch->return_value);
1953 #ifdef SDB_REG_TO_REGNUM
1954   fprintf_unfiltered (file,
1955                       "gdbarch_dump: %s # %s\n",
1956                       "SDB_REG_TO_REGNUM(sdb_regnr)",
1957                       XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
1958   fprintf_unfiltered (file,
1959                       "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
1960                       (long) current_gdbarch->sdb_reg_to_regnum
1961                       /*SDB_REG_TO_REGNUM ()*/);
1962 #endif
1963 #ifdef TARGET_SHORT_BIT
1964   fprintf_unfiltered (file,
1965                       "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
1966                       XSTRING (TARGET_SHORT_BIT));
1967   fprintf_unfiltered (file,
1968                       "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
1969                       TARGET_SHORT_BIT);
1970 #endif
1971 #ifdef SKIP_PROLOGUE
1972   fprintf_unfiltered (file,
1973                       "gdbarch_dump: %s # %s\n",
1974                       "SKIP_PROLOGUE(ip)",
1975                       XSTRING (SKIP_PROLOGUE (ip)));
1976   fprintf_unfiltered (file,
1977                       "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
1978                       (long) current_gdbarch->skip_prologue
1979                       /*SKIP_PROLOGUE ()*/);
1980 #endif
1981   fprintf_unfiltered (file,
1982                       "gdbarch_dump: skip_solib_resolver = 0x%08lx\n",
1983                       (long) current_gdbarch->skip_solib_resolver);
1984 #ifdef SKIP_TRAMPOLINE_CODE
1985   fprintf_unfiltered (file,
1986                       "gdbarch_dump: %s # %s\n",
1987                       "SKIP_TRAMPOLINE_CODE(pc)",
1988                       XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
1989   fprintf_unfiltered (file,
1990                       "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
1991                       (long) current_gdbarch->skip_trampoline_code
1992                       /*SKIP_TRAMPOLINE_CODE ()*/);
1993 #endif
1994 #ifdef SMASH_TEXT_ADDRESS
1995   fprintf_unfiltered (file,
1996                       "gdbarch_dump: %s # %s\n",
1997                       "SMASH_TEXT_ADDRESS(addr)",
1998                       XSTRING (SMASH_TEXT_ADDRESS (addr)));
1999   fprintf_unfiltered (file,
2000                       "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
2001                       (long) current_gdbarch->smash_text_address
2002                       /*SMASH_TEXT_ADDRESS ()*/);
2003 #endif
2004 #ifdef SOFTWARE_SINGLE_STEP_P
2005   fprintf_unfiltered (file,
2006                       "gdbarch_dump: %s # %s\n",
2007                       "SOFTWARE_SINGLE_STEP_P()",
2008                       XSTRING (SOFTWARE_SINGLE_STEP_P ()));
2009   fprintf_unfiltered (file,
2010                       "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n",
2011                       SOFTWARE_SINGLE_STEP_P ());
2012 #endif
2013 #ifdef SOFTWARE_SINGLE_STEP
2014   fprintf_unfiltered (file,
2015                       "gdbarch_dump: %s # %s\n",
2016                       "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
2017                       XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
2018   fprintf_unfiltered (file,
2019                       "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
2020                       (long) current_gdbarch->software_single_step
2021                       /*SOFTWARE_SINGLE_STEP ()*/);
2022 #endif
2023 #ifdef SP_REGNUM
2024   fprintf_unfiltered (file,
2025                       "gdbarch_dump: SP_REGNUM # %s\n",
2026                       XSTRING (SP_REGNUM));
2027   fprintf_unfiltered (file,
2028                       "gdbarch_dump: SP_REGNUM = %d\n",
2029                       SP_REGNUM);
2030 #endif
2031 #ifdef STAB_REG_TO_REGNUM
2032   fprintf_unfiltered (file,
2033                       "gdbarch_dump: %s # %s\n",
2034                       "STAB_REG_TO_REGNUM(stab_regnr)",
2035                       XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
2036   fprintf_unfiltered (file,
2037                       "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
2038                       (long) current_gdbarch->stab_reg_to_regnum
2039                       /*STAB_REG_TO_REGNUM ()*/);
2040 #endif
2041   fprintf_unfiltered (file,
2042                       "gdbarch_dump: stabs_argument_has_addr = 0x%08lx\n",
2043                       (long) current_gdbarch->stabs_argument_has_addr);
2044 #ifdef STORE_RETURN_VALUE
2045   fprintf_unfiltered (file,
2046                       "gdbarch_dump: %s # %s\n",
2047                       "STORE_RETURN_VALUE(type, regcache, valbuf)",
2048                       XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
2049   fprintf_unfiltered (file,
2050                       "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
2051                       (long) current_gdbarch->store_return_value
2052                       /*STORE_RETURN_VALUE ()*/);
2053 #endif
2054   fprintf_unfiltered (file,
2055                       "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
2056                       gdbarch_unwind_dummy_id_p (current_gdbarch));
2057   fprintf_unfiltered (file,
2058                       "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
2059                       (long) current_gdbarch->unwind_dummy_id);
2060   fprintf_unfiltered (file,
2061                       "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
2062                       gdbarch_unwind_pc_p (current_gdbarch));
2063   fprintf_unfiltered (file,
2064                       "gdbarch_dump: unwind_pc = 0x%08lx\n",
2065                       (long) current_gdbarch->unwind_pc);
2066   fprintf_unfiltered (file,
2067                       "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
2068                       gdbarch_unwind_sp_p (current_gdbarch));
2069   fprintf_unfiltered (file,
2070                       "gdbarch_dump: unwind_sp = 0x%08lx\n",
2071                       (long) current_gdbarch->unwind_sp);
2072 #ifdef VALUE_TO_REGISTER
2073   fprintf_unfiltered (file,
2074                       "gdbarch_dump: %s # %s\n",
2075                       "VALUE_TO_REGISTER(frame, regnum, type, buf)",
2076                       XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
2077   fprintf_unfiltered (file,
2078                       "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
2079                       (long) current_gdbarch->value_to_register
2080                       /*VALUE_TO_REGISTER ()*/);
2081 #endif
2082 #ifdef TARGET_VIRTUAL_FRAME_POINTER
2083   fprintf_unfiltered (file,
2084                       "gdbarch_dump: %s # %s\n",
2085                       "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
2086                       XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
2087   fprintf_unfiltered (file,
2088                       "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
2089                       (long) current_gdbarch->virtual_frame_pointer
2090                       /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
2091 #endif
2092 #ifdef TARGET_WRITE_PC
2093   fprintf_unfiltered (file,
2094                       "gdbarch_dump: %s # %s\n",
2095                       "TARGET_WRITE_PC(val, ptid)",
2096                       XSTRING (TARGET_WRITE_PC (val, ptid)));
2097   fprintf_unfiltered (file,
2098                       "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
2099                       (long) current_gdbarch->write_pc
2100                       /*TARGET_WRITE_PC ()*/);
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 }