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