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