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