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