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