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