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