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