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