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