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