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