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