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