xref: /dflybsd-src/contrib/gdb-7/gdb/gdbarch.c (revision a45ae5f869d9cfcb3e41dbab486e10bfa9e336bf)
15796c8dcSSimon Schubert /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
25796c8dcSSimon Schubert 
35796c8dcSSimon Schubert /* Dynamic architecture support for GDB, the GNU debugger.
45796c8dcSSimon Schubert 
5cf7f2e2dSJohn Marino    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6cf7f2e2dSJohn Marino    2007, 2008, 2009 Free Software Foundation, Inc.
75796c8dcSSimon Schubert 
85796c8dcSSimon Schubert    This file is part of GDB.
95796c8dcSSimon Schubert 
105796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
115796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
125796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
135796c8dcSSimon Schubert    (at your option) any later version.
145796c8dcSSimon Schubert 
155796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
165796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
175796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
185796c8dcSSimon Schubert    GNU General Public License for more details.
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
215796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
225796c8dcSSimon Schubert 
235796c8dcSSimon Schubert /* This file was created with the aid of ``gdbarch.sh''.
245796c8dcSSimon Schubert 
255796c8dcSSimon Schubert    The Bourne shell script ``gdbarch.sh'' creates the files
265796c8dcSSimon Schubert    ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
275796c8dcSSimon Schubert    against the existing ``gdbarch.[hc]''.  Any differences found
285796c8dcSSimon Schubert    being reported.
295796c8dcSSimon Schubert 
305796c8dcSSimon Schubert    If editing this file, please also run gdbarch.sh and merge any
315796c8dcSSimon Schubert    changes into that script. Conversely, when making sweeping changes
325796c8dcSSimon Schubert    to this file, modifying gdbarch.sh and using its output may prove
335796c8dcSSimon Schubert    easier.  */
345796c8dcSSimon Schubert 
355796c8dcSSimon Schubert 
365796c8dcSSimon Schubert #include "defs.h"
375796c8dcSSimon Schubert #include "arch-utils.h"
385796c8dcSSimon Schubert 
395796c8dcSSimon Schubert #include "gdbcmd.h"
405796c8dcSSimon Schubert #include "inferior.h"
415796c8dcSSimon Schubert #include "symcat.h"
425796c8dcSSimon Schubert 
435796c8dcSSimon Schubert #include "floatformat.h"
445796c8dcSSimon Schubert 
455796c8dcSSimon Schubert #include "gdb_assert.h"
465796c8dcSSimon Schubert #include "gdb_string.h"
475796c8dcSSimon Schubert #include "reggroups.h"
485796c8dcSSimon Schubert #include "osabi.h"
495796c8dcSSimon Schubert #include "gdb_obstack.h"
505796c8dcSSimon Schubert #include "observer.h"
515796c8dcSSimon Schubert #include "regcache.h"
525796c8dcSSimon Schubert 
535796c8dcSSimon Schubert /* Static function declarations */
545796c8dcSSimon Schubert 
555796c8dcSSimon Schubert static void alloc_gdbarch_data (struct gdbarch *);
565796c8dcSSimon Schubert 
575796c8dcSSimon Schubert /* Non-zero if we want to trace architecture code.  */
585796c8dcSSimon Schubert 
595796c8dcSSimon Schubert #ifndef GDBARCH_DEBUG
605796c8dcSSimon Schubert #define GDBARCH_DEBUG 0
615796c8dcSSimon Schubert #endif
625796c8dcSSimon Schubert int gdbarch_debug = GDBARCH_DEBUG;
635796c8dcSSimon Schubert static void
645796c8dcSSimon Schubert show_gdbarch_debug (struct ui_file *file, int from_tty,
655796c8dcSSimon Schubert                     struct cmd_list_element *c, const char *value)
665796c8dcSSimon Schubert {
675796c8dcSSimon Schubert   fprintf_filtered (file, _("Architecture debugging is %s.\n"), value);
685796c8dcSSimon Schubert }
695796c8dcSSimon Schubert 
705796c8dcSSimon Schubert static const char *
715796c8dcSSimon Schubert pformat (const struct floatformat **format)
725796c8dcSSimon Schubert {
735796c8dcSSimon Schubert   if (format == NULL)
745796c8dcSSimon Schubert     return "(null)";
755796c8dcSSimon Schubert   else
765796c8dcSSimon Schubert     /* Just print out one of them - this is only for diagnostics.  */
775796c8dcSSimon Schubert     return format[0]->name;
785796c8dcSSimon Schubert }
795796c8dcSSimon Schubert 
80cf7f2e2dSJohn Marino static const char *
81cf7f2e2dSJohn Marino pstring (const char *string)
82cf7f2e2dSJohn Marino {
83cf7f2e2dSJohn Marino   if (string == NULL)
84cf7f2e2dSJohn Marino     return "(null)";
85cf7f2e2dSJohn Marino   return string;
86cf7f2e2dSJohn Marino }
87cf7f2e2dSJohn Marino 
885796c8dcSSimon Schubert 
89c50c785cSJohn Marino /* Maintain the struct gdbarch object.  */
905796c8dcSSimon Schubert 
915796c8dcSSimon Schubert struct gdbarch
925796c8dcSSimon Schubert {
935796c8dcSSimon Schubert   /* Has this architecture been fully initialized?  */
945796c8dcSSimon Schubert   int initialized_p;
955796c8dcSSimon Schubert 
965796c8dcSSimon Schubert   /* An obstack bound to the lifetime of the architecture.  */
975796c8dcSSimon Schubert   struct obstack *obstack;
985796c8dcSSimon Schubert 
99c50c785cSJohn Marino   /* basic architectural information.  */
1005796c8dcSSimon Schubert   const struct bfd_arch_info * bfd_arch_info;
1015796c8dcSSimon Schubert   int byte_order;
1025796c8dcSSimon Schubert   int byte_order_for_code;
1035796c8dcSSimon Schubert   enum gdb_osabi osabi;
1045796c8dcSSimon Schubert   const struct target_desc * target_desc;
1055796c8dcSSimon Schubert 
1065796c8dcSSimon Schubert   /* target specific vector.  */
1075796c8dcSSimon Schubert   struct gdbarch_tdep *tdep;
1085796c8dcSSimon Schubert   gdbarch_dump_tdep_ftype *dump_tdep;
1095796c8dcSSimon Schubert 
110c50c785cSJohn Marino   /* per-architecture data-pointers.  */
1115796c8dcSSimon Schubert   unsigned nr_data;
1125796c8dcSSimon Schubert   void **data;
1135796c8dcSSimon Schubert 
114c50c785cSJohn Marino   /* per-architecture swap-regions.  */
1155796c8dcSSimon Schubert   struct gdbarch_swap *swap;
1165796c8dcSSimon Schubert 
1175796c8dcSSimon Schubert   /* Multi-arch values.
1185796c8dcSSimon Schubert 
1195796c8dcSSimon Schubert      When extending this structure you must:
1205796c8dcSSimon Schubert 
1215796c8dcSSimon Schubert      Add the field below.
1225796c8dcSSimon Schubert 
1235796c8dcSSimon Schubert      Declare set/get functions and define the corresponding
1245796c8dcSSimon Schubert      macro in gdbarch.h.
1255796c8dcSSimon Schubert 
1265796c8dcSSimon Schubert      gdbarch_alloc(): If zero/NULL is not a suitable default,
1275796c8dcSSimon Schubert      initialize the new field.
1285796c8dcSSimon Schubert 
1295796c8dcSSimon Schubert      verify_gdbarch(): Confirm that the target updated the field
1305796c8dcSSimon Schubert      correctly.
1315796c8dcSSimon Schubert 
1325796c8dcSSimon Schubert      gdbarch_dump(): Add a fprintf_unfiltered call so that the new
1335796c8dcSSimon Schubert      field is dumped out
1345796c8dcSSimon Schubert 
1355796c8dcSSimon Schubert      ``startup_gdbarch()'': Append an initial value to the static
1365796c8dcSSimon Schubert      variable (base values on the host's c-type system).
1375796c8dcSSimon Schubert 
1385796c8dcSSimon Schubert      get_gdbarch(): Implement the set/get functions (probably using
1395796c8dcSSimon Schubert      the macro's as shortcuts).
1405796c8dcSSimon Schubert 
1415796c8dcSSimon Schubert      */
1425796c8dcSSimon Schubert 
1435796c8dcSSimon Schubert   int bits_big_endian;
1445796c8dcSSimon Schubert   int short_bit;
1455796c8dcSSimon Schubert   int int_bit;
1465796c8dcSSimon Schubert   int long_bit;
1475796c8dcSSimon Schubert   int long_long_bit;
148*a45ae5f8SJohn Marino   int long_long_align_bit;
149cf7f2e2dSJohn Marino   int half_bit;
150cf7f2e2dSJohn Marino   const struct floatformat ** half_format;
1515796c8dcSSimon Schubert   int float_bit;
1525796c8dcSSimon Schubert   const struct floatformat ** float_format;
1535796c8dcSSimon Schubert   int double_bit;
1545796c8dcSSimon Schubert   const struct floatformat ** double_format;
1555796c8dcSSimon Schubert   int long_double_bit;
1565796c8dcSSimon Schubert   const struct floatformat ** long_double_format;
1575796c8dcSSimon Schubert   int ptr_bit;
1585796c8dcSSimon Schubert   int addr_bit;
159c50c785cSJohn Marino   int dwarf2_addr_size;
1605796c8dcSSimon Schubert   int char_signed;
1615796c8dcSSimon Schubert   gdbarch_read_pc_ftype *read_pc;
1625796c8dcSSimon Schubert   gdbarch_write_pc_ftype *write_pc;
1635796c8dcSSimon Schubert   gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
1645796c8dcSSimon Schubert   gdbarch_pseudo_register_read_ftype *pseudo_register_read;
165*a45ae5f8SJohn Marino   gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value;
1665796c8dcSSimon Schubert   gdbarch_pseudo_register_write_ftype *pseudo_register_write;
1675796c8dcSSimon Schubert   int num_regs;
1685796c8dcSSimon Schubert   int num_pseudo_regs;
169c50c785cSJohn Marino   gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
170c50c785cSJohn Marino   gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
1715796c8dcSSimon Schubert   int sp_regnum;
1725796c8dcSSimon Schubert   int pc_regnum;
1735796c8dcSSimon Schubert   int ps_regnum;
1745796c8dcSSimon Schubert   int fp0_regnum;
1755796c8dcSSimon Schubert   gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
1765796c8dcSSimon Schubert   gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
1775796c8dcSSimon Schubert   gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
1785796c8dcSSimon Schubert   gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
1795796c8dcSSimon Schubert   gdbarch_register_name_ftype *register_name;
1805796c8dcSSimon Schubert   gdbarch_register_type_ftype *register_type;
1815796c8dcSSimon Schubert   gdbarch_dummy_id_ftype *dummy_id;
1825796c8dcSSimon Schubert   int deprecated_fp_regnum;
1835796c8dcSSimon Schubert   gdbarch_push_dummy_call_ftype *push_dummy_call;
1845796c8dcSSimon Schubert   int call_dummy_location;
1855796c8dcSSimon Schubert   gdbarch_push_dummy_code_ftype *push_dummy_code;
1865796c8dcSSimon Schubert   gdbarch_print_registers_info_ftype *print_registers_info;
1875796c8dcSSimon Schubert   gdbarch_print_float_info_ftype *print_float_info;
1885796c8dcSSimon Schubert   gdbarch_print_vector_info_ftype *print_vector_info;
1895796c8dcSSimon Schubert   gdbarch_register_sim_regno_ftype *register_sim_regno;
1905796c8dcSSimon Schubert   gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
1915796c8dcSSimon Schubert   gdbarch_cannot_store_register_ftype *cannot_store_register;
1925796c8dcSSimon Schubert   gdbarch_get_longjmp_target_ftype *get_longjmp_target;
1935796c8dcSSimon Schubert   int believe_pcc_promotion;
1945796c8dcSSimon Schubert   gdbarch_convert_register_p_ftype *convert_register_p;
1955796c8dcSSimon Schubert   gdbarch_register_to_value_ftype *register_to_value;
1965796c8dcSSimon Schubert   gdbarch_value_to_register_ftype *value_to_register;
1975796c8dcSSimon Schubert   gdbarch_value_from_register_ftype *value_from_register;
1985796c8dcSSimon Schubert   gdbarch_pointer_to_address_ftype *pointer_to_address;
1995796c8dcSSimon Schubert   gdbarch_address_to_pointer_ftype *address_to_pointer;
2005796c8dcSSimon Schubert   gdbarch_integer_to_address_ftype *integer_to_address;
2015796c8dcSSimon Schubert   gdbarch_return_value_ftype *return_value;
2025796c8dcSSimon Schubert   gdbarch_skip_prologue_ftype *skip_prologue;
2035796c8dcSSimon Schubert   gdbarch_skip_main_prologue_ftype *skip_main_prologue;
2045796c8dcSSimon Schubert   gdbarch_inner_than_ftype *inner_than;
2055796c8dcSSimon Schubert   gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc;
206cf7f2e2dSJohn Marino   gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc;
2075796c8dcSSimon Schubert   gdbarch_adjust_breakpoint_address_ftype *adjust_breakpoint_address;
2085796c8dcSSimon Schubert   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
2095796c8dcSSimon Schubert   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
2105796c8dcSSimon Schubert   CORE_ADDR decr_pc_after_break;
2115796c8dcSSimon Schubert   CORE_ADDR deprecated_function_start_offset;
2125796c8dcSSimon Schubert   gdbarch_remote_register_number_ftype *remote_register_number;
2135796c8dcSSimon Schubert   gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address;
2145796c8dcSSimon Schubert   CORE_ADDR frame_args_skip;
2155796c8dcSSimon Schubert   gdbarch_unwind_pc_ftype *unwind_pc;
2165796c8dcSSimon Schubert   gdbarch_unwind_sp_ftype *unwind_sp;
2175796c8dcSSimon Schubert   gdbarch_frame_num_args_ftype *frame_num_args;
2185796c8dcSSimon Schubert   gdbarch_frame_align_ftype *frame_align;
2195796c8dcSSimon Schubert   gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
2205796c8dcSSimon Schubert   int frame_red_zone_size;
2215796c8dcSSimon Schubert   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
2225796c8dcSSimon Schubert   gdbarch_addr_bits_remove_ftype *addr_bits_remove;
2235796c8dcSSimon Schubert   gdbarch_smash_text_address_ftype *smash_text_address;
2245796c8dcSSimon Schubert   gdbarch_software_single_step_ftype *software_single_step;
2255796c8dcSSimon Schubert   gdbarch_single_step_through_delay_ftype *single_step_through_delay;
2265796c8dcSSimon Schubert   gdbarch_print_insn_ftype *print_insn;
2275796c8dcSSimon Schubert   gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
2285796c8dcSSimon Schubert   gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
2295796c8dcSSimon Schubert   gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
2305796c8dcSSimon Schubert   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
2315796c8dcSSimon Schubert   gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
2325796c8dcSSimon Schubert   gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
2335796c8dcSSimon Schubert   int cannot_step_breakpoint;
2345796c8dcSSimon Schubert   int have_nonsteppable_watchpoint;
2355796c8dcSSimon Schubert   gdbarch_address_class_type_flags_ftype *address_class_type_flags;
2365796c8dcSSimon Schubert   gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name;
2375796c8dcSSimon Schubert   gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags;
2385796c8dcSSimon Schubert   gdbarch_register_reggroup_p_ftype *register_reggroup_p;
2395796c8dcSSimon Schubert   gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
2405796c8dcSSimon Schubert   gdbarch_regset_from_core_section_ftype *regset_from_core_section;
2415796c8dcSSimon Schubert   struct core_regset_section * core_regset_sections;
2425796c8dcSSimon Schubert   gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
2435796c8dcSSimon Schubert   gdbarch_core_pid_to_str_ftype *core_pid_to_str;
2445796c8dcSSimon Schubert   const char * gcore_bfd_target;
2455796c8dcSSimon Schubert   int vtable_function_descriptors;
2465796c8dcSSimon Schubert   int vbit_in_delta;
2475796c8dcSSimon Schubert   gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
2485796c8dcSSimon Schubert   ULONGEST max_insn_length;
2495796c8dcSSimon Schubert   gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
2505796c8dcSSimon Schubert   gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
2515796c8dcSSimon Schubert   gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
2525796c8dcSSimon Schubert   gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
2535796c8dcSSimon Schubert   gdbarch_displaced_step_location_ftype *displaced_step_location;
254cf7f2e2dSJohn Marino   gdbarch_relocate_instruction_ftype *relocate_instruction;
2555796c8dcSSimon Schubert   gdbarch_overlay_update_ftype *overlay_update;
2565796c8dcSSimon Schubert   gdbarch_core_read_description_ftype *core_read_description;
2575796c8dcSSimon Schubert   gdbarch_static_transform_name_ftype *static_transform_name;
2585796c8dcSSimon Schubert   int sofun_address_maybe_missing;
2595796c8dcSSimon Schubert   gdbarch_process_record_ftype *process_record;
2605796c8dcSSimon Schubert   gdbarch_process_record_signal_ftype *process_record_signal;
2615796c8dcSSimon Schubert   gdbarch_target_signal_from_host_ftype *target_signal_from_host;
2625796c8dcSSimon Schubert   gdbarch_target_signal_to_host_ftype *target_signal_to_host;
2635796c8dcSSimon Schubert   gdbarch_get_siginfo_type_ftype *get_siginfo_type;
2645796c8dcSSimon Schubert   gdbarch_record_special_symbol_ftype *record_special_symbol;
2655796c8dcSSimon Schubert   gdbarch_get_syscall_number_ftype *get_syscall_number;
2665796c8dcSSimon Schubert   int has_global_solist;
2675796c8dcSSimon Schubert   int has_global_breakpoints;
268cf7f2e2dSJohn Marino   gdbarch_has_shared_address_space_ftype *has_shared_address_space;
269cf7f2e2dSJohn Marino   gdbarch_fast_tracepoint_valid_at_ftype *fast_tracepoint_valid_at;
270cf7f2e2dSJohn Marino   gdbarch_auto_charset_ftype *auto_charset;
271cf7f2e2dSJohn Marino   gdbarch_auto_wide_charset_ftype *auto_wide_charset;
272cf7f2e2dSJohn Marino   const char * solib_symbols_extension;
273cf7f2e2dSJohn Marino   int has_dos_based_file_system;
274*a45ae5f8SJohn Marino   gdbarch_gen_return_address_ftype *gen_return_address;
2755796c8dcSSimon Schubert };
2765796c8dcSSimon Schubert 
2775796c8dcSSimon Schubert 
2785796c8dcSSimon Schubert /* The default architecture uses host values (for want of a better
2795796c8dcSSimon Schubert    choice).  */
2805796c8dcSSimon Schubert 
2815796c8dcSSimon Schubert extern const struct bfd_arch_info bfd_default_arch_struct;
2825796c8dcSSimon Schubert 
2835796c8dcSSimon Schubert struct gdbarch startup_gdbarch =
2845796c8dcSSimon Schubert {
2855796c8dcSSimon Schubert   1, /* Always initialized.  */
2865796c8dcSSimon Schubert   NULL, /* The obstack.  */
287c50c785cSJohn Marino   /* basic architecture information.  */
2885796c8dcSSimon Schubert   &bfd_default_arch_struct,  /* bfd_arch_info */
2895796c8dcSSimon Schubert   BFD_ENDIAN_BIG,  /* byte_order */
2905796c8dcSSimon Schubert   BFD_ENDIAN_BIG,  /* byte_order_for_code */
2915796c8dcSSimon Schubert   GDB_OSABI_UNKNOWN,  /* osabi */
2925796c8dcSSimon Schubert   0,  /* target_desc */
293c50c785cSJohn Marino   /* target specific vector and its dump routine.  */
2945796c8dcSSimon Schubert   NULL, NULL,
295c50c785cSJohn Marino   /*per-architecture data-pointers and swap regions.  */
2965796c8dcSSimon Schubert   0, NULL, NULL,
2975796c8dcSSimon Schubert   /* Multi-arch values */
2985796c8dcSSimon Schubert   1,  /* bits_big_endian */
2995796c8dcSSimon Schubert   8 * sizeof (short),  /* short_bit */
3005796c8dcSSimon Schubert   8 * sizeof (int),  /* int_bit */
3015796c8dcSSimon Schubert   8 * sizeof (long),  /* long_bit */
3025796c8dcSSimon Schubert   8 * sizeof (LONGEST),  /* long_long_bit */
303*a45ae5f8SJohn Marino   8 * sizeof (LONGEST),  /* long_long_align_bit */
304cf7f2e2dSJohn Marino   16,  /* half_bit */
305cf7f2e2dSJohn Marino   0,  /* half_format */
3065796c8dcSSimon Schubert   8 * sizeof (float),  /* float_bit */
3075796c8dcSSimon Schubert   0,  /* float_format */
3085796c8dcSSimon Schubert   8 * sizeof (double),  /* double_bit */
3095796c8dcSSimon Schubert   0,  /* double_format */
3105796c8dcSSimon Schubert   8 * sizeof (long double),  /* long_double_bit */
3115796c8dcSSimon Schubert   0,  /* long_double_format */
3125796c8dcSSimon Schubert   8 * sizeof (void*),  /* ptr_bit */
3135796c8dcSSimon Schubert   8 * sizeof (void*),  /* addr_bit */
314c50c785cSJohn Marino   sizeof (void*),  /* dwarf2_addr_size */
3155796c8dcSSimon Schubert   1,  /* char_signed */
3165796c8dcSSimon Schubert   0,  /* read_pc */
3175796c8dcSSimon Schubert   0,  /* write_pc */
3185796c8dcSSimon Schubert   legacy_virtual_frame_pointer,  /* virtual_frame_pointer */
3195796c8dcSSimon Schubert   0,  /* pseudo_register_read */
320*a45ae5f8SJohn Marino   0,  /* pseudo_register_read_value */
3215796c8dcSSimon Schubert   0,  /* pseudo_register_write */
3225796c8dcSSimon Schubert   0,  /* num_regs */
3235796c8dcSSimon Schubert   0,  /* num_pseudo_regs */
324c50c785cSJohn Marino   0,  /* ax_pseudo_register_collect */
325c50c785cSJohn Marino   0,  /* ax_pseudo_register_push_stack */
3265796c8dcSSimon Schubert   -1,  /* sp_regnum */
3275796c8dcSSimon Schubert   -1,  /* pc_regnum */
3285796c8dcSSimon Schubert   -1,  /* ps_regnum */
3295796c8dcSSimon Schubert   0,  /* fp0_regnum */
3305796c8dcSSimon Schubert   no_op_reg_to_regnum,  /* stab_reg_to_regnum */
3315796c8dcSSimon Schubert   no_op_reg_to_regnum,  /* ecoff_reg_to_regnum */
3325796c8dcSSimon Schubert   no_op_reg_to_regnum,  /* sdb_reg_to_regnum */
3335796c8dcSSimon Schubert   no_op_reg_to_regnum,  /* dwarf2_reg_to_regnum */
3345796c8dcSSimon Schubert   0,  /* register_name */
3355796c8dcSSimon Schubert   0,  /* register_type */
3365796c8dcSSimon Schubert   0,  /* dummy_id */
3375796c8dcSSimon Schubert   -1,  /* deprecated_fp_regnum */
3385796c8dcSSimon Schubert   0,  /* push_dummy_call */
3395796c8dcSSimon Schubert   0,  /* call_dummy_location */
3405796c8dcSSimon Schubert   0,  /* push_dummy_code */
3415796c8dcSSimon Schubert   default_print_registers_info,  /* print_registers_info */
3425796c8dcSSimon Schubert   0,  /* print_float_info */
3435796c8dcSSimon Schubert   0,  /* print_vector_info */
3445796c8dcSSimon Schubert   legacy_register_sim_regno,  /* register_sim_regno */
3455796c8dcSSimon Schubert   cannot_register_not,  /* cannot_fetch_register */
3465796c8dcSSimon Schubert   cannot_register_not,  /* cannot_store_register */
3475796c8dcSSimon Schubert   0,  /* get_longjmp_target */
3485796c8dcSSimon Schubert   0,  /* believe_pcc_promotion */
3495796c8dcSSimon Schubert   generic_convert_register_p,  /* convert_register_p */
3505796c8dcSSimon Schubert   0,  /* register_to_value */
3515796c8dcSSimon Schubert   0,  /* value_to_register */
3525796c8dcSSimon Schubert   0,  /* value_from_register */
3535796c8dcSSimon Schubert   unsigned_pointer_to_address,  /* pointer_to_address */
3545796c8dcSSimon Schubert   unsigned_address_to_pointer,  /* address_to_pointer */
3555796c8dcSSimon Schubert   0,  /* integer_to_address */
3565796c8dcSSimon Schubert   0,  /* return_value */
3575796c8dcSSimon Schubert   0,  /* skip_prologue */
3585796c8dcSSimon Schubert   0,  /* skip_main_prologue */
3595796c8dcSSimon Schubert   0,  /* inner_than */
3605796c8dcSSimon Schubert   0,  /* breakpoint_from_pc */
361cf7f2e2dSJohn Marino   default_remote_breakpoint_from_pc,  /* remote_breakpoint_from_pc */
3625796c8dcSSimon Schubert   0,  /* adjust_breakpoint_address */
3635796c8dcSSimon Schubert   default_memory_insert_breakpoint,  /* memory_insert_breakpoint */
3645796c8dcSSimon Schubert   default_memory_remove_breakpoint,  /* memory_remove_breakpoint */
3655796c8dcSSimon Schubert   0,  /* decr_pc_after_break */
3665796c8dcSSimon Schubert   0,  /* deprecated_function_start_offset */
3675796c8dcSSimon Schubert   default_remote_register_number,  /* remote_register_number */
3685796c8dcSSimon Schubert   0,  /* fetch_tls_load_module_address */
3695796c8dcSSimon Schubert   0,  /* frame_args_skip */
3705796c8dcSSimon Schubert   0,  /* unwind_pc */
3715796c8dcSSimon Schubert   0,  /* unwind_sp */
3725796c8dcSSimon Schubert   0,  /* frame_num_args */
3735796c8dcSSimon Schubert   0,  /* frame_align */
3745796c8dcSSimon Schubert   default_stabs_argument_has_addr,  /* stabs_argument_has_addr */
3755796c8dcSSimon Schubert   0,  /* frame_red_zone_size */
3765796c8dcSSimon Schubert   convert_from_func_ptr_addr_identity,  /* convert_from_func_ptr_addr */
3775796c8dcSSimon Schubert   core_addr_identity,  /* addr_bits_remove */
3785796c8dcSSimon Schubert   core_addr_identity,  /* smash_text_address */
3795796c8dcSSimon Schubert   0,  /* software_single_step */
3805796c8dcSSimon Schubert   0,  /* single_step_through_delay */
3815796c8dcSSimon Schubert   0,  /* print_insn */
3825796c8dcSSimon Schubert   0,  /* skip_trampoline_code */
3835796c8dcSSimon Schubert   generic_skip_solib_resolver,  /* skip_solib_resolver */
3845796c8dcSSimon Schubert   generic_in_solib_return_trampoline,  /* in_solib_return_trampoline */
3855796c8dcSSimon Schubert   generic_in_function_epilogue_p,  /* in_function_epilogue_p */
3865796c8dcSSimon Schubert   0,  /* elf_make_msymbol_special */
3875796c8dcSSimon Schubert   0,  /* coff_make_msymbol_special */
3885796c8dcSSimon Schubert   0,  /* cannot_step_breakpoint */
3895796c8dcSSimon Schubert   0,  /* have_nonsteppable_watchpoint */
3905796c8dcSSimon Schubert   0,  /* address_class_type_flags */
3915796c8dcSSimon Schubert   0,  /* address_class_type_flags_to_name */
3925796c8dcSSimon Schubert   0,  /* address_class_name_to_type_flags */
3935796c8dcSSimon Schubert   default_register_reggroup_p,  /* register_reggroup_p */
3945796c8dcSSimon Schubert   0,  /* fetch_pointer_argument */
3955796c8dcSSimon Schubert   0,  /* regset_from_core_section */
3965796c8dcSSimon Schubert   0,  /* core_regset_sections */
3975796c8dcSSimon Schubert   0,  /* core_xfer_shared_libraries */
3985796c8dcSSimon Schubert   0,  /* core_pid_to_str */
3995796c8dcSSimon Schubert   0,  /* gcore_bfd_target */
4005796c8dcSSimon Schubert   0,  /* vtable_function_descriptors */
4015796c8dcSSimon Schubert   0,  /* vbit_in_delta */
4025796c8dcSSimon Schubert   0,  /* skip_permanent_breakpoint */
4035796c8dcSSimon Schubert   0,  /* max_insn_length */
4045796c8dcSSimon Schubert   0,  /* displaced_step_copy_insn */
4055796c8dcSSimon Schubert   default_displaced_step_hw_singlestep,  /* displaced_step_hw_singlestep */
4065796c8dcSSimon Schubert   0,  /* displaced_step_fixup */
4075796c8dcSSimon Schubert   NULL,  /* displaced_step_free_closure */
4085796c8dcSSimon Schubert   NULL,  /* displaced_step_location */
409cf7f2e2dSJohn Marino   0,  /* relocate_instruction */
4105796c8dcSSimon Schubert   0,  /* overlay_update */
4115796c8dcSSimon Schubert   0,  /* core_read_description */
4125796c8dcSSimon Schubert   0,  /* static_transform_name */
4135796c8dcSSimon Schubert   0,  /* sofun_address_maybe_missing */
4145796c8dcSSimon Schubert   0,  /* process_record */
4155796c8dcSSimon Schubert   0,  /* process_record_signal */
4165796c8dcSSimon Schubert   default_target_signal_from_host,  /* target_signal_from_host */
4175796c8dcSSimon Schubert   default_target_signal_to_host,  /* target_signal_to_host */
4185796c8dcSSimon Schubert   0,  /* get_siginfo_type */
4195796c8dcSSimon Schubert   0,  /* record_special_symbol */
4205796c8dcSSimon Schubert   0,  /* get_syscall_number */
4215796c8dcSSimon Schubert   0,  /* has_global_solist */
4225796c8dcSSimon Schubert   0,  /* has_global_breakpoints */
423cf7f2e2dSJohn Marino   default_has_shared_address_space,  /* has_shared_address_space */
424cf7f2e2dSJohn Marino   default_fast_tracepoint_valid_at,  /* fast_tracepoint_valid_at */
425cf7f2e2dSJohn Marino   default_auto_charset,  /* auto_charset */
426cf7f2e2dSJohn Marino   default_auto_wide_charset,  /* auto_wide_charset */
427cf7f2e2dSJohn Marino   0,  /* solib_symbols_extension */
428cf7f2e2dSJohn Marino   0,  /* has_dos_based_file_system */
429*a45ae5f8SJohn Marino   default_gen_return_address,  /* gen_return_address */
4305796c8dcSSimon Schubert   /* startup_gdbarch() */
4315796c8dcSSimon Schubert };
4325796c8dcSSimon Schubert 
4335796c8dcSSimon Schubert struct gdbarch *target_gdbarch = &startup_gdbarch;
4345796c8dcSSimon Schubert 
4355796c8dcSSimon Schubert /* Create a new ``struct gdbarch'' based on information provided by
4365796c8dcSSimon Schubert    ``struct gdbarch_info''.  */
4375796c8dcSSimon Schubert 
4385796c8dcSSimon Schubert struct gdbarch *
4395796c8dcSSimon Schubert gdbarch_alloc (const struct gdbarch_info *info,
4405796c8dcSSimon Schubert                struct gdbarch_tdep *tdep)
4415796c8dcSSimon Schubert {
4425796c8dcSSimon Schubert   struct gdbarch *gdbarch;
4435796c8dcSSimon Schubert 
4445796c8dcSSimon Schubert   /* Create an obstack for allocating all the per-architecture memory,
4455796c8dcSSimon Schubert      then use that to allocate the architecture vector.  */
4465796c8dcSSimon Schubert   struct obstack *obstack = XMALLOC (struct obstack);
4475796c8dcSSimon Schubert   obstack_init (obstack);
4485796c8dcSSimon Schubert   gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
4495796c8dcSSimon Schubert   memset (gdbarch, 0, sizeof (*gdbarch));
4505796c8dcSSimon Schubert   gdbarch->obstack = obstack;
4515796c8dcSSimon Schubert 
4525796c8dcSSimon Schubert   alloc_gdbarch_data (gdbarch);
4535796c8dcSSimon Schubert 
4545796c8dcSSimon Schubert   gdbarch->tdep = tdep;
4555796c8dcSSimon Schubert 
4565796c8dcSSimon Schubert   gdbarch->bfd_arch_info = info->bfd_arch_info;
4575796c8dcSSimon Schubert   gdbarch->byte_order = info->byte_order;
4585796c8dcSSimon Schubert   gdbarch->byte_order_for_code = info->byte_order_for_code;
4595796c8dcSSimon Schubert   gdbarch->osabi = info->osabi;
4605796c8dcSSimon Schubert   gdbarch->target_desc = info->target_desc;
4615796c8dcSSimon Schubert 
4625796c8dcSSimon Schubert   /* Force the explicit initialization of these.  */
4635796c8dcSSimon Schubert   gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
4645796c8dcSSimon Schubert   gdbarch->short_bit = 2*TARGET_CHAR_BIT;
4655796c8dcSSimon Schubert   gdbarch->int_bit = 4*TARGET_CHAR_BIT;
4665796c8dcSSimon Schubert   gdbarch->long_bit = 4*TARGET_CHAR_BIT;
4675796c8dcSSimon Schubert   gdbarch->long_long_bit = 2*gdbarch->long_bit;
468*a45ae5f8SJohn Marino   gdbarch->long_long_align_bit = 2*gdbarch->long_bit;
469cf7f2e2dSJohn Marino   gdbarch->half_bit = 2*TARGET_CHAR_BIT;
4705796c8dcSSimon Schubert   gdbarch->float_bit = 4*TARGET_CHAR_BIT;
4715796c8dcSSimon Schubert   gdbarch->double_bit = 8*TARGET_CHAR_BIT;
4725796c8dcSSimon Schubert   gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
4735796c8dcSSimon Schubert   gdbarch->ptr_bit = gdbarch->int_bit;
4745796c8dcSSimon Schubert   gdbarch->char_signed = -1;
4755796c8dcSSimon Schubert   gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
4765796c8dcSSimon Schubert   gdbarch->num_regs = -1;
4775796c8dcSSimon Schubert   gdbarch->sp_regnum = -1;
4785796c8dcSSimon Schubert   gdbarch->pc_regnum = -1;
4795796c8dcSSimon Schubert   gdbarch->ps_regnum = -1;
4805796c8dcSSimon Schubert   gdbarch->fp0_regnum = -1;
4815796c8dcSSimon Schubert   gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
4825796c8dcSSimon Schubert   gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
4835796c8dcSSimon Schubert   gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
4845796c8dcSSimon Schubert   gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
4855796c8dcSSimon Schubert   gdbarch->deprecated_fp_regnum = -1;
4865796c8dcSSimon Schubert   gdbarch->call_dummy_location = AT_ENTRY_POINT;
4875796c8dcSSimon Schubert   gdbarch->print_registers_info = default_print_registers_info;
4885796c8dcSSimon Schubert   gdbarch->register_sim_regno = legacy_register_sim_regno;
4895796c8dcSSimon Schubert   gdbarch->cannot_fetch_register = cannot_register_not;
4905796c8dcSSimon Schubert   gdbarch->cannot_store_register = cannot_register_not;
4915796c8dcSSimon Schubert   gdbarch->convert_register_p = generic_convert_register_p;
4925796c8dcSSimon Schubert   gdbarch->value_from_register = default_value_from_register;
4935796c8dcSSimon Schubert   gdbarch->pointer_to_address = unsigned_pointer_to_address;
4945796c8dcSSimon Schubert   gdbarch->address_to_pointer = unsigned_address_to_pointer;
495cf7f2e2dSJohn Marino   gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
4965796c8dcSSimon Schubert   gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
4975796c8dcSSimon Schubert   gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
4985796c8dcSSimon Schubert   gdbarch->remote_register_number = default_remote_register_number;
4995796c8dcSSimon Schubert   gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
5005796c8dcSSimon Schubert   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
5015796c8dcSSimon Schubert   gdbarch->addr_bits_remove = core_addr_identity;
5025796c8dcSSimon Schubert   gdbarch->smash_text_address = core_addr_identity;
5035796c8dcSSimon Schubert   gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
5045796c8dcSSimon Schubert   gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
5055796c8dcSSimon Schubert   gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
5065796c8dcSSimon Schubert   gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
5075796c8dcSSimon Schubert   gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
5085796c8dcSSimon Schubert   gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
5095796c8dcSSimon Schubert   gdbarch->register_reggroup_p = default_register_reggroup_p;
5105796c8dcSSimon Schubert   gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
5115796c8dcSSimon Schubert   gdbarch->displaced_step_fixup = NULL;
5125796c8dcSSimon Schubert   gdbarch->displaced_step_free_closure = NULL;
5135796c8dcSSimon Schubert   gdbarch->displaced_step_location = NULL;
514cf7f2e2dSJohn Marino   gdbarch->relocate_instruction = NULL;
5155796c8dcSSimon Schubert   gdbarch->target_signal_from_host = default_target_signal_from_host;
5165796c8dcSSimon Schubert   gdbarch->target_signal_to_host = default_target_signal_to_host;
517cf7f2e2dSJohn Marino   gdbarch->has_shared_address_space = default_has_shared_address_space;
518cf7f2e2dSJohn Marino   gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
519cf7f2e2dSJohn Marino   gdbarch->auto_charset = default_auto_charset;
520cf7f2e2dSJohn Marino   gdbarch->auto_wide_charset = default_auto_wide_charset;
521*a45ae5f8SJohn Marino   gdbarch->gen_return_address = default_gen_return_address;
5225796c8dcSSimon Schubert   /* gdbarch_alloc() */
5235796c8dcSSimon Schubert 
5245796c8dcSSimon Schubert   return gdbarch;
5255796c8dcSSimon Schubert }
5265796c8dcSSimon Schubert 
5275796c8dcSSimon Schubert 
5285796c8dcSSimon Schubert /* Allocate extra space using the per-architecture obstack.  */
5295796c8dcSSimon Schubert 
5305796c8dcSSimon Schubert void *
5315796c8dcSSimon Schubert gdbarch_obstack_zalloc (struct gdbarch *arch, long size)
5325796c8dcSSimon Schubert {
5335796c8dcSSimon Schubert   void *data = obstack_alloc (arch->obstack, size);
534cf7f2e2dSJohn Marino 
5355796c8dcSSimon Schubert   memset (data, 0, size);
5365796c8dcSSimon Schubert   return data;
5375796c8dcSSimon Schubert }
5385796c8dcSSimon Schubert 
5395796c8dcSSimon Schubert 
5405796c8dcSSimon Schubert /* Free a gdbarch struct.  This should never happen in normal
5415796c8dcSSimon Schubert    operation --- once you've created a gdbarch, you keep it around.
5425796c8dcSSimon Schubert    However, if an architecture's init function encounters an error
5435796c8dcSSimon Schubert    building the structure, it may need to clean up a partially
5445796c8dcSSimon Schubert    constructed gdbarch.  */
5455796c8dcSSimon Schubert 
5465796c8dcSSimon Schubert void
5475796c8dcSSimon Schubert gdbarch_free (struct gdbarch *arch)
5485796c8dcSSimon Schubert {
5495796c8dcSSimon Schubert   struct obstack *obstack;
550cf7f2e2dSJohn Marino 
5515796c8dcSSimon Schubert   gdb_assert (arch != NULL);
5525796c8dcSSimon Schubert   gdb_assert (!arch->initialized_p);
5535796c8dcSSimon Schubert   obstack = arch->obstack;
5545796c8dcSSimon Schubert   obstack_free (obstack, 0); /* Includes the ARCH.  */
5555796c8dcSSimon Schubert   xfree (obstack);
5565796c8dcSSimon Schubert }
5575796c8dcSSimon Schubert 
5585796c8dcSSimon Schubert 
5595796c8dcSSimon Schubert /* Ensure that all values in a GDBARCH are reasonable.  */
5605796c8dcSSimon Schubert 
5615796c8dcSSimon Schubert static void
5625796c8dcSSimon Schubert verify_gdbarch (struct gdbarch *gdbarch)
5635796c8dcSSimon Schubert {
5645796c8dcSSimon Schubert   struct ui_file *log;
5655796c8dcSSimon Schubert   struct cleanup *cleanups;
5665796c8dcSSimon Schubert   long length;
5675796c8dcSSimon Schubert   char *buf;
568cf7f2e2dSJohn Marino 
5695796c8dcSSimon Schubert   log = mem_fileopen ();
5705796c8dcSSimon Schubert   cleanups = make_cleanup_ui_file_delete (log);
5715796c8dcSSimon Schubert   /* fundamental */
5725796c8dcSSimon Schubert   if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
5735796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tbyte-order");
5745796c8dcSSimon Schubert   if (gdbarch->bfd_arch_info == NULL)
5755796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tbfd_arch_info");
5765796c8dcSSimon Schubert   /* Check those that need to be defined for the given multi-arch level.  */
5775796c8dcSSimon Schubert   /* Skip verify of bits_big_endian, invalid_p == 0 */
5785796c8dcSSimon Schubert   /* Skip verify of short_bit, invalid_p == 0 */
5795796c8dcSSimon Schubert   /* Skip verify of int_bit, invalid_p == 0 */
5805796c8dcSSimon Schubert   /* Skip verify of long_bit, invalid_p == 0 */
5815796c8dcSSimon Schubert   /* Skip verify of long_long_bit, invalid_p == 0 */
582*a45ae5f8SJohn Marino   /* Skip verify of long_long_align_bit, invalid_p == 0 */
583cf7f2e2dSJohn Marino   /* Skip verify of half_bit, invalid_p == 0 */
584cf7f2e2dSJohn Marino   if (gdbarch->half_format == 0)
585cf7f2e2dSJohn Marino     gdbarch->half_format = floatformats_ieee_half;
5865796c8dcSSimon Schubert   /* Skip verify of float_bit, invalid_p == 0 */
5875796c8dcSSimon Schubert   if (gdbarch->float_format == 0)
5885796c8dcSSimon Schubert     gdbarch->float_format = floatformats_ieee_single;
5895796c8dcSSimon Schubert   /* Skip verify of double_bit, invalid_p == 0 */
5905796c8dcSSimon Schubert   if (gdbarch->double_format == 0)
5915796c8dcSSimon Schubert     gdbarch->double_format = floatformats_ieee_double;
5925796c8dcSSimon Schubert   /* Skip verify of long_double_bit, invalid_p == 0 */
5935796c8dcSSimon Schubert   if (gdbarch->long_double_format == 0)
5945796c8dcSSimon Schubert     gdbarch->long_double_format = floatformats_ieee_double;
5955796c8dcSSimon Schubert   /* Skip verify of ptr_bit, invalid_p == 0 */
5965796c8dcSSimon Schubert   if (gdbarch->addr_bit == 0)
5975796c8dcSSimon Schubert     gdbarch->addr_bit = gdbarch_ptr_bit (gdbarch);
598c50c785cSJohn Marino   if (gdbarch->dwarf2_addr_size == 0)
599c50c785cSJohn Marino     gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
6005796c8dcSSimon Schubert   if (gdbarch->char_signed == -1)
6015796c8dcSSimon Schubert     gdbarch->char_signed = 1;
602c50c785cSJohn Marino   /* Skip verify of read_pc, has predicate.  */
603c50c785cSJohn Marino   /* Skip verify of write_pc, has predicate.  */
6045796c8dcSSimon Schubert   /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
605c50c785cSJohn Marino   /* Skip verify of pseudo_register_read, has predicate.  */
606*a45ae5f8SJohn Marino   /* Skip verify of pseudo_register_read_value, has predicate.  */
607c50c785cSJohn Marino   /* Skip verify of pseudo_register_write, has predicate.  */
6085796c8dcSSimon Schubert   if (gdbarch->num_regs == -1)
6095796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tnum_regs");
6105796c8dcSSimon Schubert   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
611c50c785cSJohn Marino   /* Skip verify of ax_pseudo_register_collect, has predicate.  */
612c50c785cSJohn Marino   /* Skip verify of ax_pseudo_register_push_stack, has predicate.  */
6135796c8dcSSimon Schubert   /* Skip verify of sp_regnum, invalid_p == 0 */
6145796c8dcSSimon Schubert   /* Skip verify of pc_regnum, invalid_p == 0 */
6155796c8dcSSimon Schubert   /* Skip verify of ps_regnum, invalid_p == 0 */
6165796c8dcSSimon Schubert   /* Skip verify of fp0_regnum, invalid_p == 0 */
6175796c8dcSSimon Schubert   /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
6185796c8dcSSimon Schubert   /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
6195796c8dcSSimon Schubert   /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
6205796c8dcSSimon Schubert   /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
6215796c8dcSSimon Schubert   if (gdbarch->register_name == 0)
6225796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tregister_name");
623c50c785cSJohn Marino   /* Skip verify of register_type, has predicate.  */
624c50c785cSJohn Marino   /* Skip verify of dummy_id, has predicate.  */
6255796c8dcSSimon Schubert   /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
626c50c785cSJohn Marino   /* Skip verify of push_dummy_call, has predicate.  */
6275796c8dcSSimon Schubert   /* Skip verify of call_dummy_location, invalid_p == 0 */
628c50c785cSJohn Marino   /* Skip verify of push_dummy_code, has predicate.  */
6295796c8dcSSimon Schubert   /* Skip verify of print_registers_info, invalid_p == 0 */
630c50c785cSJohn Marino   /* Skip verify of print_float_info, has predicate.  */
631c50c785cSJohn Marino   /* Skip verify of print_vector_info, has predicate.  */
6325796c8dcSSimon Schubert   /* Skip verify of register_sim_regno, invalid_p == 0 */
6335796c8dcSSimon Schubert   /* Skip verify of cannot_fetch_register, invalid_p == 0 */
6345796c8dcSSimon Schubert   /* Skip verify of cannot_store_register, invalid_p == 0 */
635c50c785cSJohn Marino   /* Skip verify of get_longjmp_target, has predicate.  */
6365796c8dcSSimon Schubert   /* Skip verify of convert_register_p, invalid_p == 0 */
6375796c8dcSSimon Schubert   /* Skip verify of value_from_register, invalid_p == 0 */
6385796c8dcSSimon Schubert   /* Skip verify of pointer_to_address, invalid_p == 0 */
6395796c8dcSSimon Schubert   /* Skip verify of address_to_pointer, invalid_p == 0 */
640c50c785cSJohn Marino   /* Skip verify of integer_to_address, has predicate.  */
641c50c785cSJohn Marino   /* Skip verify of return_value, has predicate.  */
6425796c8dcSSimon Schubert   if (gdbarch->skip_prologue == 0)
6435796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tskip_prologue");
644c50c785cSJohn Marino   /* Skip verify of skip_main_prologue, has predicate.  */
6455796c8dcSSimon Schubert   if (gdbarch->inner_than == 0)
6465796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tinner_than");
6475796c8dcSSimon Schubert   if (gdbarch->breakpoint_from_pc == 0)
6485796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
649cf7f2e2dSJohn Marino   /* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
650c50c785cSJohn Marino   /* Skip verify of adjust_breakpoint_address, has predicate.  */
6515796c8dcSSimon Schubert   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
6525796c8dcSSimon Schubert   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
6535796c8dcSSimon Schubert   /* Skip verify of decr_pc_after_break, invalid_p == 0 */
6545796c8dcSSimon Schubert   /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
6555796c8dcSSimon Schubert   /* Skip verify of remote_register_number, invalid_p == 0 */
656c50c785cSJohn Marino   /* Skip verify of fetch_tls_load_module_address, has predicate.  */
6575796c8dcSSimon Schubert   /* Skip verify of frame_args_skip, invalid_p == 0 */
658c50c785cSJohn Marino   /* Skip verify of unwind_pc, has predicate.  */
659c50c785cSJohn Marino   /* Skip verify of unwind_sp, has predicate.  */
660c50c785cSJohn Marino   /* Skip verify of frame_num_args, has predicate.  */
661c50c785cSJohn Marino   /* Skip verify of frame_align, has predicate.  */
6625796c8dcSSimon Schubert   /* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
6635796c8dcSSimon Schubert   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
6645796c8dcSSimon Schubert   /* Skip verify of addr_bits_remove, invalid_p == 0 */
6655796c8dcSSimon Schubert   /* Skip verify of smash_text_address, invalid_p == 0 */
666c50c785cSJohn Marino   /* Skip verify of software_single_step, has predicate.  */
667c50c785cSJohn Marino   /* Skip verify of single_step_through_delay, has predicate.  */
6685796c8dcSSimon Schubert   if (gdbarch->print_insn == 0)
6695796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tprint_insn");
6705796c8dcSSimon Schubert   /* Skip verify of skip_trampoline_code, invalid_p == 0 */
6715796c8dcSSimon Schubert   /* Skip verify of skip_solib_resolver, invalid_p == 0 */
6725796c8dcSSimon Schubert   /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
6735796c8dcSSimon Schubert   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
6745796c8dcSSimon Schubert   /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
6755796c8dcSSimon Schubert   /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
6765796c8dcSSimon Schubert   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
6775796c8dcSSimon Schubert   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
678c50c785cSJohn Marino   /* Skip verify of address_class_type_flags, has predicate.  */
679c50c785cSJohn Marino   /* Skip verify of address_class_type_flags_to_name, has predicate.  */
680c50c785cSJohn Marino   /* Skip verify of address_class_name_to_type_flags, has predicate.  */
6815796c8dcSSimon Schubert   /* Skip verify of register_reggroup_p, invalid_p == 0 */
682c50c785cSJohn Marino   /* Skip verify of fetch_pointer_argument, has predicate.  */
683c50c785cSJohn Marino   /* Skip verify of regset_from_core_section, has predicate.  */
684c50c785cSJohn Marino   /* Skip verify of core_xfer_shared_libraries, has predicate.  */
685c50c785cSJohn Marino   /* Skip verify of core_pid_to_str, has predicate.  */
686c50c785cSJohn Marino   /* Skip verify of gcore_bfd_target, has predicate.  */
6875796c8dcSSimon Schubert   /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
6885796c8dcSSimon Schubert   /* Skip verify of vbit_in_delta, invalid_p == 0 */
689c50c785cSJohn Marino   /* Skip verify of skip_permanent_breakpoint, has predicate.  */
690c50c785cSJohn Marino   /* Skip verify of max_insn_length, has predicate.  */
691c50c785cSJohn Marino   /* Skip verify of displaced_step_copy_insn, has predicate.  */
6925796c8dcSSimon Schubert   /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
693c50c785cSJohn Marino   /* Skip verify of displaced_step_fixup, has predicate.  */
6945796c8dcSSimon Schubert   if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
6955796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
6965796c8dcSSimon Schubert   if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
6975796c8dcSSimon Schubert     fprintf_unfiltered (log, "\n\tdisplaced_step_location");
698c50c785cSJohn Marino   /* Skip verify of relocate_instruction, has predicate.  */
699c50c785cSJohn Marino   /* Skip verify of overlay_update, has predicate.  */
700c50c785cSJohn Marino   /* Skip verify of core_read_description, has predicate.  */
701c50c785cSJohn Marino   /* Skip verify of static_transform_name, has predicate.  */
7025796c8dcSSimon Schubert   /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
703c50c785cSJohn Marino   /* Skip verify of process_record, has predicate.  */
704c50c785cSJohn Marino   /* Skip verify of process_record_signal, has predicate.  */
7055796c8dcSSimon Schubert   /* Skip verify of target_signal_from_host, invalid_p == 0 */
7065796c8dcSSimon Schubert   /* Skip verify of target_signal_to_host, invalid_p == 0 */
707c50c785cSJohn Marino   /* Skip verify of get_siginfo_type, has predicate.  */
708c50c785cSJohn Marino   /* Skip verify of record_special_symbol, has predicate.  */
709c50c785cSJohn Marino   /* Skip verify of get_syscall_number, has predicate.  */
7105796c8dcSSimon Schubert   /* Skip verify of has_global_solist, invalid_p == 0 */
7115796c8dcSSimon Schubert   /* Skip verify of has_global_breakpoints, invalid_p == 0 */
712cf7f2e2dSJohn Marino   /* Skip verify of has_shared_address_space, invalid_p == 0 */
713cf7f2e2dSJohn Marino   /* Skip verify of fast_tracepoint_valid_at, invalid_p == 0 */
714cf7f2e2dSJohn Marino   /* Skip verify of auto_charset, invalid_p == 0 */
715cf7f2e2dSJohn Marino   /* Skip verify of auto_wide_charset, invalid_p == 0 */
716cf7f2e2dSJohn Marino   /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
717*a45ae5f8SJohn Marino   /* Skip verify of gen_return_address, invalid_p == 0 */
7185796c8dcSSimon Schubert   buf = ui_file_xstrdup (log, &length);
7195796c8dcSSimon Schubert   make_cleanup (xfree, buf);
7205796c8dcSSimon Schubert   if (length > 0)
7215796c8dcSSimon Schubert     internal_error (__FILE__, __LINE__,
7225796c8dcSSimon Schubert                     _("verify_gdbarch: the following are invalid ...%s"),
7235796c8dcSSimon Schubert                     buf);
7245796c8dcSSimon Schubert   do_cleanups (cleanups);
7255796c8dcSSimon Schubert }
7265796c8dcSSimon Schubert 
7275796c8dcSSimon Schubert 
7285796c8dcSSimon Schubert /* Print out the details of the current architecture.  */
7295796c8dcSSimon Schubert 
7305796c8dcSSimon Schubert void
7315796c8dcSSimon Schubert gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
7325796c8dcSSimon Schubert {
7335796c8dcSSimon Schubert   const char *gdb_nm_file = "<not-defined>";
734cf7f2e2dSJohn Marino 
7355796c8dcSSimon Schubert #if defined (GDB_NM_FILE)
7365796c8dcSSimon Schubert   gdb_nm_file = GDB_NM_FILE;
7375796c8dcSSimon Schubert #endif
7385796c8dcSSimon Schubert   fprintf_unfiltered (file,
7395796c8dcSSimon Schubert                       "gdbarch_dump: GDB_NM_FILE = %s\n",
7405796c8dcSSimon Schubert                       gdb_nm_file);
7415796c8dcSSimon Schubert   fprintf_unfiltered (file,
7425796c8dcSSimon Schubert                       "gdbarch_dump: addr_bit = %s\n",
7435796c8dcSSimon Schubert                       plongest (gdbarch->addr_bit));
7445796c8dcSSimon Schubert   fprintf_unfiltered (file,
7455796c8dcSSimon Schubert                       "gdbarch_dump: addr_bits_remove = <%s>\n",
7465796c8dcSSimon Schubert                       host_address_to_string (gdbarch->addr_bits_remove));
7475796c8dcSSimon Schubert   fprintf_unfiltered (file,
7485796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
7495796c8dcSSimon Schubert                       gdbarch_address_class_name_to_type_flags_p (gdbarch));
7505796c8dcSSimon Schubert   fprintf_unfiltered (file,
7515796c8dcSSimon Schubert                       "gdbarch_dump: address_class_name_to_type_flags = <%s>\n",
7525796c8dcSSimon Schubert                       host_address_to_string (gdbarch->address_class_name_to_type_flags));
7535796c8dcSSimon Schubert   fprintf_unfiltered (file,
7545796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
7555796c8dcSSimon Schubert                       gdbarch_address_class_type_flags_p (gdbarch));
7565796c8dcSSimon Schubert   fprintf_unfiltered (file,
7575796c8dcSSimon Schubert                       "gdbarch_dump: address_class_type_flags = <%s>\n",
7585796c8dcSSimon Schubert                       host_address_to_string (gdbarch->address_class_type_flags));
7595796c8dcSSimon Schubert   fprintf_unfiltered (file,
7605796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
7615796c8dcSSimon Schubert                       gdbarch_address_class_type_flags_to_name_p (gdbarch));
7625796c8dcSSimon Schubert   fprintf_unfiltered (file,
7635796c8dcSSimon Schubert                       "gdbarch_dump: address_class_type_flags_to_name = <%s>\n",
7645796c8dcSSimon Schubert                       host_address_to_string (gdbarch->address_class_type_flags_to_name));
7655796c8dcSSimon Schubert   fprintf_unfiltered (file,
7665796c8dcSSimon Schubert                       "gdbarch_dump: address_to_pointer = <%s>\n",
7675796c8dcSSimon Schubert                       host_address_to_string (gdbarch->address_to_pointer));
7685796c8dcSSimon Schubert   fprintf_unfiltered (file,
7695796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
7705796c8dcSSimon Schubert                       gdbarch_adjust_breakpoint_address_p (gdbarch));
7715796c8dcSSimon Schubert   fprintf_unfiltered (file,
7725796c8dcSSimon Schubert                       "gdbarch_dump: adjust_breakpoint_address = <%s>\n",
7735796c8dcSSimon Schubert                       host_address_to_string (gdbarch->adjust_breakpoint_address));
7745796c8dcSSimon Schubert   fprintf_unfiltered (file,
775cf7f2e2dSJohn Marino                       "gdbarch_dump: auto_charset = <%s>\n",
776cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->auto_charset));
777cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
778cf7f2e2dSJohn Marino                       "gdbarch_dump: auto_wide_charset = <%s>\n",
779cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->auto_wide_charset));
780cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
781c50c785cSJohn Marino                       "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
782c50c785cSJohn Marino                       gdbarch_ax_pseudo_register_collect_p (gdbarch));
783c50c785cSJohn Marino   fprintf_unfiltered (file,
784c50c785cSJohn Marino                       "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
785c50c785cSJohn Marino                       host_address_to_string (gdbarch->ax_pseudo_register_collect));
786c50c785cSJohn Marino   fprintf_unfiltered (file,
787c50c785cSJohn Marino                       "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
788c50c785cSJohn Marino                       gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
789c50c785cSJohn Marino   fprintf_unfiltered (file,
790c50c785cSJohn Marino                       "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
791c50c785cSJohn Marino                       host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
792c50c785cSJohn Marino   fprintf_unfiltered (file,
7935796c8dcSSimon Schubert                       "gdbarch_dump: believe_pcc_promotion = %s\n",
7945796c8dcSSimon Schubert                       plongest (gdbarch->believe_pcc_promotion));
7955796c8dcSSimon Schubert   fprintf_unfiltered (file,
7965796c8dcSSimon Schubert                       "gdbarch_dump: bfd_arch_info = %s\n",
7975796c8dcSSimon Schubert                       gdbarch_bfd_arch_info (gdbarch)->printable_name);
7985796c8dcSSimon Schubert   fprintf_unfiltered (file,
7995796c8dcSSimon Schubert                       "gdbarch_dump: bits_big_endian = %s\n",
8005796c8dcSSimon Schubert                       plongest (gdbarch->bits_big_endian));
8015796c8dcSSimon Schubert   fprintf_unfiltered (file,
8025796c8dcSSimon Schubert                       "gdbarch_dump: breakpoint_from_pc = <%s>\n",
8035796c8dcSSimon Schubert                       host_address_to_string (gdbarch->breakpoint_from_pc));
8045796c8dcSSimon Schubert   fprintf_unfiltered (file,
8055796c8dcSSimon Schubert                       "gdbarch_dump: byte_order = %s\n",
8065796c8dcSSimon Schubert                       plongest (gdbarch->byte_order));
8075796c8dcSSimon Schubert   fprintf_unfiltered (file,
8085796c8dcSSimon Schubert                       "gdbarch_dump: byte_order_for_code = %s\n",
8095796c8dcSSimon Schubert                       plongest (gdbarch->byte_order_for_code));
8105796c8dcSSimon Schubert   fprintf_unfiltered (file,
8115796c8dcSSimon Schubert                       "gdbarch_dump: call_dummy_location = %s\n",
8125796c8dcSSimon Schubert                       plongest (gdbarch->call_dummy_location));
8135796c8dcSSimon Schubert   fprintf_unfiltered (file,
8145796c8dcSSimon Schubert                       "gdbarch_dump: cannot_fetch_register = <%s>\n",
8155796c8dcSSimon Schubert                       host_address_to_string (gdbarch->cannot_fetch_register));
8165796c8dcSSimon Schubert   fprintf_unfiltered (file,
8175796c8dcSSimon Schubert                       "gdbarch_dump: cannot_step_breakpoint = %s\n",
8185796c8dcSSimon Schubert                       plongest (gdbarch->cannot_step_breakpoint));
8195796c8dcSSimon Schubert   fprintf_unfiltered (file,
8205796c8dcSSimon Schubert                       "gdbarch_dump: cannot_store_register = <%s>\n",
8215796c8dcSSimon Schubert                       host_address_to_string (gdbarch->cannot_store_register));
8225796c8dcSSimon Schubert   fprintf_unfiltered (file,
8235796c8dcSSimon Schubert                       "gdbarch_dump: char_signed = %s\n",
8245796c8dcSSimon Schubert                       plongest (gdbarch->char_signed));
8255796c8dcSSimon Schubert   fprintf_unfiltered (file,
8265796c8dcSSimon Schubert                       "gdbarch_dump: coff_make_msymbol_special = <%s>\n",
8275796c8dcSSimon Schubert                       host_address_to_string (gdbarch->coff_make_msymbol_special));
8285796c8dcSSimon Schubert   fprintf_unfiltered (file,
8295796c8dcSSimon Schubert                       "gdbarch_dump: convert_from_func_ptr_addr = <%s>\n",
8305796c8dcSSimon Schubert                       host_address_to_string (gdbarch->convert_from_func_ptr_addr));
8315796c8dcSSimon Schubert   fprintf_unfiltered (file,
8325796c8dcSSimon Schubert                       "gdbarch_dump: convert_register_p = <%s>\n",
8335796c8dcSSimon Schubert                       host_address_to_string (gdbarch->convert_register_p));
8345796c8dcSSimon Schubert   fprintf_unfiltered (file,
8355796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_core_pid_to_str_p() = %d\n",
8365796c8dcSSimon Schubert                       gdbarch_core_pid_to_str_p (gdbarch));
8375796c8dcSSimon Schubert   fprintf_unfiltered (file,
8385796c8dcSSimon Schubert                       "gdbarch_dump: core_pid_to_str = <%s>\n",
8395796c8dcSSimon Schubert                       host_address_to_string (gdbarch->core_pid_to_str));
8405796c8dcSSimon Schubert   fprintf_unfiltered (file,
8415796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_core_read_description_p() = %d\n",
8425796c8dcSSimon Schubert                       gdbarch_core_read_description_p (gdbarch));
8435796c8dcSSimon Schubert   fprintf_unfiltered (file,
8445796c8dcSSimon Schubert                       "gdbarch_dump: core_read_description = <%s>\n",
8455796c8dcSSimon Schubert                       host_address_to_string (gdbarch->core_read_description));
8465796c8dcSSimon Schubert   fprintf_unfiltered (file,
8475796c8dcSSimon Schubert                       "gdbarch_dump: core_regset_sections = %s\n",
8485796c8dcSSimon Schubert                       host_address_to_string (gdbarch->core_regset_sections));
8495796c8dcSSimon Schubert   fprintf_unfiltered (file,
8505796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
8515796c8dcSSimon Schubert                       gdbarch_core_xfer_shared_libraries_p (gdbarch));
8525796c8dcSSimon Schubert   fprintf_unfiltered (file,
8535796c8dcSSimon Schubert                       "gdbarch_dump: core_xfer_shared_libraries = <%s>\n",
8545796c8dcSSimon Schubert                       host_address_to_string (gdbarch->core_xfer_shared_libraries));
8555796c8dcSSimon Schubert   fprintf_unfiltered (file,
8565796c8dcSSimon Schubert                       "gdbarch_dump: decr_pc_after_break = %s\n",
8575796c8dcSSimon Schubert                       core_addr_to_string_nz (gdbarch->decr_pc_after_break));
8585796c8dcSSimon Schubert   fprintf_unfiltered (file,
8595796c8dcSSimon Schubert                       "gdbarch_dump: deprecated_fp_regnum = %s\n",
8605796c8dcSSimon Schubert                       plongest (gdbarch->deprecated_fp_regnum));
8615796c8dcSSimon Schubert   fprintf_unfiltered (file,
8625796c8dcSSimon Schubert                       "gdbarch_dump: deprecated_function_start_offset = %s\n",
8635796c8dcSSimon Schubert                       core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
8645796c8dcSSimon Schubert   fprintf_unfiltered (file,
8655796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
8665796c8dcSSimon Schubert                       gdbarch_displaced_step_copy_insn_p (gdbarch));
8675796c8dcSSimon Schubert   fprintf_unfiltered (file,
8685796c8dcSSimon Schubert                       "gdbarch_dump: displaced_step_copy_insn = <%s>\n",
8695796c8dcSSimon Schubert                       host_address_to_string (gdbarch->displaced_step_copy_insn));
8705796c8dcSSimon Schubert   fprintf_unfiltered (file,
8715796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_displaced_step_fixup_p() = %d\n",
8725796c8dcSSimon Schubert                       gdbarch_displaced_step_fixup_p (gdbarch));
8735796c8dcSSimon Schubert   fprintf_unfiltered (file,
8745796c8dcSSimon Schubert                       "gdbarch_dump: displaced_step_fixup = <%s>\n",
8755796c8dcSSimon Schubert                       host_address_to_string (gdbarch->displaced_step_fixup));
8765796c8dcSSimon Schubert   fprintf_unfiltered (file,
8775796c8dcSSimon Schubert                       "gdbarch_dump: displaced_step_free_closure = <%s>\n",
8785796c8dcSSimon Schubert                       host_address_to_string (gdbarch->displaced_step_free_closure));
8795796c8dcSSimon Schubert   fprintf_unfiltered (file,
8805796c8dcSSimon Schubert                       "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
8815796c8dcSSimon Schubert                       host_address_to_string (gdbarch->displaced_step_hw_singlestep));
8825796c8dcSSimon Schubert   fprintf_unfiltered (file,
8835796c8dcSSimon Schubert                       "gdbarch_dump: displaced_step_location = <%s>\n",
8845796c8dcSSimon Schubert                       host_address_to_string (gdbarch->displaced_step_location));
8855796c8dcSSimon Schubert   fprintf_unfiltered (file,
8865796c8dcSSimon Schubert                       "gdbarch_dump: double_bit = %s\n",
8875796c8dcSSimon Schubert                       plongest (gdbarch->double_bit));
8885796c8dcSSimon Schubert   fprintf_unfiltered (file,
8895796c8dcSSimon Schubert                       "gdbarch_dump: double_format = %s\n",
8905796c8dcSSimon Schubert                       pformat (gdbarch->double_format));
8915796c8dcSSimon Schubert   fprintf_unfiltered (file,
8925796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_dummy_id_p() = %d\n",
8935796c8dcSSimon Schubert                       gdbarch_dummy_id_p (gdbarch));
8945796c8dcSSimon Schubert   fprintf_unfiltered (file,
8955796c8dcSSimon Schubert                       "gdbarch_dump: dummy_id = <%s>\n",
8965796c8dcSSimon Schubert                       host_address_to_string (gdbarch->dummy_id));
8975796c8dcSSimon Schubert   fprintf_unfiltered (file,
898c50c785cSJohn Marino                       "gdbarch_dump: dwarf2_addr_size = %s\n",
899c50c785cSJohn Marino                       plongest (gdbarch->dwarf2_addr_size));
900c50c785cSJohn Marino   fprintf_unfiltered (file,
9015796c8dcSSimon Schubert                       "gdbarch_dump: dwarf2_reg_to_regnum = <%s>\n",
9025796c8dcSSimon Schubert                       host_address_to_string (gdbarch->dwarf2_reg_to_regnum));
9035796c8dcSSimon Schubert   fprintf_unfiltered (file,
9045796c8dcSSimon Schubert                       "gdbarch_dump: ecoff_reg_to_regnum = <%s>\n",
9055796c8dcSSimon Schubert                       host_address_to_string (gdbarch->ecoff_reg_to_regnum));
9065796c8dcSSimon Schubert   fprintf_unfiltered (file,
9075796c8dcSSimon Schubert                       "gdbarch_dump: elf_make_msymbol_special = <%s>\n",
9085796c8dcSSimon Schubert                       host_address_to_string (gdbarch->elf_make_msymbol_special));
9095796c8dcSSimon Schubert   fprintf_unfiltered (file,
910cf7f2e2dSJohn Marino                       "gdbarch_dump: fast_tracepoint_valid_at = <%s>\n",
911cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->fast_tracepoint_valid_at));
912cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
9135796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
9145796c8dcSSimon Schubert                       gdbarch_fetch_pointer_argument_p (gdbarch));
9155796c8dcSSimon Schubert   fprintf_unfiltered (file,
9165796c8dcSSimon Schubert                       "gdbarch_dump: fetch_pointer_argument = <%s>\n",
9175796c8dcSSimon Schubert                       host_address_to_string (gdbarch->fetch_pointer_argument));
9185796c8dcSSimon Schubert   fprintf_unfiltered (file,
9195796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_fetch_tls_load_module_address_p() = %d\n",
9205796c8dcSSimon Schubert                       gdbarch_fetch_tls_load_module_address_p (gdbarch));
9215796c8dcSSimon Schubert   fprintf_unfiltered (file,
9225796c8dcSSimon Schubert                       "gdbarch_dump: fetch_tls_load_module_address = <%s>\n",
9235796c8dcSSimon Schubert                       host_address_to_string (gdbarch->fetch_tls_load_module_address));
9245796c8dcSSimon Schubert   fprintf_unfiltered (file,
9255796c8dcSSimon Schubert                       "gdbarch_dump: float_bit = %s\n",
9265796c8dcSSimon Schubert                       plongest (gdbarch->float_bit));
9275796c8dcSSimon Schubert   fprintf_unfiltered (file,
9285796c8dcSSimon Schubert                       "gdbarch_dump: float_format = %s\n",
9295796c8dcSSimon Schubert                       pformat (gdbarch->float_format));
9305796c8dcSSimon Schubert   fprintf_unfiltered (file,
9315796c8dcSSimon Schubert                       "gdbarch_dump: fp0_regnum = %s\n",
9325796c8dcSSimon Schubert                       plongest (gdbarch->fp0_regnum));
9335796c8dcSSimon Schubert   fprintf_unfiltered (file,
9345796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
9355796c8dcSSimon Schubert                       gdbarch_frame_align_p (gdbarch));
9365796c8dcSSimon Schubert   fprintf_unfiltered (file,
9375796c8dcSSimon Schubert                       "gdbarch_dump: frame_align = <%s>\n",
9385796c8dcSSimon Schubert                       host_address_to_string (gdbarch->frame_align));
9395796c8dcSSimon Schubert   fprintf_unfiltered (file,
9405796c8dcSSimon Schubert                       "gdbarch_dump: frame_args_skip = %s\n",
9415796c8dcSSimon Schubert                       core_addr_to_string_nz (gdbarch->frame_args_skip));
9425796c8dcSSimon Schubert   fprintf_unfiltered (file,
9435796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
9445796c8dcSSimon Schubert                       gdbarch_frame_num_args_p (gdbarch));
9455796c8dcSSimon Schubert   fprintf_unfiltered (file,
9465796c8dcSSimon Schubert                       "gdbarch_dump: frame_num_args = <%s>\n",
9475796c8dcSSimon Schubert                       host_address_to_string (gdbarch->frame_num_args));
9485796c8dcSSimon Schubert   fprintf_unfiltered (file,
9495796c8dcSSimon Schubert                       "gdbarch_dump: frame_red_zone_size = %s\n",
9505796c8dcSSimon Schubert                       plongest (gdbarch->frame_red_zone_size));
9515796c8dcSSimon Schubert   fprintf_unfiltered (file,
9525796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_gcore_bfd_target_p() = %d\n",
9535796c8dcSSimon Schubert                       gdbarch_gcore_bfd_target_p (gdbarch));
9545796c8dcSSimon Schubert   fprintf_unfiltered (file,
9555796c8dcSSimon Schubert                       "gdbarch_dump: gcore_bfd_target = %s\n",
956*a45ae5f8SJohn Marino                       pstring (gdbarch->gcore_bfd_target));
957*a45ae5f8SJohn Marino   fprintf_unfiltered (file,
958*a45ae5f8SJohn Marino                       "gdbarch_dump: gen_return_address = <%s>\n",
959*a45ae5f8SJohn Marino                       host_address_to_string (gdbarch->gen_return_address));
9605796c8dcSSimon Schubert   fprintf_unfiltered (file,
9615796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
9625796c8dcSSimon Schubert                       gdbarch_get_longjmp_target_p (gdbarch));
9635796c8dcSSimon Schubert   fprintf_unfiltered (file,
9645796c8dcSSimon Schubert                       "gdbarch_dump: get_longjmp_target = <%s>\n",
9655796c8dcSSimon Schubert                       host_address_to_string (gdbarch->get_longjmp_target));
9665796c8dcSSimon Schubert   fprintf_unfiltered (file,
9675796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_get_siginfo_type_p() = %d\n",
9685796c8dcSSimon Schubert                       gdbarch_get_siginfo_type_p (gdbarch));
9695796c8dcSSimon Schubert   fprintf_unfiltered (file,
9705796c8dcSSimon Schubert                       "gdbarch_dump: get_siginfo_type = <%s>\n",
9715796c8dcSSimon Schubert                       host_address_to_string (gdbarch->get_siginfo_type));
9725796c8dcSSimon Schubert   fprintf_unfiltered (file,
9735796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_get_syscall_number_p() = %d\n",
9745796c8dcSSimon Schubert                       gdbarch_get_syscall_number_p (gdbarch));
9755796c8dcSSimon Schubert   fprintf_unfiltered (file,
9765796c8dcSSimon Schubert                       "gdbarch_dump: get_syscall_number = <%s>\n",
9775796c8dcSSimon Schubert                       host_address_to_string (gdbarch->get_syscall_number));
9785796c8dcSSimon Schubert   fprintf_unfiltered (file,
979cf7f2e2dSJohn Marino                       "gdbarch_dump: half_bit = %s\n",
980cf7f2e2dSJohn Marino                       plongest (gdbarch->half_bit));
981cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
982cf7f2e2dSJohn Marino                       "gdbarch_dump: half_format = %s\n",
983cf7f2e2dSJohn Marino                       pformat (gdbarch->half_format));
984cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
985cf7f2e2dSJohn Marino                       "gdbarch_dump: has_dos_based_file_system = %s\n",
986cf7f2e2dSJohn Marino                       plongest (gdbarch->has_dos_based_file_system));
987cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
9885796c8dcSSimon Schubert                       "gdbarch_dump: has_global_breakpoints = %s\n",
9895796c8dcSSimon Schubert                       plongest (gdbarch->has_global_breakpoints));
9905796c8dcSSimon Schubert   fprintf_unfiltered (file,
9915796c8dcSSimon Schubert                       "gdbarch_dump: has_global_solist = %s\n",
9925796c8dcSSimon Schubert                       plongest (gdbarch->has_global_solist));
9935796c8dcSSimon Schubert   fprintf_unfiltered (file,
994cf7f2e2dSJohn Marino                       "gdbarch_dump: has_shared_address_space = <%s>\n",
995cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->has_shared_address_space));
996cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
9975796c8dcSSimon Schubert                       "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
9985796c8dcSSimon Schubert                       plongest (gdbarch->have_nonsteppable_watchpoint));
9995796c8dcSSimon Schubert   fprintf_unfiltered (file,
10005796c8dcSSimon Schubert                       "gdbarch_dump: in_function_epilogue_p = <%s>\n",
10015796c8dcSSimon Schubert                       host_address_to_string (gdbarch->in_function_epilogue_p));
10025796c8dcSSimon Schubert   fprintf_unfiltered (file,
10035796c8dcSSimon Schubert                       "gdbarch_dump: in_solib_return_trampoline = <%s>\n",
10045796c8dcSSimon Schubert                       host_address_to_string (gdbarch->in_solib_return_trampoline));
10055796c8dcSSimon Schubert   fprintf_unfiltered (file,
10065796c8dcSSimon Schubert                       "gdbarch_dump: inner_than = <%s>\n",
10075796c8dcSSimon Schubert                       host_address_to_string (gdbarch->inner_than));
10085796c8dcSSimon Schubert   fprintf_unfiltered (file,
10095796c8dcSSimon Schubert                       "gdbarch_dump: int_bit = %s\n",
10105796c8dcSSimon Schubert                       plongest (gdbarch->int_bit));
10115796c8dcSSimon Schubert   fprintf_unfiltered (file,
10125796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
10135796c8dcSSimon Schubert                       gdbarch_integer_to_address_p (gdbarch));
10145796c8dcSSimon Schubert   fprintf_unfiltered (file,
10155796c8dcSSimon Schubert                       "gdbarch_dump: integer_to_address = <%s>\n",
10165796c8dcSSimon Schubert                       host_address_to_string (gdbarch->integer_to_address));
10175796c8dcSSimon Schubert   fprintf_unfiltered (file,
10185796c8dcSSimon Schubert                       "gdbarch_dump: long_bit = %s\n",
10195796c8dcSSimon Schubert                       plongest (gdbarch->long_bit));
10205796c8dcSSimon Schubert   fprintf_unfiltered (file,
10215796c8dcSSimon Schubert                       "gdbarch_dump: long_double_bit = %s\n",
10225796c8dcSSimon Schubert                       plongest (gdbarch->long_double_bit));
10235796c8dcSSimon Schubert   fprintf_unfiltered (file,
10245796c8dcSSimon Schubert                       "gdbarch_dump: long_double_format = %s\n",
10255796c8dcSSimon Schubert                       pformat (gdbarch->long_double_format));
10265796c8dcSSimon Schubert   fprintf_unfiltered (file,
1027*a45ae5f8SJohn Marino                       "gdbarch_dump: long_long_align_bit = %s\n",
1028*a45ae5f8SJohn Marino                       plongest (gdbarch->long_long_align_bit));
1029*a45ae5f8SJohn Marino   fprintf_unfiltered (file,
10305796c8dcSSimon Schubert                       "gdbarch_dump: long_long_bit = %s\n",
10315796c8dcSSimon Schubert                       plongest (gdbarch->long_long_bit));
10325796c8dcSSimon Schubert   fprintf_unfiltered (file,
10335796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
10345796c8dcSSimon Schubert                       gdbarch_max_insn_length_p (gdbarch));
10355796c8dcSSimon Schubert   fprintf_unfiltered (file,
10365796c8dcSSimon Schubert                       "gdbarch_dump: max_insn_length = %s\n",
10375796c8dcSSimon Schubert                       plongest (gdbarch->max_insn_length));
10385796c8dcSSimon Schubert   fprintf_unfiltered (file,
10395796c8dcSSimon Schubert                       "gdbarch_dump: memory_insert_breakpoint = <%s>\n",
10405796c8dcSSimon Schubert                       host_address_to_string (gdbarch->memory_insert_breakpoint));
10415796c8dcSSimon Schubert   fprintf_unfiltered (file,
10425796c8dcSSimon Schubert                       "gdbarch_dump: memory_remove_breakpoint = <%s>\n",
10435796c8dcSSimon Schubert                       host_address_to_string (gdbarch->memory_remove_breakpoint));
10445796c8dcSSimon Schubert   fprintf_unfiltered (file,
10455796c8dcSSimon Schubert                       "gdbarch_dump: num_pseudo_regs = %s\n",
10465796c8dcSSimon Schubert                       plongest (gdbarch->num_pseudo_regs));
10475796c8dcSSimon Schubert   fprintf_unfiltered (file,
10485796c8dcSSimon Schubert                       "gdbarch_dump: num_regs = %s\n",
10495796c8dcSSimon Schubert                       plongest (gdbarch->num_regs));
10505796c8dcSSimon Schubert   fprintf_unfiltered (file,
10515796c8dcSSimon Schubert                       "gdbarch_dump: osabi = %s\n",
10525796c8dcSSimon Schubert                       plongest (gdbarch->osabi));
10535796c8dcSSimon Schubert   fprintf_unfiltered (file,
10545796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_overlay_update_p() = %d\n",
10555796c8dcSSimon Schubert                       gdbarch_overlay_update_p (gdbarch));
10565796c8dcSSimon Schubert   fprintf_unfiltered (file,
10575796c8dcSSimon Schubert                       "gdbarch_dump: overlay_update = <%s>\n",
10585796c8dcSSimon Schubert                       host_address_to_string (gdbarch->overlay_update));
10595796c8dcSSimon Schubert   fprintf_unfiltered (file,
10605796c8dcSSimon Schubert                       "gdbarch_dump: pc_regnum = %s\n",
10615796c8dcSSimon Schubert                       plongest (gdbarch->pc_regnum));
10625796c8dcSSimon Schubert   fprintf_unfiltered (file,
10635796c8dcSSimon Schubert                       "gdbarch_dump: pointer_to_address = <%s>\n",
10645796c8dcSSimon Schubert                       host_address_to_string (gdbarch->pointer_to_address));
10655796c8dcSSimon Schubert   fprintf_unfiltered (file,
10665796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
10675796c8dcSSimon Schubert                       gdbarch_print_float_info_p (gdbarch));
10685796c8dcSSimon Schubert   fprintf_unfiltered (file,
10695796c8dcSSimon Schubert                       "gdbarch_dump: print_float_info = <%s>\n",
10705796c8dcSSimon Schubert                       host_address_to_string (gdbarch->print_float_info));
10715796c8dcSSimon Schubert   fprintf_unfiltered (file,
10725796c8dcSSimon Schubert                       "gdbarch_dump: print_insn = <%s>\n",
10735796c8dcSSimon Schubert                       host_address_to_string (gdbarch->print_insn));
10745796c8dcSSimon Schubert   fprintf_unfiltered (file,
10755796c8dcSSimon Schubert                       "gdbarch_dump: print_registers_info = <%s>\n",
10765796c8dcSSimon Schubert                       host_address_to_string (gdbarch->print_registers_info));
10775796c8dcSSimon Schubert   fprintf_unfiltered (file,
10785796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
10795796c8dcSSimon Schubert                       gdbarch_print_vector_info_p (gdbarch));
10805796c8dcSSimon Schubert   fprintf_unfiltered (file,
10815796c8dcSSimon Schubert                       "gdbarch_dump: print_vector_info = <%s>\n",
10825796c8dcSSimon Schubert                       host_address_to_string (gdbarch->print_vector_info));
10835796c8dcSSimon Schubert   fprintf_unfiltered (file,
10845796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_process_record_p() = %d\n",
10855796c8dcSSimon Schubert                       gdbarch_process_record_p (gdbarch));
10865796c8dcSSimon Schubert   fprintf_unfiltered (file,
10875796c8dcSSimon Schubert                       "gdbarch_dump: process_record = <%s>\n",
10885796c8dcSSimon Schubert                       host_address_to_string (gdbarch->process_record));
10895796c8dcSSimon Schubert   fprintf_unfiltered (file,
10905796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n",
10915796c8dcSSimon Schubert                       gdbarch_process_record_signal_p (gdbarch));
10925796c8dcSSimon Schubert   fprintf_unfiltered (file,
10935796c8dcSSimon Schubert                       "gdbarch_dump: process_record_signal = <%s>\n",
10945796c8dcSSimon Schubert                       host_address_to_string (gdbarch->process_record_signal));
10955796c8dcSSimon Schubert   fprintf_unfiltered (file,
10965796c8dcSSimon Schubert                       "gdbarch_dump: ps_regnum = %s\n",
10975796c8dcSSimon Schubert                       plongest (gdbarch->ps_regnum));
10985796c8dcSSimon Schubert   fprintf_unfiltered (file,
10995796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
11005796c8dcSSimon Schubert                       gdbarch_pseudo_register_read_p (gdbarch));
11015796c8dcSSimon Schubert   fprintf_unfiltered (file,
11025796c8dcSSimon Schubert                       "gdbarch_dump: pseudo_register_read = <%s>\n",
11035796c8dcSSimon Schubert                       host_address_to_string (gdbarch->pseudo_register_read));
11045796c8dcSSimon Schubert   fprintf_unfiltered (file,
1105*a45ae5f8SJohn Marino                       "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n",
1106*a45ae5f8SJohn Marino                       gdbarch_pseudo_register_read_value_p (gdbarch));
1107*a45ae5f8SJohn Marino   fprintf_unfiltered (file,
1108*a45ae5f8SJohn Marino                       "gdbarch_dump: pseudo_register_read_value = <%s>\n",
1109*a45ae5f8SJohn Marino                       host_address_to_string (gdbarch->pseudo_register_read_value));
1110*a45ae5f8SJohn Marino   fprintf_unfiltered (file,
11115796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
11125796c8dcSSimon Schubert                       gdbarch_pseudo_register_write_p (gdbarch));
11135796c8dcSSimon Schubert   fprintf_unfiltered (file,
11145796c8dcSSimon Schubert                       "gdbarch_dump: pseudo_register_write = <%s>\n",
11155796c8dcSSimon Schubert                       host_address_to_string (gdbarch->pseudo_register_write));
11165796c8dcSSimon Schubert   fprintf_unfiltered (file,
11175796c8dcSSimon Schubert                       "gdbarch_dump: ptr_bit = %s\n",
11185796c8dcSSimon Schubert                       plongest (gdbarch->ptr_bit));
11195796c8dcSSimon Schubert   fprintf_unfiltered (file,
11205796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
11215796c8dcSSimon Schubert                       gdbarch_push_dummy_call_p (gdbarch));
11225796c8dcSSimon Schubert   fprintf_unfiltered (file,
11235796c8dcSSimon Schubert                       "gdbarch_dump: push_dummy_call = <%s>\n",
11245796c8dcSSimon Schubert                       host_address_to_string (gdbarch->push_dummy_call));
11255796c8dcSSimon Schubert   fprintf_unfiltered (file,
11265796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
11275796c8dcSSimon Schubert                       gdbarch_push_dummy_code_p (gdbarch));
11285796c8dcSSimon Schubert   fprintf_unfiltered (file,
11295796c8dcSSimon Schubert                       "gdbarch_dump: push_dummy_code = <%s>\n",
11305796c8dcSSimon Schubert                       host_address_to_string (gdbarch->push_dummy_code));
11315796c8dcSSimon Schubert   fprintf_unfiltered (file,
11325796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
11335796c8dcSSimon Schubert                       gdbarch_read_pc_p (gdbarch));
11345796c8dcSSimon Schubert   fprintf_unfiltered (file,
11355796c8dcSSimon Schubert                       "gdbarch_dump: read_pc = <%s>\n",
11365796c8dcSSimon Schubert                       host_address_to_string (gdbarch->read_pc));
11375796c8dcSSimon Schubert   fprintf_unfiltered (file,
11385796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_record_special_symbol_p() = %d\n",
11395796c8dcSSimon Schubert                       gdbarch_record_special_symbol_p (gdbarch));
11405796c8dcSSimon Schubert   fprintf_unfiltered (file,
11415796c8dcSSimon Schubert                       "gdbarch_dump: record_special_symbol = <%s>\n",
11425796c8dcSSimon Schubert                       host_address_to_string (gdbarch->record_special_symbol));
11435796c8dcSSimon Schubert   fprintf_unfiltered (file,
11445796c8dcSSimon Schubert                       "gdbarch_dump: register_name = <%s>\n",
11455796c8dcSSimon Schubert                       host_address_to_string (gdbarch->register_name));
11465796c8dcSSimon Schubert   fprintf_unfiltered (file,
11475796c8dcSSimon Schubert                       "gdbarch_dump: register_reggroup_p = <%s>\n",
11485796c8dcSSimon Schubert                       host_address_to_string (gdbarch->register_reggroup_p));
11495796c8dcSSimon Schubert   fprintf_unfiltered (file,
11505796c8dcSSimon Schubert                       "gdbarch_dump: register_sim_regno = <%s>\n",
11515796c8dcSSimon Schubert                       host_address_to_string (gdbarch->register_sim_regno));
11525796c8dcSSimon Schubert   fprintf_unfiltered (file,
11535796c8dcSSimon Schubert                       "gdbarch_dump: register_to_value = <%s>\n",
11545796c8dcSSimon Schubert                       host_address_to_string (gdbarch->register_to_value));
11555796c8dcSSimon Schubert   fprintf_unfiltered (file,
11565796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_register_type_p() = %d\n",
11575796c8dcSSimon Schubert                       gdbarch_register_type_p (gdbarch));
11585796c8dcSSimon Schubert   fprintf_unfiltered (file,
11595796c8dcSSimon Schubert                       "gdbarch_dump: register_type = <%s>\n",
11605796c8dcSSimon Schubert                       host_address_to_string (gdbarch->register_type));
11615796c8dcSSimon Schubert   fprintf_unfiltered (file,
11625796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
11635796c8dcSSimon Schubert                       gdbarch_regset_from_core_section_p (gdbarch));
11645796c8dcSSimon Schubert   fprintf_unfiltered (file,
11655796c8dcSSimon Schubert                       "gdbarch_dump: regset_from_core_section = <%s>\n",
11665796c8dcSSimon Schubert                       host_address_to_string (gdbarch->regset_from_core_section));
11675796c8dcSSimon Schubert   fprintf_unfiltered (file,
1168cf7f2e2dSJohn Marino                       "gdbarch_dump: gdbarch_relocate_instruction_p() = %d\n",
1169cf7f2e2dSJohn Marino                       gdbarch_relocate_instruction_p (gdbarch));
1170cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
1171cf7f2e2dSJohn Marino                       "gdbarch_dump: relocate_instruction = <%s>\n",
1172cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->relocate_instruction));
1173cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
1174cf7f2e2dSJohn Marino                       "gdbarch_dump: remote_breakpoint_from_pc = <%s>\n",
1175cf7f2e2dSJohn Marino                       host_address_to_string (gdbarch->remote_breakpoint_from_pc));
1176cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
11775796c8dcSSimon Schubert                       "gdbarch_dump: remote_register_number = <%s>\n",
11785796c8dcSSimon Schubert                       host_address_to_string (gdbarch->remote_register_number));
11795796c8dcSSimon Schubert   fprintf_unfiltered (file,
11805796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_return_value_p() = %d\n",
11815796c8dcSSimon Schubert                       gdbarch_return_value_p (gdbarch));
11825796c8dcSSimon Schubert   fprintf_unfiltered (file,
11835796c8dcSSimon Schubert                       "gdbarch_dump: return_value = <%s>\n",
11845796c8dcSSimon Schubert                       host_address_to_string (gdbarch->return_value));
11855796c8dcSSimon Schubert   fprintf_unfiltered (file,
11865796c8dcSSimon Schubert                       "gdbarch_dump: sdb_reg_to_regnum = <%s>\n",
11875796c8dcSSimon Schubert                       host_address_to_string (gdbarch->sdb_reg_to_regnum));
11885796c8dcSSimon Schubert   fprintf_unfiltered (file,
11895796c8dcSSimon Schubert                       "gdbarch_dump: short_bit = %s\n",
11905796c8dcSSimon Schubert                       plongest (gdbarch->short_bit));
11915796c8dcSSimon Schubert   fprintf_unfiltered (file,
11925796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_single_step_through_delay_p() = %d\n",
11935796c8dcSSimon Schubert                       gdbarch_single_step_through_delay_p (gdbarch));
11945796c8dcSSimon Schubert   fprintf_unfiltered (file,
11955796c8dcSSimon Schubert                       "gdbarch_dump: single_step_through_delay = <%s>\n",
11965796c8dcSSimon Schubert                       host_address_to_string (gdbarch->single_step_through_delay));
11975796c8dcSSimon Schubert   fprintf_unfiltered (file,
11985796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n",
11995796c8dcSSimon Schubert                       gdbarch_skip_main_prologue_p (gdbarch));
12005796c8dcSSimon Schubert   fprintf_unfiltered (file,
12015796c8dcSSimon Schubert                       "gdbarch_dump: skip_main_prologue = <%s>\n",
12025796c8dcSSimon Schubert                       host_address_to_string (gdbarch->skip_main_prologue));
12035796c8dcSSimon Schubert   fprintf_unfiltered (file,
12045796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_skip_permanent_breakpoint_p() = %d\n",
12055796c8dcSSimon Schubert                       gdbarch_skip_permanent_breakpoint_p (gdbarch));
12065796c8dcSSimon Schubert   fprintf_unfiltered (file,
12075796c8dcSSimon Schubert                       "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
12085796c8dcSSimon Schubert                       host_address_to_string (gdbarch->skip_permanent_breakpoint));
12095796c8dcSSimon Schubert   fprintf_unfiltered (file,
12105796c8dcSSimon Schubert                       "gdbarch_dump: skip_prologue = <%s>\n",
12115796c8dcSSimon Schubert                       host_address_to_string (gdbarch->skip_prologue));
12125796c8dcSSimon Schubert   fprintf_unfiltered (file,
12135796c8dcSSimon Schubert                       "gdbarch_dump: skip_solib_resolver = <%s>\n",
12145796c8dcSSimon Schubert                       host_address_to_string (gdbarch->skip_solib_resolver));
12155796c8dcSSimon Schubert   fprintf_unfiltered (file,
12165796c8dcSSimon Schubert                       "gdbarch_dump: skip_trampoline_code = <%s>\n",
12175796c8dcSSimon Schubert                       host_address_to_string (gdbarch->skip_trampoline_code));
12185796c8dcSSimon Schubert   fprintf_unfiltered (file,
12195796c8dcSSimon Schubert                       "gdbarch_dump: smash_text_address = <%s>\n",
12205796c8dcSSimon Schubert                       host_address_to_string (gdbarch->smash_text_address));
12215796c8dcSSimon Schubert   fprintf_unfiltered (file,
12225796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
12235796c8dcSSimon Schubert                       gdbarch_software_single_step_p (gdbarch));
12245796c8dcSSimon Schubert   fprintf_unfiltered (file,
12255796c8dcSSimon Schubert                       "gdbarch_dump: software_single_step = <%s>\n",
12265796c8dcSSimon Schubert                       host_address_to_string (gdbarch->software_single_step));
12275796c8dcSSimon Schubert   fprintf_unfiltered (file,
12285796c8dcSSimon Schubert                       "gdbarch_dump: sofun_address_maybe_missing = %s\n",
12295796c8dcSSimon Schubert                       plongest (gdbarch->sofun_address_maybe_missing));
12305796c8dcSSimon Schubert   fprintf_unfiltered (file,
1231cf7f2e2dSJohn Marino                       "gdbarch_dump: solib_symbols_extension = %s\n",
1232cf7f2e2dSJohn Marino                       pstring (gdbarch->solib_symbols_extension));
1233cf7f2e2dSJohn Marino   fprintf_unfiltered (file,
12345796c8dcSSimon Schubert                       "gdbarch_dump: sp_regnum = %s\n",
12355796c8dcSSimon Schubert                       plongest (gdbarch->sp_regnum));
12365796c8dcSSimon Schubert   fprintf_unfiltered (file,
12375796c8dcSSimon Schubert                       "gdbarch_dump: stab_reg_to_regnum = <%s>\n",
12385796c8dcSSimon Schubert                       host_address_to_string (gdbarch->stab_reg_to_regnum));
12395796c8dcSSimon Schubert   fprintf_unfiltered (file,
12405796c8dcSSimon Schubert                       "gdbarch_dump: stabs_argument_has_addr = <%s>\n",
12415796c8dcSSimon Schubert                       host_address_to_string (gdbarch->stabs_argument_has_addr));
12425796c8dcSSimon Schubert   fprintf_unfiltered (file,
12435796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
12445796c8dcSSimon Schubert                       gdbarch_static_transform_name_p (gdbarch));
12455796c8dcSSimon Schubert   fprintf_unfiltered (file,
12465796c8dcSSimon Schubert                       "gdbarch_dump: static_transform_name = <%s>\n",
12475796c8dcSSimon Schubert                       host_address_to_string (gdbarch->static_transform_name));
12485796c8dcSSimon Schubert   fprintf_unfiltered (file,
12495796c8dcSSimon Schubert                       "gdbarch_dump: target_desc = %s\n",
12505796c8dcSSimon Schubert                       host_address_to_string (gdbarch->target_desc));
12515796c8dcSSimon Schubert   fprintf_unfiltered (file,
12525796c8dcSSimon Schubert                       "gdbarch_dump: target_signal_from_host = <%s>\n",
12535796c8dcSSimon Schubert                       host_address_to_string (gdbarch->target_signal_from_host));
12545796c8dcSSimon Schubert   fprintf_unfiltered (file,
12555796c8dcSSimon Schubert                       "gdbarch_dump: target_signal_to_host = <%s>\n",
12565796c8dcSSimon Schubert                       host_address_to_string (gdbarch->target_signal_to_host));
12575796c8dcSSimon Schubert   fprintf_unfiltered (file,
12585796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
12595796c8dcSSimon Schubert                       gdbarch_unwind_pc_p (gdbarch));
12605796c8dcSSimon Schubert   fprintf_unfiltered (file,
12615796c8dcSSimon Schubert                       "gdbarch_dump: unwind_pc = <%s>\n",
12625796c8dcSSimon Schubert                       host_address_to_string (gdbarch->unwind_pc));
12635796c8dcSSimon Schubert   fprintf_unfiltered (file,
12645796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
12655796c8dcSSimon Schubert                       gdbarch_unwind_sp_p (gdbarch));
12665796c8dcSSimon Schubert   fprintf_unfiltered (file,
12675796c8dcSSimon Schubert                       "gdbarch_dump: unwind_sp = <%s>\n",
12685796c8dcSSimon Schubert                       host_address_to_string (gdbarch->unwind_sp));
12695796c8dcSSimon Schubert   fprintf_unfiltered (file,
12705796c8dcSSimon Schubert                       "gdbarch_dump: value_from_register = <%s>\n",
12715796c8dcSSimon Schubert                       host_address_to_string (gdbarch->value_from_register));
12725796c8dcSSimon Schubert   fprintf_unfiltered (file,
12735796c8dcSSimon Schubert                       "gdbarch_dump: value_to_register = <%s>\n",
12745796c8dcSSimon Schubert                       host_address_to_string (gdbarch->value_to_register));
12755796c8dcSSimon Schubert   fprintf_unfiltered (file,
12765796c8dcSSimon Schubert                       "gdbarch_dump: vbit_in_delta = %s\n",
12775796c8dcSSimon Schubert                       plongest (gdbarch->vbit_in_delta));
12785796c8dcSSimon Schubert   fprintf_unfiltered (file,
12795796c8dcSSimon Schubert                       "gdbarch_dump: virtual_frame_pointer = <%s>\n",
12805796c8dcSSimon Schubert                       host_address_to_string (gdbarch->virtual_frame_pointer));
12815796c8dcSSimon Schubert   fprintf_unfiltered (file,
12825796c8dcSSimon Schubert                       "gdbarch_dump: vtable_function_descriptors = %s\n",
12835796c8dcSSimon Schubert                       plongest (gdbarch->vtable_function_descriptors));
12845796c8dcSSimon Schubert   fprintf_unfiltered (file,
12855796c8dcSSimon Schubert                       "gdbarch_dump: gdbarch_write_pc_p() = %d\n",
12865796c8dcSSimon Schubert                       gdbarch_write_pc_p (gdbarch));
12875796c8dcSSimon Schubert   fprintf_unfiltered (file,
12885796c8dcSSimon Schubert                       "gdbarch_dump: write_pc = <%s>\n",
12895796c8dcSSimon Schubert                       host_address_to_string (gdbarch->write_pc));
12905796c8dcSSimon Schubert   if (gdbarch->dump_tdep != NULL)
12915796c8dcSSimon Schubert     gdbarch->dump_tdep (gdbarch, file);
12925796c8dcSSimon Schubert }
12935796c8dcSSimon Schubert 
12945796c8dcSSimon Schubert struct gdbarch_tdep *
12955796c8dcSSimon Schubert gdbarch_tdep (struct gdbarch *gdbarch)
12965796c8dcSSimon Schubert {
12975796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
12985796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n");
12995796c8dcSSimon Schubert   return gdbarch->tdep;
13005796c8dcSSimon Schubert }
13015796c8dcSSimon Schubert 
13025796c8dcSSimon Schubert 
13035796c8dcSSimon Schubert const struct bfd_arch_info *
13045796c8dcSSimon Schubert gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
13055796c8dcSSimon Schubert {
13065796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13075796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13085796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
13095796c8dcSSimon Schubert   return gdbarch->bfd_arch_info;
13105796c8dcSSimon Schubert }
13115796c8dcSSimon Schubert 
13125796c8dcSSimon Schubert int
13135796c8dcSSimon Schubert gdbarch_byte_order (struct gdbarch *gdbarch)
13145796c8dcSSimon Schubert {
13155796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13165796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13175796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
13185796c8dcSSimon Schubert   return gdbarch->byte_order;
13195796c8dcSSimon Schubert }
13205796c8dcSSimon Schubert 
13215796c8dcSSimon Schubert int
13225796c8dcSSimon Schubert gdbarch_byte_order_for_code (struct gdbarch *gdbarch)
13235796c8dcSSimon Schubert {
13245796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13255796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13265796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order_for_code called\n");
13275796c8dcSSimon Schubert   return gdbarch->byte_order_for_code;
13285796c8dcSSimon Schubert }
13295796c8dcSSimon Schubert 
13305796c8dcSSimon Schubert enum gdb_osabi
13315796c8dcSSimon Schubert gdbarch_osabi (struct gdbarch *gdbarch)
13325796c8dcSSimon Schubert {
13335796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13345796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13355796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_osabi called\n");
13365796c8dcSSimon Schubert   return gdbarch->osabi;
13375796c8dcSSimon Schubert }
13385796c8dcSSimon Schubert 
13395796c8dcSSimon Schubert const struct target_desc *
13405796c8dcSSimon Schubert gdbarch_target_desc (struct gdbarch *gdbarch)
13415796c8dcSSimon Schubert {
13425796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13435796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13445796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
13455796c8dcSSimon Schubert   return gdbarch->target_desc;
13465796c8dcSSimon Schubert }
13475796c8dcSSimon Schubert 
13485796c8dcSSimon Schubert int
13495796c8dcSSimon Schubert gdbarch_bits_big_endian (struct gdbarch *gdbarch)
13505796c8dcSSimon Schubert {
13515796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13525796c8dcSSimon Schubert   /* Skip verify of bits_big_endian, invalid_p == 0 */
13535796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13545796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_bits_big_endian called\n");
13555796c8dcSSimon Schubert   return gdbarch->bits_big_endian;
13565796c8dcSSimon Schubert }
13575796c8dcSSimon Schubert 
13585796c8dcSSimon Schubert void
13595796c8dcSSimon Schubert set_gdbarch_bits_big_endian (struct gdbarch *gdbarch,
13605796c8dcSSimon Schubert                              int bits_big_endian)
13615796c8dcSSimon Schubert {
13625796c8dcSSimon Schubert   gdbarch->bits_big_endian = bits_big_endian;
13635796c8dcSSimon Schubert }
13645796c8dcSSimon Schubert 
13655796c8dcSSimon Schubert int
13665796c8dcSSimon Schubert gdbarch_short_bit (struct gdbarch *gdbarch)
13675796c8dcSSimon Schubert {
13685796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13695796c8dcSSimon Schubert   /* Skip verify of short_bit, invalid_p == 0 */
13705796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13715796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
13725796c8dcSSimon Schubert   return gdbarch->short_bit;
13735796c8dcSSimon Schubert }
13745796c8dcSSimon Schubert 
13755796c8dcSSimon Schubert void
13765796c8dcSSimon Schubert set_gdbarch_short_bit (struct gdbarch *gdbarch,
13775796c8dcSSimon Schubert                        int short_bit)
13785796c8dcSSimon Schubert {
13795796c8dcSSimon Schubert   gdbarch->short_bit = short_bit;
13805796c8dcSSimon Schubert }
13815796c8dcSSimon Schubert 
13825796c8dcSSimon Schubert int
13835796c8dcSSimon Schubert gdbarch_int_bit (struct gdbarch *gdbarch)
13845796c8dcSSimon Schubert {
13855796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
13865796c8dcSSimon Schubert   /* Skip verify of int_bit, invalid_p == 0 */
13875796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
13885796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
13895796c8dcSSimon Schubert   return gdbarch->int_bit;
13905796c8dcSSimon Schubert }
13915796c8dcSSimon Schubert 
13925796c8dcSSimon Schubert void
13935796c8dcSSimon Schubert set_gdbarch_int_bit (struct gdbarch *gdbarch,
13945796c8dcSSimon Schubert                      int int_bit)
13955796c8dcSSimon Schubert {
13965796c8dcSSimon Schubert   gdbarch->int_bit = int_bit;
13975796c8dcSSimon Schubert }
13985796c8dcSSimon Schubert 
13995796c8dcSSimon Schubert int
14005796c8dcSSimon Schubert gdbarch_long_bit (struct gdbarch *gdbarch)
14015796c8dcSSimon Schubert {
14025796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
14035796c8dcSSimon Schubert   /* Skip verify of long_bit, invalid_p == 0 */
14045796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
14055796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
14065796c8dcSSimon Schubert   return gdbarch->long_bit;
14075796c8dcSSimon Schubert }
14085796c8dcSSimon Schubert 
14095796c8dcSSimon Schubert void
14105796c8dcSSimon Schubert set_gdbarch_long_bit (struct gdbarch *gdbarch,
14115796c8dcSSimon Schubert                       int long_bit)
14125796c8dcSSimon Schubert {
14135796c8dcSSimon Schubert   gdbarch->long_bit = long_bit;
14145796c8dcSSimon Schubert }
14155796c8dcSSimon Schubert 
14165796c8dcSSimon Schubert int
14175796c8dcSSimon Schubert gdbarch_long_long_bit (struct gdbarch *gdbarch)
14185796c8dcSSimon Schubert {
14195796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
14205796c8dcSSimon Schubert   /* Skip verify of long_long_bit, invalid_p == 0 */
14215796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
14225796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
14235796c8dcSSimon Schubert   return gdbarch->long_long_bit;
14245796c8dcSSimon Schubert }
14255796c8dcSSimon Schubert 
14265796c8dcSSimon Schubert void
14275796c8dcSSimon Schubert set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
14285796c8dcSSimon Schubert                            int long_long_bit)
14295796c8dcSSimon Schubert {
14305796c8dcSSimon Schubert   gdbarch->long_long_bit = long_long_bit;
14315796c8dcSSimon Schubert }
14325796c8dcSSimon Schubert 
14335796c8dcSSimon Schubert int
1434*a45ae5f8SJohn Marino gdbarch_long_long_align_bit (struct gdbarch *gdbarch)
1435*a45ae5f8SJohn Marino {
1436*a45ae5f8SJohn Marino   gdb_assert (gdbarch != NULL);
1437*a45ae5f8SJohn Marino   /* Skip verify of long_long_align_bit, invalid_p == 0 */
1438*a45ae5f8SJohn Marino   if (gdbarch_debug >= 2)
1439*a45ae5f8SJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_align_bit called\n");
1440*a45ae5f8SJohn Marino   return gdbarch->long_long_align_bit;
1441*a45ae5f8SJohn Marino }
1442*a45ae5f8SJohn Marino 
1443*a45ae5f8SJohn Marino void
1444*a45ae5f8SJohn Marino set_gdbarch_long_long_align_bit (struct gdbarch *gdbarch,
1445*a45ae5f8SJohn Marino                                  int long_long_align_bit)
1446*a45ae5f8SJohn Marino {
1447*a45ae5f8SJohn Marino   gdbarch->long_long_align_bit = long_long_align_bit;
1448*a45ae5f8SJohn Marino }
1449*a45ae5f8SJohn Marino 
1450*a45ae5f8SJohn Marino int
1451cf7f2e2dSJohn Marino gdbarch_half_bit (struct gdbarch *gdbarch)
1452cf7f2e2dSJohn Marino {
1453cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
1454cf7f2e2dSJohn Marino   /* Skip verify of half_bit, invalid_p == 0 */
1455cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
1456cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_half_bit called\n");
1457cf7f2e2dSJohn Marino   return gdbarch->half_bit;
1458cf7f2e2dSJohn Marino }
1459cf7f2e2dSJohn Marino 
1460cf7f2e2dSJohn Marino void
1461cf7f2e2dSJohn Marino set_gdbarch_half_bit (struct gdbarch *gdbarch,
1462cf7f2e2dSJohn Marino                       int half_bit)
1463cf7f2e2dSJohn Marino {
1464cf7f2e2dSJohn Marino   gdbarch->half_bit = half_bit;
1465cf7f2e2dSJohn Marino }
1466cf7f2e2dSJohn Marino 
1467cf7f2e2dSJohn Marino const struct floatformat **
1468cf7f2e2dSJohn Marino gdbarch_half_format (struct gdbarch *gdbarch)
1469cf7f2e2dSJohn Marino {
1470cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
1471cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
1472cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_half_format called\n");
1473cf7f2e2dSJohn Marino   return gdbarch->half_format;
1474cf7f2e2dSJohn Marino }
1475cf7f2e2dSJohn Marino 
1476cf7f2e2dSJohn Marino void
1477cf7f2e2dSJohn Marino set_gdbarch_half_format (struct gdbarch *gdbarch,
1478cf7f2e2dSJohn Marino                          const struct floatformat ** half_format)
1479cf7f2e2dSJohn Marino {
1480cf7f2e2dSJohn Marino   gdbarch->half_format = half_format;
1481cf7f2e2dSJohn Marino }
1482cf7f2e2dSJohn Marino 
1483cf7f2e2dSJohn Marino int
14845796c8dcSSimon Schubert gdbarch_float_bit (struct gdbarch *gdbarch)
14855796c8dcSSimon Schubert {
14865796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
14875796c8dcSSimon Schubert   /* Skip verify of float_bit, invalid_p == 0 */
14885796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
14895796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
14905796c8dcSSimon Schubert   return gdbarch->float_bit;
14915796c8dcSSimon Schubert }
14925796c8dcSSimon Schubert 
14935796c8dcSSimon Schubert void
14945796c8dcSSimon Schubert set_gdbarch_float_bit (struct gdbarch *gdbarch,
14955796c8dcSSimon Schubert                        int float_bit)
14965796c8dcSSimon Schubert {
14975796c8dcSSimon Schubert   gdbarch->float_bit = float_bit;
14985796c8dcSSimon Schubert }
14995796c8dcSSimon Schubert 
15005796c8dcSSimon Schubert const struct floatformat **
15015796c8dcSSimon Schubert gdbarch_float_format (struct gdbarch *gdbarch)
15025796c8dcSSimon Schubert {
15035796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15045796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15055796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
15065796c8dcSSimon Schubert   return gdbarch->float_format;
15075796c8dcSSimon Schubert }
15085796c8dcSSimon Schubert 
15095796c8dcSSimon Schubert void
15105796c8dcSSimon Schubert set_gdbarch_float_format (struct gdbarch *gdbarch,
15115796c8dcSSimon Schubert                           const struct floatformat ** float_format)
15125796c8dcSSimon Schubert {
15135796c8dcSSimon Schubert   gdbarch->float_format = float_format;
15145796c8dcSSimon Schubert }
15155796c8dcSSimon Schubert 
15165796c8dcSSimon Schubert int
15175796c8dcSSimon Schubert gdbarch_double_bit (struct gdbarch *gdbarch)
15185796c8dcSSimon Schubert {
15195796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15205796c8dcSSimon Schubert   /* Skip verify of double_bit, invalid_p == 0 */
15215796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15225796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
15235796c8dcSSimon Schubert   return gdbarch->double_bit;
15245796c8dcSSimon Schubert }
15255796c8dcSSimon Schubert 
15265796c8dcSSimon Schubert void
15275796c8dcSSimon Schubert set_gdbarch_double_bit (struct gdbarch *gdbarch,
15285796c8dcSSimon Schubert                         int double_bit)
15295796c8dcSSimon Schubert {
15305796c8dcSSimon Schubert   gdbarch->double_bit = double_bit;
15315796c8dcSSimon Schubert }
15325796c8dcSSimon Schubert 
15335796c8dcSSimon Schubert const struct floatformat **
15345796c8dcSSimon Schubert gdbarch_double_format (struct gdbarch *gdbarch)
15355796c8dcSSimon Schubert {
15365796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15375796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15385796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
15395796c8dcSSimon Schubert   return gdbarch->double_format;
15405796c8dcSSimon Schubert }
15415796c8dcSSimon Schubert 
15425796c8dcSSimon Schubert void
15435796c8dcSSimon Schubert set_gdbarch_double_format (struct gdbarch *gdbarch,
15445796c8dcSSimon Schubert                            const struct floatformat ** double_format)
15455796c8dcSSimon Schubert {
15465796c8dcSSimon Schubert   gdbarch->double_format = double_format;
15475796c8dcSSimon Schubert }
15485796c8dcSSimon Schubert 
15495796c8dcSSimon Schubert int
15505796c8dcSSimon Schubert gdbarch_long_double_bit (struct gdbarch *gdbarch)
15515796c8dcSSimon Schubert {
15525796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15535796c8dcSSimon Schubert   /* Skip verify of long_double_bit, invalid_p == 0 */
15545796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15555796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
15565796c8dcSSimon Schubert   return gdbarch->long_double_bit;
15575796c8dcSSimon Schubert }
15585796c8dcSSimon Schubert 
15595796c8dcSSimon Schubert void
15605796c8dcSSimon Schubert set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
15615796c8dcSSimon Schubert                              int long_double_bit)
15625796c8dcSSimon Schubert {
15635796c8dcSSimon Schubert   gdbarch->long_double_bit = long_double_bit;
15645796c8dcSSimon Schubert }
15655796c8dcSSimon Schubert 
15665796c8dcSSimon Schubert const struct floatformat **
15675796c8dcSSimon Schubert gdbarch_long_double_format (struct gdbarch *gdbarch)
15685796c8dcSSimon Schubert {
15695796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15705796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15715796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
15725796c8dcSSimon Schubert   return gdbarch->long_double_format;
15735796c8dcSSimon Schubert }
15745796c8dcSSimon Schubert 
15755796c8dcSSimon Schubert void
15765796c8dcSSimon Schubert set_gdbarch_long_double_format (struct gdbarch *gdbarch,
15775796c8dcSSimon Schubert                                 const struct floatformat ** long_double_format)
15785796c8dcSSimon Schubert {
15795796c8dcSSimon Schubert   gdbarch->long_double_format = long_double_format;
15805796c8dcSSimon Schubert }
15815796c8dcSSimon Schubert 
15825796c8dcSSimon Schubert int
15835796c8dcSSimon Schubert gdbarch_ptr_bit (struct gdbarch *gdbarch)
15845796c8dcSSimon Schubert {
15855796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
15865796c8dcSSimon Schubert   /* Skip verify of ptr_bit, invalid_p == 0 */
15875796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
15885796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
15895796c8dcSSimon Schubert   return gdbarch->ptr_bit;
15905796c8dcSSimon Schubert }
15915796c8dcSSimon Schubert 
15925796c8dcSSimon Schubert void
15935796c8dcSSimon Schubert set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
15945796c8dcSSimon Schubert                      int ptr_bit)
15955796c8dcSSimon Schubert {
15965796c8dcSSimon Schubert   gdbarch->ptr_bit = ptr_bit;
15975796c8dcSSimon Schubert }
15985796c8dcSSimon Schubert 
15995796c8dcSSimon Schubert int
16005796c8dcSSimon Schubert gdbarch_addr_bit (struct gdbarch *gdbarch)
16015796c8dcSSimon Schubert {
16025796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16035796c8dcSSimon Schubert   /* Check variable changed from pre-default.  */
16045796c8dcSSimon Schubert   gdb_assert (gdbarch->addr_bit != 0);
16055796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
16065796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
16075796c8dcSSimon Schubert   return gdbarch->addr_bit;
16085796c8dcSSimon Schubert }
16095796c8dcSSimon Schubert 
16105796c8dcSSimon Schubert void
16115796c8dcSSimon Schubert set_gdbarch_addr_bit (struct gdbarch *gdbarch,
16125796c8dcSSimon Schubert                       int addr_bit)
16135796c8dcSSimon Schubert {
16145796c8dcSSimon Schubert   gdbarch->addr_bit = addr_bit;
16155796c8dcSSimon Schubert }
16165796c8dcSSimon Schubert 
16175796c8dcSSimon Schubert int
1618c50c785cSJohn Marino gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch)
1619c50c785cSJohn Marino {
1620c50c785cSJohn Marino   gdb_assert (gdbarch != NULL);
1621c50c785cSJohn Marino   /* Check variable changed from pre-default.  */
1622c50c785cSJohn Marino   gdb_assert (gdbarch->dwarf2_addr_size != 0);
1623c50c785cSJohn Marino   if (gdbarch_debug >= 2)
1624c50c785cSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_addr_size called\n");
1625c50c785cSJohn Marino   return gdbarch->dwarf2_addr_size;
1626c50c785cSJohn Marino }
1627c50c785cSJohn Marino 
1628c50c785cSJohn Marino void
1629c50c785cSJohn Marino set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch,
1630c50c785cSJohn Marino                               int dwarf2_addr_size)
1631c50c785cSJohn Marino {
1632c50c785cSJohn Marino   gdbarch->dwarf2_addr_size = dwarf2_addr_size;
1633c50c785cSJohn Marino }
1634c50c785cSJohn Marino 
1635c50c785cSJohn Marino int
16365796c8dcSSimon Schubert gdbarch_char_signed (struct gdbarch *gdbarch)
16375796c8dcSSimon Schubert {
16385796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16395796c8dcSSimon Schubert   /* Check variable changed from pre-default.  */
16405796c8dcSSimon Schubert   gdb_assert (gdbarch->char_signed != -1);
16415796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
16425796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_char_signed called\n");
16435796c8dcSSimon Schubert   return gdbarch->char_signed;
16445796c8dcSSimon Schubert }
16455796c8dcSSimon Schubert 
16465796c8dcSSimon Schubert void
16475796c8dcSSimon Schubert set_gdbarch_char_signed (struct gdbarch *gdbarch,
16485796c8dcSSimon Schubert                          int char_signed)
16495796c8dcSSimon Schubert {
16505796c8dcSSimon Schubert   gdbarch->char_signed = char_signed;
16515796c8dcSSimon Schubert }
16525796c8dcSSimon Schubert 
16535796c8dcSSimon Schubert int
16545796c8dcSSimon Schubert gdbarch_read_pc_p (struct gdbarch *gdbarch)
16555796c8dcSSimon Schubert {
16565796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16575796c8dcSSimon Schubert   return gdbarch->read_pc != NULL;
16585796c8dcSSimon Schubert }
16595796c8dcSSimon Schubert 
16605796c8dcSSimon Schubert CORE_ADDR
16615796c8dcSSimon Schubert gdbarch_read_pc (struct gdbarch *gdbarch, struct regcache *regcache)
16625796c8dcSSimon Schubert {
16635796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16645796c8dcSSimon Schubert   gdb_assert (gdbarch->read_pc != NULL);
16655796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
16665796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n");
16675796c8dcSSimon Schubert   return gdbarch->read_pc (regcache);
16685796c8dcSSimon Schubert }
16695796c8dcSSimon Schubert 
16705796c8dcSSimon Schubert void
16715796c8dcSSimon Schubert set_gdbarch_read_pc (struct gdbarch *gdbarch,
16725796c8dcSSimon Schubert                      gdbarch_read_pc_ftype read_pc)
16735796c8dcSSimon Schubert {
16745796c8dcSSimon Schubert   gdbarch->read_pc = read_pc;
16755796c8dcSSimon Schubert }
16765796c8dcSSimon Schubert 
16775796c8dcSSimon Schubert int
16785796c8dcSSimon Schubert gdbarch_write_pc_p (struct gdbarch *gdbarch)
16795796c8dcSSimon Schubert {
16805796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16815796c8dcSSimon Schubert   return gdbarch->write_pc != NULL;
16825796c8dcSSimon Schubert }
16835796c8dcSSimon Schubert 
16845796c8dcSSimon Schubert void
16855796c8dcSSimon Schubert gdbarch_write_pc (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR val)
16865796c8dcSSimon Schubert {
16875796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
16885796c8dcSSimon Schubert   gdb_assert (gdbarch->write_pc != NULL);
16895796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
16905796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n");
16915796c8dcSSimon Schubert   gdbarch->write_pc (regcache, val);
16925796c8dcSSimon Schubert }
16935796c8dcSSimon Schubert 
16945796c8dcSSimon Schubert void
16955796c8dcSSimon Schubert set_gdbarch_write_pc (struct gdbarch *gdbarch,
16965796c8dcSSimon Schubert                       gdbarch_write_pc_ftype write_pc)
16975796c8dcSSimon Schubert {
16985796c8dcSSimon Schubert   gdbarch->write_pc = write_pc;
16995796c8dcSSimon Schubert }
17005796c8dcSSimon Schubert 
17015796c8dcSSimon Schubert void
17025796c8dcSSimon Schubert gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
17035796c8dcSSimon Schubert {
17045796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17055796c8dcSSimon Schubert   gdb_assert (gdbarch->virtual_frame_pointer != NULL);
17065796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
17075796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_virtual_frame_pointer called\n");
17085796c8dcSSimon Schubert   gdbarch->virtual_frame_pointer (gdbarch, pc, frame_regnum, frame_offset);
17095796c8dcSSimon Schubert }
17105796c8dcSSimon Schubert 
17115796c8dcSSimon Schubert void
17125796c8dcSSimon Schubert set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
17135796c8dcSSimon Schubert                                    gdbarch_virtual_frame_pointer_ftype virtual_frame_pointer)
17145796c8dcSSimon Schubert {
17155796c8dcSSimon Schubert   gdbarch->virtual_frame_pointer = virtual_frame_pointer;
17165796c8dcSSimon Schubert }
17175796c8dcSSimon Schubert 
17185796c8dcSSimon Schubert int
17195796c8dcSSimon Schubert gdbarch_pseudo_register_read_p (struct gdbarch *gdbarch)
17205796c8dcSSimon Schubert {
17215796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17225796c8dcSSimon Schubert   return gdbarch->pseudo_register_read != NULL;
17235796c8dcSSimon Schubert }
17245796c8dcSSimon Schubert 
1725c50c785cSJohn Marino enum register_status
17265796c8dcSSimon Schubert gdbarch_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, gdb_byte *buf)
17275796c8dcSSimon Schubert {
17285796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17295796c8dcSSimon Schubert   gdb_assert (gdbarch->pseudo_register_read != NULL);
17305796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
17315796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read called\n");
1732c50c785cSJohn Marino   return gdbarch->pseudo_register_read (gdbarch, regcache, cookednum, buf);
17335796c8dcSSimon Schubert }
17345796c8dcSSimon Schubert 
17355796c8dcSSimon Schubert void
17365796c8dcSSimon Schubert set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch,
17375796c8dcSSimon Schubert                                   gdbarch_pseudo_register_read_ftype pseudo_register_read)
17385796c8dcSSimon Schubert {
17395796c8dcSSimon Schubert   gdbarch->pseudo_register_read = pseudo_register_read;
17405796c8dcSSimon Schubert }
17415796c8dcSSimon Schubert 
17425796c8dcSSimon Schubert int
1743*a45ae5f8SJohn Marino gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch)
1744*a45ae5f8SJohn Marino {
1745*a45ae5f8SJohn Marino   gdb_assert (gdbarch != NULL);
1746*a45ae5f8SJohn Marino   return gdbarch->pseudo_register_read_value != NULL;
1747*a45ae5f8SJohn Marino }
1748*a45ae5f8SJohn Marino 
1749*a45ae5f8SJohn Marino struct value *
1750*a45ae5f8SJohn Marino gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum)
1751*a45ae5f8SJohn Marino {
1752*a45ae5f8SJohn Marino   gdb_assert (gdbarch != NULL);
1753*a45ae5f8SJohn Marino   gdb_assert (gdbarch->pseudo_register_read_value != NULL);
1754*a45ae5f8SJohn Marino   if (gdbarch_debug >= 2)
1755*a45ae5f8SJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read_value called\n");
1756*a45ae5f8SJohn Marino   return gdbarch->pseudo_register_read_value (gdbarch, regcache, cookednum);
1757*a45ae5f8SJohn Marino }
1758*a45ae5f8SJohn Marino 
1759*a45ae5f8SJohn Marino void
1760*a45ae5f8SJohn Marino set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch,
1761*a45ae5f8SJohn Marino                                         gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value)
1762*a45ae5f8SJohn Marino {
1763*a45ae5f8SJohn Marino   gdbarch->pseudo_register_read_value = pseudo_register_read_value;
1764*a45ae5f8SJohn Marino }
1765*a45ae5f8SJohn Marino 
1766*a45ae5f8SJohn Marino int
17675796c8dcSSimon Schubert gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
17685796c8dcSSimon Schubert {
17695796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17705796c8dcSSimon Schubert   return gdbarch->pseudo_register_write != NULL;
17715796c8dcSSimon Schubert }
17725796c8dcSSimon Schubert 
17735796c8dcSSimon Schubert void
17745796c8dcSSimon Schubert gdbarch_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum, const gdb_byte *buf)
17755796c8dcSSimon Schubert {
17765796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17775796c8dcSSimon Schubert   gdb_assert (gdbarch->pseudo_register_write != NULL);
17785796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
17795796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_write called\n");
17805796c8dcSSimon Schubert   gdbarch->pseudo_register_write (gdbarch, regcache, cookednum, buf);
17815796c8dcSSimon Schubert }
17825796c8dcSSimon Schubert 
17835796c8dcSSimon Schubert void
17845796c8dcSSimon Schubert set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch,
17855796c8dcSSimon Schubert                                    gdbarch_pseudo_register_write_ftype pseudo_register_write)
17865796c8dcSSimon Schubert {
17875796c8dcSSimon Schubert   gdbarch->pseudo_register_write = pseudo_register_write;
17885796c8dcSSimon Schubert }
17895796c8dcSSimon Schubert 
17905796c8dcSSimon Schubert int
17915796c8dcSSimon Schubert gdbarch_num_regs (struct gdbarch *gdbarch)
17925796c8dcSSimon Schubert {
17935796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
17945796c8dcSSimon Schubert   /* Check variable changed from pre-default.  */
17955796c8dcSSimon Schubert   gdb_assert (gdbarch->num_regs != -1);
17965796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
17975796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n");
17985796c8dcSSimon Schubert   return gdbarch->num_regs;
17995796c8dcSSimon Schubert }
18005796c8dcSSimon Schubert 
18015796c8dcSSimon Schubert void
18025796c8dcSSimon Schubert set_gdbarch_num_regs (struct gdbarch *gdbarch,
18035796c8dcSSimon Schubert                       int num_regs)
18045796c8dcSSimon Schubert {
18055796c8dcSSimon Schubert   gdbarch->num_regs = num_regs;
18065796c8dcSSimon Schubert }
18075796c8dcSSimon Schubert 
18085796c8dcSSimon Schubert int
18095796c8dcSSimon Schubert gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
18105796c8dcSSimon Schubert {
18115796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
18125796c8dcSSimon Schubert   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
18135796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
18145796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
18155796c8dcSSimon Schubert   return gdbarch->num_pseudo_regs;
18165796c8dcSSimon Schubert }
18175796c8dcSSimon Schubert 
18185796c8dcSSimon Schubert void
18195796c8dcSSimon Schubert set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
18205796c8dcSSimon Schubert                              int num_pseudo_regs)
18215796c8dcSSimon Schubert {
18225796c8dcSSimon Schubert   gdbarch->num_pseudo_regs = num_pseudo_regs;
18235796c8dcSSimon Schubert }
18245796c8dcSSimon Schubert 
18255796c8dcSSimon Schubert int
1826c50c785cSJohn Marino gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch)
1827c50c785cSJohn Marino {
1828c50c785cSJohn Marino   gdb_assert (gdbarch != NULL);
1829c50c785cSJohn Marino   return gdbarch->ax_pseudo_register_collect != NULL;
1830c50c785cSJohn Marino }
1831c50c785cSJohn Marino 
1832c50c785cSJohn Marino int
1833c50c785cSJohn Marino gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1834c50c785cSJohn Marino {
1835c50c785cSJohn Marino   gdb_assert (gdbarch != NULL);
1836c50c785cSJohn Marino   gdb_assert (gdbarch->ax_pseudo_register_collect != NULL);
1837c50c785cSJohn Marino   if (gdbarch_debug >= 2)
1838c50c785cSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_collect called\n");
1839c50c785cSJohn Marino   return gdbarch->ax_pseudo_register_collect (gdbarch, ax, reg);
1840c50c785cSJohn Marino }
1841c50c785cSJohn Marino 
1842c50c785cSJohn Marino void
1843c50c785cSJohn Marino set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch,
1844c50c785cSJohn Marino                                         gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
1845c50c785cSJohn Marino {
1846c50c785cSJohn Marino   gdbarch->ax_pseudo_register_collect = ax_pseudo_register_collect;
1847c50c785cSJohn Marino }
1848c50c785cSJohn Marino 
1849c50c785cSJohn Marino int
1850c50c785cSJohn Marino gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch)
1851c50c785cSJohn Marino {
1852c50c785cSJohn Marino   gdb_assert (gdbarch != NULL);
1853c50c785cSJohn Marino   return gdbarch->ax_pseudo_register_push_stack != NULL;
1854c50c785cSJohn Marino }
1855c50c785cSJohn Marino 
1856c50c785cSJohn Marino int
1857c50c785cSJohn Marino gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
1858c50c785cSJohn Marino {
1859c50c785cSJohn Marino   gdb_assert (gdbarch != NULL);
1860c50c785cSJohn Marino   gdb_assert (gdbarch->ax_pseudo_register_push_stack != NULL);
1861c50c785cSJohn Marino   if (gdbarch_debug >= 2)
1862c50c785cSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_push_stack called\n");
1863c50c785cSJohn Marino   return gdbarch->ax_pseudo_register_push_stack (gdbarch, ax, reg);
1864c50c785cSJohn Marino }
1865c50c785cSJohn Marino 
1866c50c785cSJohn Marino void
1867c50c785cSJohn Marino set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
1868c50c785cSJohn Marino                                            gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
1869c50c785cSJohn Marino {
1870c50c785cSJohn Marino   gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
1871c50c785cSJohn Marino }
1872c50c785cSJohn Marino 
1873c50c785cSJohn Marino int
18745796c8dcSSimon Schubert gdbarch_sp_regnum (struct gdbarch *gdbarch)
18755796c8dcSSimon Schubert {
18765796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
18775796c8dcSSimon Schubert   /* Skip verify of sp_regnum, invalid_p == 0 */
18785796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
18795796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
18805796c8dcSSimon Schubert   return gdbarch->sp_regnum;
18815796c8dcSSimon Schubert }
18825796c8dcSSimon Schubert 
18835796c8dcSSimon Schubert void
18845796c8dcSSimon Schubert set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
18855796c8dcSSimon Schubert                        int sp_regnum)
18865796c8dcSSimon Schubert {
18875796c8dcSSimon Schubert   gdbarch->sp_regnum = sp_regnum;
18885796c8dcSSimon Schubert }
18895796c8dcSSimon Schubert 
18905796c8dcSSimon Schubert int
18915796c8dcSSimon Schubert gdbarch_pc_regnum (struct gdbarch *gdbarch)
18925796c8dcSSimon Schubert {
18935796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
18945796c8dcSSimon Schubert   /* Skip verify of pc_regnum, invalid_p == 0 */
18955796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
18965796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
18975796c8dcSSimon Schubert   return gdbarch->pc_regnum;
18985796c8dcSSimon Schubert }
18995796c8dcSSimon Schubert 
19005796c8dcSSimon Schubert void
19015796c8dcSSimon Schubert set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
19025796c8dcSSimon Schubert                        int pc_regnum)
19035796c8dcSSimon Schubert {
19045796c8dcSSimon Schubert   gdbarch->pc_regnum = pc_regnum;
19055796c8dcSSimon Schubert }
19065796c8dcSSimon Schubert 
19075796c8dcSSimon Schubert int
19085796c8dcSSimon Schubert gdbarch_ps_regnum (struct gdbarch *gdbarch)
19095796c8dcSSimon Schubert {
19105796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19115796c8dcSSimon Schubert   /* Skip verify of ps_regnum, invalid_p == 0 */
19125796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19135796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
19145796c8dcSSimon Schubert   return gdbarch->ps_regnum;
19155796c8dcSSimon Schubert }
19165796c8dcSSimon Schubert 
19175796c8dcSSimon Schubert void
19185796c8dcSSimon Schubert set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
19195796c8dcSSimon Schubert                        int ps_regnum)
19205796c8dcSSimon Schubert {
19215796c8dcSSimon Schubert   gdbarch->ps_regnum = ps_regnum;
19225796c8dcSSimon Schubert }
19235796c8dcSSimon Schubert 
19245796c8dcSSimon Schubert int
19255796c8dcSSimon Schubert gdbarch_fp0_regnum (struct gdbarch *gdbarch)
19265796c8dcSSimon Schubert {
19275796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19285796c8dcSSimon Schubert   /* Skip verify of fp0_regnum, invalid_p == 0 */
19295796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19305796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
19315796c8dcSSimon Schubert   return gdbarch->fp0_regnum;
19325796c8dcSSimon Schubert }
19335796c8dcSSimon Schubert 
19345796c8dcSSimon Schubert void
19355796c8dcSSimon Schubert set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
19365796c8dcSSimon Schubert                         int fp0_regnum)
19375796c8dcSSimon Schubert {
19385796c8dcSSimon Schubert   gdbarch->fp0_regnum = fp0_regnum;
19395796c8dcSSimon Schubert }
19405796c8dcSSimon Schubert 
19415796c8dcSSimon Schubert int
19425796c8dcSSimon Schubert gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
19435796c8dcSSimon Schubert {
19445796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19455796c8dcSSimon Schubert   gdb_assert (gdbarch->stab_reg_to_regnum != NULL);
19465796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19475796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
19485796c8dcSSimon Schubert   return gdbarch->stab_reg_to_regnum (gdbarch, stab_regnr);
19495796c8dcSSimon Schubert }
19505796c8dcSSimon Schubert 
19515796c8dcSSimon Schubert void
19525796c8dcSSimon Schubert set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
19535796c8dcSSimon Schubert                                 gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
19545796c8dcSSimon Schubert {
19555796c8dcSSimon Schubert   gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
19565796c8dcSSimon Schubert }
19575796c8dcSSimon Schubert 
19585796c8dcSSimon Schubert int
19595796c8dcSSimon Schubert gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
19605796c8dcSSimon Schubert {
19615796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19625796c8dcSSimon Schubert   gdb_assert (gdbarch->ecoff_reg_to_regnum != NULL);
19635796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19645796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
19655796c8dcSSimon Schubert   return gdbarch->ecoff_reg_to_regnum (gdbarch, ecoff_regnr);
19665796c8dcSSimon Schubert }
19675796c8dcSSimon Schubert 
19685796c8dcSSimon Schubert void
19695796c8dcSSimon Schubert set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
19705796c8dcSSimon Schubert                                  gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
19715796c8dcSSimon Schubert {
19725796c8dcSSimon Schubert   gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
19735796c8dcSSimon Schubert }
19745796c8dcSSimon Schubert 
19755796c8dcSSimon Schubert int
19765796c8dcSSimon Schubert gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
19775796c8dcSSimon Schubert {
19785796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19795796c8dcSSimon Schubert   gdb_assert (gdbarch->sdb_reg_to_regnum != NULL);
19805796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19815796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
19825796c8dcSSimon Schubert   return gdbarch->sdb_reg_to_regnum (gdbarch, sdb_regnr);
19835796c8dcSSimon Schubert }
19845796c8dcSSimon Schubert 
19855796c8dcSSimon Schubert void
19865796c8dcSSimon Schubert set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
19875796c8dcSSimon Schubert                                gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
19885796c8dcSSimon Schubert {
19895796c8dcSSimon Schubert   gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
19905796c8dcSSimon Schubert }
19915796c8dcSSimon Schubert 
19925796c8dcSSimon Schubert int
19935796c8dcSSimon Schubert gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
19945796c8dcSSimon Schubert {
19955796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
19965796c8dcSSimon Schubert   gdb_assert (gdbarch->dwarf2_reg_to_regnum != NULL);
19975796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
19985796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
19995796c8dcSSimon Schubert   return gdbarch->dwarf2_reg_to_regnum (gdbarch, dwarf2_regnr);
20005796c8dcSSimon Schubert }
20015796c8dcSSimon Schubert 
20025796c8dcSSimon Schubert void
20035796c8dcSSimon Schubert set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
20045796c8dcSSimon Schubert                                   gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
20055796c8dcSSimon Schubert {
20065796c8dcSSimon Schubert   gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
20075796c8dcSSimon Schubert }
20085796c8dcSSimon Schubert 
20095796c8dcSSimon Schubert const char *
20105796c8dcSSimon Schubert gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
20115796c8dcSSimon Schubert {
20125796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20135796c8dcSSimon Schubert   gdb_assert (gdbarch->register_name != NULL);
20145796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
20155796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n");
20165796c8dcSSimon Schubert   return gdbarch->register_name (gdbarch, regnr);
20175796c8dcSSimon Schubert }
20185796c8dcSSimon Schubert 
20195796c8dcSSimon Schubert void
20205796c8dcSSimon Schubert set_gdbarch_register_name (struct gdbarch *gdbarch,
20215796c8dcSSimon Schubert                            gdbarch_register_name_ftype register_name)
20225796c8dcSSimon Schubert {
20235796c8dcSSimon Schubert   gdbarch->register_name = register_name;
20245796c8dcSSimon Schubert }
20255796c8dcSSimon Schubert 
20265796c8dcSSimon Schubert int
20275796c8dcSSimon Schubert gdbarch_register_type_p (struct gdbarch *gdbarch)
20285796c8dcSSimon Schubert {
20295796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20305796c8dcSSimon Schubert   return gdbarch->register_type != NULL;
20315796c8dcSSimon Schubert }
20325796c8dcSSimon Schubert 
20335796c8dcSSimon Schubert struct type *
20345796c8dcSSimon Schubert gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr)
20355796c8dcSSimon Schubert {
20365796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20375796c8dcSSimon Schubert   gdb_assert (gdbarch->register_type != NULL);
20385796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
20395796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_type called\n");
20405796c8dcSSimon Schubert   return gdbarch->register_type (gdbarch, reg_nr);
20415796c8dcSSimon Schubert }
20425796c8dcSSimon Schubert 
20435796c8dcSSimon Schubert void
20445796c8dcSSimon Schubert set_gdbarch_register_type (struct gdbarch *gdbarch,
20455796c8dcSSimon Schubert                            gdbarch_register_type_ftype register_type)
20465796c8dcSSimon Schubert {
20475796c8dcSSimon Schubert   gdbarch->register_type = register_type;
20485796c8dcSSimon Schubert }
20495796c8dcSSimon Schubert 
20505796c8dcSSimon Schubert int
20515796c8dcSSimon Schubert gdbarch_dummy_id_p (struct gdbarch *gdbarch)
20525796c8dcSSimon Schubert {
20535796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20545796c8dcSSimon Schubert   return gdbarch->dummy_id != NULL;
20555796c8dcSSimon Schubert }
20565796c8dcSSimon Schubert 
20575796c8dcSSimon Schubert struct frame_id
20585796c8dcSSimon Schubert gdbarch_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
20595796c8dcSSimon Schubert {
20605796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20615796c8dcSSimon Schubert   gdb_assert (gdbarch->dummy_id != NULL);
20625796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
20635796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_dummy_id called\n");
20645796c8dcSSimon Schubert   return gdbarch->dummy_id (gdbarch, this_frame);
20655796c8dcSSimon Schubert }
20665796c8dcSSimon Schubert 
20675796c8dcSSimon Schubert void
20685796c8dcSSimon Schubert set_gdbarch_dummy_id (struct gdbarch *gdbarch,
20695796c8dcSSimon Schubert                       gdbarch_dummy_id_ftype dummy_id)
20705796c8dcSSimon Schubert {
20715796c8dcSSimon Schubert   gdbarch->dummy_id = dummy_id;
20725796c8dcSSimon Schubert }
20735796c8dcSSimon Schubert 
20745796c8dcSSimon Schubert int
20755796c8dcSSimon Schubert gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch)
20765796c8dcSSimon Schubert {
20775796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20785796c8dcSSimon Schubert   /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
20795796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
20805796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fp_regnum called\n");
20815796c8dcSSimon Schubert   return gdbarch->deprecated_fp_regnum;
20825796c8dcSSimon Schubert }
20835796c8dcSSimon Schubert 
20845796c8dcSSimon Schubert void
20855796c8dcSSimon Schubert set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch,
20865796c8dcSSimon Schubert                                   int deprecated_fp_regnum)
20875796c8dcSSimon Schubert {
20885796c8dcSSimon Schubert   gdbarch->deprecated_fp_regnum = deprecated_fp_regnum;
20895796c8dcSSimon Schubert }
20905796c8dcSSimon Schubert 
20915796c8dcSSimon Schubert int
20925796c8dcSSimon Schubert gdbarch_push_dummy_call_p (struct gdbarch *gdbarch)
20935796c8dcSSimon Schubert {
20945796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
20955796c8dcSSimon Schubert   return gdbarch->push_dummy_call != NULL;
20965796c8dcSSimon Schubert }
20975796c8dcSSimon Schubert 
20985796c8dcSSimon Schubert CORE_ADDR
20995796c8dcSSimon Schubert 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)
21005796c8dcSSimon Schubert {
21015796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21025796c8dcSSimon Schubert   gdb_assert (gdbarch->push_dummy_call != NULL);
21035796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
21045796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
21055796c8dcSSimon Schubert   return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
21065796c8dcSSimon Schubert }
21075796c8dcSSimon Schubert 
21085796c8dcSSimon Schubert void
21095796c8dcSSimon Schubert set_gdbarch_push_dummy_call (struct gdbarch *gdbarch,
21105796c8dcSSimon Schubert                              gdbarch_push_dummy_call_ftype push_dummy_call)
21115796c8dcSSimon Schubert {
21125796c8dcSSimon Schubert   gdbarch->push_dummy_call = push_dummy_call;
21135796c8dcSSimon Schubert }
21145796c8dcSSimon Schubert 
21155796c8dcSSimon Schubert int
21165796c8dcSSimon Schubert gdbarch_call_dummy_location (struct gdbarch *gdbarch)
21175796c8dcSSimon Schubert {
21185796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21195796c8dcSSimon Schubert   /* Skip verify of call_dummy_location, invalid_p == 0 */
21205796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
21215796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n");
21225796c8dcSSimon Schubert   return gdbarch->call_dummy_location;
21235796c8dcSSimon Schubert }
21245796c8dcSSimon Schubert 
21255796c8dcSSimon Schubert void
21265796c8dcSSimon Schubert set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
21275796c8dcSSimon Schubert                                  int call_dummy_location)
21285796c8dcSSimon Schubert {
21295796c8dcSSimon Schubert   gdbarch->call_dummy_location = call_dummy_location;
21305796c8dcSSimon Schubert }
21315796c8dcSSimon Schubert 
21325796c8dcSSimon Schubert int
21335796c8dcSSimon Schubert gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
21345796c8dcSSimon Schubert {
21355796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21365796c8dcSSimon Schubert   return gdbarch->push_dummy_code != NULL;
21375796c8dcSSimon Schubert }
21385796c8dcSSimon Schubert 
21395796c8dcSSimon Schubert CORE_ADDR
21405796c8dcSSimon Schubert 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)
21415796c8dcSSimon Schubert {
21425796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21435796c8dcSSimon Schubert   gdb_assert (gdbarch->push_dummy_code != NULL);
21445796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
21455796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_code called\n");
21465796c8dcSSimon Schubert   return gdbarch->push_dummy_code (gdbarch, sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache);
21475796c8dcSSimon Schubert }
21485796c8dcSSimon Schubert 
21495796c8dcSSimon Schubert void
21505796c8dcSSimon Schubert set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
21515796c8dcSSimon Schubert                              gdbarch_push_dummy_code_ftype push_dummy_code)
21525796c8dcSSimon Schubert {
21535796c8dcSSimon Schubert   gdbarch->push_dummy_code = push_dummy_code;
21545796c8dcSSimon Schubert }
21555796c8dcSSimon Schubert 
21565796c8dcSSimon Schubert void
21575796c8dcSSimon Schubert gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
21585796c8dcSSimon Schubert {
21595796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21605796c8dcSSimon Schubert   gdb_assert (gdbarch->print_registers_info != NULL);
21615796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
21625796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_registers_info called\n");
21635796c8dcSSimon Schubert   gdbarch->print_registers_info (gdbarch, file, frame, regnum, all);
21645796c8dcSSimon Schubert }
21655796c8dcSSimon Schubert 
21665796c8dcSSimon Schubert void
21675796c8dcSSimon Schubert set_gdbarch_print_registers_info (struct gdbarch *gdbarch,
21685796c8dcSSimon Schubert                                   gdbarch_print_registers_info_ftype print_registers_info)
21695796c8dcSSimon Schubert {
21705796c8dcSSimon Schubert   gdbarch->print_registers_info = print_registers_info;
21715796c8dcSSimon Schubert }
21725796c8dcSSimon Schubert 
21735796c8dcSSimon Schubert int
21745796c8dcSSimon Schubert gdbarch_print_float_info_p (struct gdbarch *gdbarch)
21755796c8dcSSimon Schubert {
21765796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21775796c8dcSSimon Schubert   return gdbarch->print_float_info != NULL;
21785796c8dcSSimon Schubert }
21795796c8dcSSimon Schubert 
21805796c8dcSSimon Schubert void
21815796c8dcSSimon Schubert gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
21825796c8dcSSimon Schubert {
21835796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
21845796c8dcSSimon Schubert   gdb_assert (gdbarch->print_float_info != NULL);
21855796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
21865796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
21875796c8dcSSimon Schubert   gdbarch->print_float_info (gdbarch, file, frame, args);
21885796c8dcSSimon Schubert }
21895796c8dcSSimon Schubert 
21905796c8dcSSimon Schubert void
21915796c8dcSSimon Schubert set_gdbarch_print_float_info (struct gdbarch *gdbarch,
21925796c8dcSSimon Schubert                               gdbarch_print_float_info_ftype print_float_info)
21935796c8dcSSimon Schubert {
21945796c8dcSSimon Schubert   gdbarch->print_float_info = print_float_info;
21955796c8dcSSimon Schubert }
21965796c8dcSSimon Schubert 
21975796c8dcSSimon Schubert int
21985796c8dcSSimon Schubert gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
21995796c8dcSSimon Schubert {
22005796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22015796c8dcSSimon Schubert   return gdbarch->print_vector_info != NULL;
22025796c8dcSSimon Schubert }
22035796c8dcSSimon Schubert 
22045796c8dcSSimon Schubert void
22055796c8dcSSimon Schubert gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
22065796c8dcSSimon Schubert {
22075796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22085796c8dcSSimon Schubert   gdb_assert (gdbarch->print_vector_info != NULL);
22095796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
22105796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
22115796c8dcSSimon Schubert   gdbarch->print_vector_info (gdbarch, file, frame, args);
22125796c8dcSSimon Schubert }
22135796c8dcSSimon Schubert 
22145796c8dcSSimon Schubert void
22155796c8dcSSimon Schubert set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
22165796c8dcSSimon Schubert                                gdbarch_print_vector_info_ftype print_vector_info)
22175796c8dcSSimon Schubert {
22185796c8dcSSimon Schubert   gdbarch->print_vector_info = print_vector_info;
22195796c8dcSSimon Schubert }
22205796c8dcSSimon Schubert 
22215796c8dcSSimon Schubert int
22225796c8dcSSimon Schubert gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
22235796c8dcSSimon Schubert {
22245796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22255796c8dcSSimon Schubert   gdb_assert (gdbarch->register_sim_regno != NULL);
22265796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
22275796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n");
22285796c8dcSSimon Schubert   return gdbarch->register_sim_regno (gdbarch, reg_nr);
22295796c8dcSSimon Schubert }
22305796c8dcSSimon Schubert 
22315796c8dcSSimon Schubert void
22325796c8dcSSimon Schubert set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
22335796c8dcSSimon Schubert                                 gdbarch_register_sim_regno_ftype register_sim_regno)
22345796c8dcSSimon Schubert {
22355796c8dcSSimon Schubert   gdbarch->register_sim_regno = register_sim_regno;
22365796c8dcSSimon Schubert }
22375796c8dcSSimon Schubert 
22385796c8dcSSimon Schubert int
22395796c8dcSSimon Schubert gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
22405796c8dcSSimon Schubert {
22415796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22425796c8dcSSimon Schubert   gdb_assert (gdbarch->cannot_fetch_register != NULL);
22435796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
22445796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
22455796c8dcSSimon Schubert   return gdbarch->cannot_fetch_register (gdbarch, regnum);
22465796c8dcSSimon Schubert }
22475796c8dcSSimon Schubert 
22485796c8dcSSimon Schubert void
22495796c8dcSSimon Schubert set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
22505796c8dcSSimon Schubert                                    gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
22515796c8dcSSimon Schubert {
22525796c8dcSSimon Schubert   gdbarch->cannot_fetch_register = cannot_fetch_register;
22535796c8dcSSimon Schubert }
22545796c8dcSSimon Schubert 
22555796c8dcSSimon Schubert int
22565796c8dcSSimon Schubert gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
22575796c8dcSSimon Schubert {
22585796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22595796c8dcSSimon Schubert   gdb_assert (gdbarch->cannot_store_register != NULL);
22605796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
22615796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
22625796c8dcSSimon Schubert   return gdbarch->cannot_store_register (gdbarch, regnum);
22635796c8dcSSimon Schubert }
22645796c8dcSSimon Schubert 
22655796c8dcSSimon Schubert void
22665796c8dcSSimon Schubert set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
22675796c8dcSSimon Schubert                                    gdbarch_cannot_store_register_ftype cannot_store_register)
22685796c8dcSSimon Schubert {
22695796c8dcSSimon Schubert   gdbarch->cannot_store_register = cannot_store_register;
22705796c8dcSSimon Schubert }
22715796c8dcSSimon Schubert 
22725796c8dcSSimon Schubert int
22735796c8dcSSimon Schubert gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
22745796c8dcSSimon Schubert {
22755796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22765796c8dcSSimon Schubert   return gdbarch->get_longjmp_target != NULL;
22775796c8dcSSimon Schubert }
22785796c8dcSSimon Schubert 
22795796c8dcSSimon Schubert int
22805796c8dcSSimon Schubert gdbarch_get_longjmp_target (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR *pc)
22815796c8dcSSimon Schubert {
22825796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
22835796c8dcSSimon Schubert   gdb_assert (gdbarch->get_longjmp_target != NULL);
22845796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
22855796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
22865796c8dcSSimon Schubert   return gdbarch->get_longjmp_target (frame, pc);
22875796c8dcSSimon Schubert }
22885796c8dcSSimon Schubert 
22895796c8dcSSimon Schubert void
22905796c8dcSSimon Schubert set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
22915796c8dcSSimon Schubert                                 gdbarch_get_longjmp_target_ftype get_longjmp_target)
22925796c8dcSSimon Schubert {
22935796c8dcSSimon Schubert   gdbarch->get_longjmp_target = get_longjmp_target;
22945796c8dcSSimon Schubert }
22955796c8dcSSimon Schubert 
22965796c8dcSSimon Schubert int
22975796c8dcSSimon Schubert gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
22985796c8dcSSimon Schubert {
22995796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23005796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23015796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
23025796c8dcSSimon Schubert   return gdbarch->believe_pcc_promotion;
23035796c8dcSSimon Schubert }
23045796c8dcSSimon Schubert 
23055796c8dcSSimon Schubert void
23065796c8dcSSimon Schubert set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
23075796c8dcSSimon Schubert                                    int believe_pcc_promotion)
23085796c8dcSSimon Schubert {
23095796c8dcSSimon Schubert   gdbarch->believe_pcc_promotion = believe_pcc_promotion;
23105796c8dcSSimon Schubert }
23115796c8dcSSimon Schubert 
23125796c8dcSSimon Schubert int
23135796c8dcSSimon Schubert gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
23145796c8dcSSimon Schubert {
23155796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23165796c8dcSSimon Schubert   gdb_assert (gdbarch->convert_register_p != NULL);
23175796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23185796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_register_p called\n");
23195796c8dcSSimon Schubert   return gdbarch->convert_register_p (gdbarch, regnum, type);
23205796c8dcSSimon Schubert }
23215796c8dcSSimon Schubert 
23225796c8dcSSimon Schubert void
23235796c8dcSSimon Schubert set_gdbarch_convert_register_p (struct gdbarch *gdbarch,
23245796c8dcSSimon Schubert                                 gdbarch_convert_register_p_ftype convert_register_p)
23255796c8dcSSimon Schubert {
23265796c8dcSSimon Schubert   gdbarch->convert_register_p = convert_register_p;
23275796c8dcSSimon Schubert }
23285796c8dcSSimon Schubert 
2329c50c785cSJohn Marino int
2330c50c785cSJohn Marino gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf, int *optimizedp, int *unavailablep)
23315796c8dcSSimon Schubert {
23325796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23335796c8dcSSimon Schubert   gdb_assert (gdbarch->register_to_value != NULL);
23345796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23355796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_to_value called\n");
2336c50c785cSJohn Marino   return gdbarch->register_to_value (frame, regnum, type, buf, optimizedp, unavailablep);
23375796c8dcSSimon Schubert }
23385796c8dcSSimon Schubert 
23395796c8dcSSimon Schubert void
23405796c8dcSSimon Schubert set_gdbarch_register_to_value (struct gdbarch *gdbarch,
23415796c8dcSSimon Schubert                                gdbarch_register_to_value_ftype register_to_value)
23425796c8dcSSimon Schubert {
23435796c8dcSSimon Schubert   gdbarch->register_to_value = register_to_value;
23445796c8dcSSimon Schubert }
23455796c8dcSSimon Schubert 
23465796c8dcSSimon Schubert void
23475796c8dcSSimon Schubert gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf)
23485796c8dcSSimon Schubert {
23495796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23505796c8dcSSimon Schubert   gdb_assert (gdbarch->value_to_register != NULL);
23515796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23525796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_value_to_register called\n");
23535796c8dcSSimon Schubert   gdbarch->value_to_register (frame, regnum, type, buf);
23545796c8dcSSimon Schubert }
23555796c8dcSSimon Schubert 
23565796c8dcSSimon Schubert void
23575796c8dcSSimon Schubert set_gdbarch_value_to_register (struct gdbarch *gdbarch,
23585796c8dcSSimon Schubert                                gdbarch_value_to_register_ftype value_to_register)
23595796c8dcSSimon Schubert {
23605796c8dcSSimon Schubert   gdbarch->value_to_register = value_to_register;
23615796c8dcSSimon Schubert }
23625796c8dcSSimon Schubert 
23635796c8dcSSimon Schubert struct value *
23645796c8dcSSimon Schubert gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_info *frame)
23655796c8dcSSimon Schubert {
23665796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23675796c8dcSSimon Schubert   gdb_assert (gdbarch->value_from_register != NULL);
23685796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23695796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_value_from_register called\n");
23705796c8dcSSimon Schubert   return gdbarch->value_from_register (type, regnum, frame);
23715796c8dcSSimon Schubert }
23725796c8dcSSimon Schubert 
23735796c8dcSSimon Schubert void
23745796c8dcSSimon Schubert set_gdbarch_value_from_register (struct gdbarch *gdbarch,
23755796c8dcSSimon Schubert                                  gdbarch_value_from_register_ftype value_from_register)
23765796c8dcSSimon Schubert {
23775796c8dcSSimon Schubert   gdbarch->value_from_register = value_from_register;
23785796c8dcSSimon Schubert }
23795796c8dcSSimon Schubert 
23805796c8dcSSimon Schubert CORE_ADDR
23815796c8dcSSimon Schubert gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
23825796c8dcSSimon Schubert {
23835796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
23845796c8dcSSimon Schubert   gdb_assert (gdbarch->pointer_to_address != NULL);
23855796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
23865796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n");
23875796c8dcSSimon Schubert   return gdbarch->pointer_to_address (gdbarch, type, buf);
23885796c8dcSSimon Schubert }
23895796c8dcSSimon Schubert 
23905796c8dcSSimon Schubert void
23915796c8dcSSimon Schubert set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
23925796c8dcSSimon Schubert                                 gdbarch_pointer_to_address_ftype pointer_to_address)
23935796c8dcSSimon Schubert {
23945796c8dcSSimon Schubert   gdbarch->pointer_to_address = pointer_to_address;
23955796c8dcSSimon Schubert }
23965796c8dcSSimon Schubert 
23975796c8dcSSimon Schubert void
23985796c8dcSSimon Schubert gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
23995796c8dcSSimon Schubert {
24005796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24015796c8dcSSimon Schubert   gdb_assert (gdbarch->address_to_pointer != NULL);
24025796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
24035796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n");
24045796c8dcSSimon Schubert   gdbarch->address_to_pointer (gdbarch, type, buf, addr);
24055796c8dcSSimon Schubert }
24065796c8dcSSimon Schubert 
24075796c8dcSSimon Schubert void
24085796c8dcSSimon Schubert set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
24095796c8dcSSimon Schubert                                 gdbarch_address_to_pointer_ftype address_to_pointer)
24105796c8dcSSimon Schubert {
24115796c8dcSSimon Schubert   gdbarch->address_to_pointer = address_to_pointer;
24125796c8dcSSimon Schubert }
24135796c8dcSSimon Schubert 
24145796c8dcSSimon Schubert int
24155796c8dcSSimon Schubert gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
24165796c8dcSSimon Schubert {
24175796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24185796c8dcSSimon Schubert   return gdbarch->integer_to_address != NULL;
24195796c8dcSSimon Schubert }
24205796c8dcSSimon Schubert 
24215796c8dcSSimon Schubert CORE_ADDR
24225796c8dcSSimon Schubert gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
24235796c8dcSSimon Schubert {
24245796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24255796c8dcSSimon Schubert   gdb_assert (gdbarch->integer_to_address != NULL);
24265796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
24275796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n");
24285796c8dcSSimon Schubert   return gdbarch->integer_to_address (gdbarch, type, buf);
24295796c8dcSSimon Schubert }
24305796c8dcSSimon Schubert 
24315796c8dcSSimon Schubert void
24325796c8dcSSimon Schubert set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
24335796c8dcSSimon Schubert                                 gdbarch_integer_to_address_ftype integer_to_address)
24345796c8dcSSimon Schubert {
24355796c8dcSSimon Schubert   gdbarch->integer_to_address = integer_to_address;
24365796c8dcSSimon Schubert }
24375796c8dcSSimon Schubert 
24385796c8dcSSimon Schubert int
24395796c8dcSSimon Schubert gdbarch_return_value_p (struct gdbarch *gdbarch)
24405796c8dcSSimon Schubert {
24415796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24425796c8dcSSimon Schubert   return gdbarch->return_value != NULL;
24435796c8dcSSimon Schubert }
24445796c8dcSSimon Schubert 
24455796c8dcSSimon Schubert enum return_value_convention
24465796c8dcSSimon Schubert gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
24475796c8dcSSimon Schubert {
24485796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24495796c8dcSSimon Schubert   gdb_assert (gdbarch->return_value != NULL);
24505796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
24515796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
24525796c8dcSSimon Schubert   return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
24535796c8dcSSimon Schubert }
24545796c8dcSSimon Schubert 
24555796c8dcSSimon Schubert void
24565796c8dcSSimon Schubert set_gdbarch_return_value (struct gdbarch *gdbarch,
24575796c8dcSSimon Schubert                           gdbarch_return_value_ftype return_value)
24585796c8dcSSimon Schubert {
24595796c8dcSSimon Schubert   gdbarch->return_value = return_value;
24605796c8dcSSimon Schubert }
24615796c8dcSSimon Schubert 
24625796c8dcSSimon Schubert CORE_ADDR
24635796c8dcSSimon Schubert gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
24645796c8dcSSimon Schubert {
24655796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24665796c8dcSSimon Schubert   gdb_assert (gdbarch->skip_prologue != NULL);
24675796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
24685796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n");
24695796c8dcSSimon Schubert   return gdbarch->skip_prologue (gdbarch, ip);
24705796c8dcSSimon Schubert }
24715796c8dcSSimon Schubert 
24725796c8dcSSimon Schubert void
24735796c8dcSSimon Schubert set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
24745796c8dcSSimon Schubert                            gdbarch_skip_prologue_ftype skip_prologue)
24755796c8dcSSimon Schubert {
24765796c8dcSSimon Schubert   gdbarch->skip_prologue = skip_prologue;
24775796c8dcSSimon Schubert }
24785796c8dcSSimon Schubert 
24795796c8dcSSimon Schubert int
24805796c8dcSSimon Schubert gdbarch_skip_main_prologue_p (struct gdbarch *gdbarch)
24815796c8dcSSimon Schubert {
24825796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24835796c8dcSSimon Schubert   return gdbarch->skip_main_prologue != NULL;
24845796c8dcSSimon Schubert }
24855796c8dcSSimon Schubert 
24865796c8dcSSimon Schubert CORE_ADDR
24875796c8dcSSimon Schubert gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
24885796c8dcSSimon Schubert {
24895796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
24905796c8dcSSimon Schubert   gdb_assert (gdbarch->skip_main_prologue != NULL);
24915796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
24925796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_main_prologue called\n");
24935796c8dcSSimon Schubert   return gdbarch->skip_main_prologue (gdbarch, ip);
24945796c8dcSSimon Schubert }
24955796c8dcSSimon Schubert 
24965796c8dcSSimon Schubert void
24975796c8dcSSimon Schubert set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch,
24985796c8dcSSimon Schubert                                 gdbarch_skip_main_prologue_ftype skip_main_prologue)
24995796c8dcSSimon Schubert {
25005796c8dcSSimon Schubert   gdbarch->skip_main_prologue = skip_main_prologue;
25015796c8dcSSimon Schubert }
25025796c8dcSSimon Schubert 
25035796c8dcSSimon Schubert int
25045796c8dcSSimon Schubert gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
25055796c8dcSSimon Schubert {
25065796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25075796c8dcSSimon Schubert   gdb_assert (gdbarch->inner_than != NULL);
25085796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
25095796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n");
25105796c8dcSSimon Schubert   return gdbarch->inner_than (lhs, rhs);
25115796c8dcSSimon Schubert }
25125796c8dcSSimon Schubert 
25135796c8dcSSimon Schubert void
25145796c8dcSSimon Schubert set_gdbarch_inner_than (struct gdbarch *gdbarch,
25155796c8dcSSimon Schubert                         gdbarch_inner_than_ftype inner_than)
25165796c8dcSSimon Schubert {
25175796c8dcSSimon Schubert   gdbarch->inner_than = inner_than;
25185796c8dcSSimon Schubert }
25195796c8dcSSimon Schubert 
25205796c8dcSSimon Schubert const gdb_byte *
25215796c8dcSSimon Schubert gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
25225796c8dcSSimon Schubert {
25235796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25245796c8dcSSimon Schubert   gdb_assert (gdbarch->breakpoint_from_pc != NULL);
25255796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
25265796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n");
25275796c8dcSSimon Schubert   return gdbarch->breakpoint_from_pc (gdbarch, pcptr, lenptr);
25285796c8dcSSimon Schubert }
25295796c8dcSSimon Schubert 
25305796c8dcSSimon Schubert void
25315796c8dcSSimon Schubert set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
25325796c8dcSSimon Schubert                                 gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
25335796c8dcSSimon Schubert {
25345796c8dcSSimon Schubert   gdbarch->breakpoint_from_pc = breakpoint_from_pc;
25355796c8dcSSimon Schubert }
25365796c8dcSSimon Schubert 
2537cf7f2e2dSJohn Marino void
2538cf7f2e2dSJohn Marino gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
2539cf7f2e2dSJohn Marino {
2540cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
2541cf7f2e2dSJohn Marino   gdb_assert (gdbarch->remote_breakpoint_from_pc != NULL);
2542cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
2543cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_breakpoint_from_pc called\n");
2544cf7f2e2dSJohn Marino   gdbarch->remote_breakpoint_from_pc (gdbarch, pcptr, kindptr);
2545cf7f2e2dSJohn Marino }
2546cf7f2e2dSJohn Marino 
2547cf7f2e2dSJohn Marino void
2548cf7f2e2dSJohn Marino set_gdbarch_remote_breakpoint_from_pc (struct gdbarch *gdbarch,
2549cf7f2e2dSJohn Marino                                        gdbarch_remote_breakpoint_from_pc_ftype remote_breakpoint_from_pc)
2550cf7f2e2dSJohn Marino {
2551cf7f2e2dSJohn Marino   gdbarch->remote_breakpoint_from_pc = remote_breakpoint_from_pc;
2552cf7f2e2dSJohn Marino }
2553cf7f2e2dSJohn Marino 
25545796c8dcSSimon Schubert int
25555796c8dcSSimon Schubert gdbarch_adjust_breakpoint_address_p (struct gdbarch *gdbarch)
25565796c8dcSSimon Schubert {
25575796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25585796c8dcSSimon Schubert   return gdbarch->adjust_breakpoint_address != NULL;
25595796c8dcSSimon Schubert }
25605796c8dcSSimon Schubert 
25615796c8dcSSimon Schubert CORE_ADDR
25625796c8dcSSimon Schubert gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
25635796c8dcSSimon Schubert {
25645796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25655796c8dcSSimon Schubert   gdb_assert (gdbarch->adjust_breakpoint_address != NULL);
25665796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
25675796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_adjust_breakpoint_address called\n");
25685796c8dcSSimon Schubert   return gdbarch->adjust_breakpoint_address (gdbarch, bpaddr);
25695796c8dcSSimon Schubert }
25705796c8dcSSimon Schubert 
25715796c8dcSSimon Schubert void
25725796c8dcSSimon Schubert set_gdbarch_adjust_breakpoint_address (struct gdbarch *gdbarch,
25735796c8dcSSimon Schubert                                        gdbarch_adjust_breakpoint_address_ftype adjust_breakpoint_address)
25745796c8dcSSimon Schubert {
25755796c8dcSSimon Schubert   gdbarch->adjust_breakpoint_address = adjust_breakpoint_address;
25765796c8dcSSimon Schubert }
25775796c8dcSSimon Schubert 
25785796c8dcSSimon Schubert int
25795796c8dcSSimon Schubert gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
25805796c8dcSSimon Schubert {
25815796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25825796c8dcSSimon Schubert   gdb_assert (gdbarch->memory_insert_breakpoint != NULL);
25835796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
25845796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n");
25855796c8dcSSimon Schubert   return gdbarch->memory_insert_breakpoint (gdbarch, bp_tgt);
25865796c8dcSSimon Schubert }
25875796c8dcSSimon Schubert 
25885796c8dcSSimon Schubert void
25895796c8dcSSimon Schubert set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
25905796c8dcSSimon Schubert                                       gdbarch_memory_insert_breakpoint_ftype memory_insert_breakpoint)
25915796c8dcSSimon Schubert {
25925796c8dcSSimon Schubert   gdbarch->memory_insert_breakpoint = memory_insert_breakpoint;
25935796c8dcSSimon Schubert }
25945796c8dcSSimon Schubert 
25955796c8dcSSimon Schubert int
25965796c8dcSSimon Schubert gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
25975796c8dcSSimon Schubert {
25985796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
25995796c8dcSSimon Schubert   gdb_assert (gdbarch->memory_remove_breakpoint != NULL);
26005796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26015796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n");
26025796c8dcSSimon Schubert   return gdbarch->memory_remove_breakpoint (gdbarch, bp_tgt);
26035796c8dcSSimon Schubert }
26045796c8dcSSimon Schubert 
26055796c8dcSSimon Schubert void
26065796c8dcSSimon Schubert set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
26075796c8dcSSimon Schubert                                       gdbarch_memory_remove_breakpoint_ftype memory_remove_breakpoint)
26085796c8dcSSimon Schubert {
26095796c8dcSSimon Schubert   gdbarch->memory_remove_breakpoint = memory_remove_breakpoint;
26105796c8dcSSimon Schubert }
26115796c8dcSSimon Schubert 
26125796c8dcSSimon Schubert CORE_ADDR
26135796c8dcSSimon Schubert gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
26145796c8dcSSimon Schubert {
26155796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26165796c8dcSSimon Schubert   /* Skip verify of decr_pc_after_break, invalid_p == 0 */
26175796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26185796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n");
26195796c8dcSSimon Schubert   return gdbarch->decr_pc_after_break;
26205796c8dcSSimon Schubert }
26215796c8dcSSimon Schubert 
26225796c8dcSSimon Schubert void
26235796c8dcSSimon Schubert set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
26245796c8dcSSimon Schubert                                  CORE_ADDR decr_pc_after_break)
26255796c8dcSSimon Schubert {
26265796c8dcSSimon Schubert   gdbarch->decr_pc_after_break = decr_pc_after_break;
26275796c8dcSSimon Schubert }
26285796c8dcSSimon Schubert 
26295796c8dcSSimon Schubert CORE_ADDR
26305796c8dcSSimon Schubert gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
26315796c8dcSSimon Schubert {
26325796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26335796c8dcSSimon Schubert   /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
26345796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26355796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
26365796c8dcSSimon Schubert   return gdbarch->deprecated_function_start_offset;
26375796c8dcSSimon Schubert }
26385796c8dcSSimon Schubert 
26395796c8dcSSimon Schubert void
26405796c8dcSSimon Schubert set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
26415796c8dcSSimon Schubert                                               CORE_ADDR deprecated_function_start_offset)
26425796c8dcSSimon Schubert {
26435796c8dcSSimon Schubert   gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
26445796c8dcSSimon Schubert }
26455796c8dcSSimon Schubert 
26465796c8dcSSimon Schubert int
26475796c8dcSSimon Schubert gdbarch_remote_register_number (struct gdbarch *gdbarch, int regno)
26485796c8dcSSimon Schubert {
26495796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26505796c8dcSSimon Schubert   gdb_assert (gdbarch->remote_register_number != NULL);
26515796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26525796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_register_number called\n");
26535796c8dcSSimon Schubert   return gdbarch->remote_register_number (gdbarch, regno);
26545796c8dcSSimon Schubert }
26555796c8dcSSimon Schubert 
26565796c8dcSSimon Schubert void
26575796c8dcSSimon Schubert set_gdbarch_remote_register_number (struct gdbarch *gdbarch,
26585796c8dcSSimon Schubert                                     gdbarch_remote_register_number_ftype remote_register_number)
26595796c8dcSSimon Schubert {
26605796c8dcSSimon Schubert   gdbarch->remote_register_number = remote_register_number;
26615796c8dcSSimon Schubert }
26625796c8dcSSimon Schubert 
26635796c8dcSSimon Schubert int
26645796c8dcSSimon Schubert gdbarch_fetch_tls_load_module_address_p (struct gdbarch *gdbarch)
26655796c8dcSSimon Schubert {
26665796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26675796c8dcSSimon Schubert   return gdbarch->fetch_tls_load_module_address != NULL;
26685796c8dcSSimon Schubert }
26695796c8dcSSimon Schubert 
26705796c8dcSSimon Schubert CORE_ADDR
26715796c8dcSSimon Schubert gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch, struct objfile *objfile)
26725796c8dcSSimon Schubert {
26735796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26745796c8dcSSimon Schubert   gdb_assert (gdbarch->fetch_tls_load_module_address != NULL);
26755796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26765796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_tls_load_module_address called\n");
26775796c8dcSSimon Schubert   return gdbarch->fetch_tls_load_module_address (objfile);
26785796c8dcSSimon Schubert }
26795796c8dcSSimon Schubert 
26805796c8dcSSimon Schubert void
26815796c8dcSSimon Schubert set_gdbarch_fetch_tls_load_module_address (struct gdbarch *gdbarch,
26825796c8dcSSimon Schubert                                            gdbarch_fetch_tls_load_module_address_ftype fetch_tls_load_module_address)
26835796c8dcSSimon Schubert {
26845796c8dcSSimon Schubert   gdbarch->fetch_tls_load_module_address = fetch_tls_load_module_address;
26855796c8dcSSimon Schubert }
26865796c8dcSSimon Schubert 
26875796c8dcSSimon Schubert CORE_ADDR
26885796c8dcSSimon Schubert gdbarch_frame_args_skip (struct gdbarch *gdbarch)
26895796c8dcSSimon Schubert {
26905796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
26915796c8dcSSimon Schubert   /* Skip verify of frame_args_skip, invalid_p == 0 */
26925796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
26935796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n");
26945796c8dcSSimon Schubert   return gdbarch->frame_args_skip;
26955796c8dcSSimon Schubert }
26965796c8dcSSimon Schubert 
26975796c8dcSSimon Schubert void
26985796c8dcSSimon Schubert set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
26995796c8dcSSimon Schubert                              CORE_ADDR frame_args_skip)
27005796c8dcSSimon Schubert {
27015796c8dcSSimon Schubert   gdbarch->frame_args_skip = frame_args_skip;
27025796c8dcSSimon Schubert }
27035796c8dcSSimon Schubert 
27045796c8dcSSimon Schubert int
27055796c8dcSSimon Schubert gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
27065796c8dcSSimon Schubert {
27075796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27085796c8dcSSimon Schubert   return gdbarch->unwind_pc != NULL;
27095796c8dcSSimon Schubert }
27105796c8dcSSimon Schubert 
27115796c8dcSSimon Schubert CORE_ADDR
27125796c8dcSSimon Schubert gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
27135796c8dcSSimon Schubert {
27145796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27155796c8dcSSimon Schubert   gdb_assert (gdbarch->unwind_pc != NULL);
27165796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
27175796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
27185796c8dcSSimon Schubert   return gdbarch->unwind_pc (gdbarch, next_frame);
27195796c8dcSSimon Schubert }
27205796c8dcSSimon Schubert 
27215796c8dcSSimon Schubert void
27225796c8dcSSimon Schubert set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
27235796c8dcSSimon Schubert                        gdbarch_unwind_pc_ftype unwind_pc)
27245796c8dcSSimon Schubert {
27255796c8dcSSimon Schubert   gdbarch->unwind_pc = unwind_pc;
27265796c8dcSSimon Schubert }
27275796c8dcSSimon Schubert 
27285796c8dcSSimon Schubert int
27295796c8dcSSimon Schubert gdbarch_unwind_sp_p (struct gdbarch *gdbarch)
27305796c8dcSSimon Schubert {
27315796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27325796c8dcSSimon Schubert   return gdbarch->unwind_sp != NULL;
27335796c8dcSSimon Schubert }
27345796c8dcSSimon Schubert 
27355796c8dcSSimon Schubert CORE_ADDR
27365796c8dcSSimon Schubert gdbarch_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
27375796c8dcSSimon Schubert {
27385796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27395796c8dcSSimon Schubert   gdb_assert (gdbarch->unwind_sp != NULL);
27405796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
27415796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_sp called\n");
27425796c8dcSSimon Schubert   return gdbarch->unwind_sp (gdbarch, next_frame);
27435796c8dcSSimon Schubert }
27445796c8dcSSimon Schubert 
27455796c8dcSSimon Schubert void
27465796c8dcSSimon Schubert set_gdbarch_unwind_sp (struct gdbarch *gdbarch,
27475796c8dcSSimon Schubert                        gdbarch_unwind_sp_ftype unwind_sp)
27485796c8dcSSimon Schubert {
27495796c8dcSSimon Schubert   gdbarch->unwind_sp = unwind_sp;
27505796c8dcSSimon Schubert }
27515796c8dcSSimon Schubert 
27525796c8dcSSimon Schubert int
27535796c8dcSSimon Schubert gdbarch_frame_num_args_p (struct gdbarch *gdbarch)
27545796c8dcSSimon Schubert {
27555796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27565796c8dcSSimon Schubert   return gdbarch->frame_num_args != NULL;
27575796c8dcSSimon Schubert }
27585796c8dcSSimon Schubert 
27595796c8dcSSimon Schubert int
27605796c8dcSSimon Schubert gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
27615796c8dcSSimon Schubert {
27625796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27635796c8dcSSimon Schubert   gdb_assert (gdbarch->frame_num_args != NULL);
27645796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
27655796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n");
27665796c8dcSSimon Schubert   return gdbarch->frame_num_args (frame);
27675796c8dcSSimon Schubert }
27685796c8dcSSimon Schubert 
27695796c8dcSSimon Schubert void
27705796c8dcSSimon Schubert set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
27715796c8dcSSimon Schubert                             gdbarch_frame_num_args_ftype frame_num_args)
27725796c8dcSSimon Schubert {
27735796c8dcSSimon Schubert   gdbarch->frame_num_args = frame_num_args;
27745796c8dcSSimon Schubert }
27755796c8dcSSimon Schubert 
27765796c8dcSSimon Schubert int
27775796c8dcSSimon Schubert gdbarch_frame_align_p (struct gdbarch *gdbarch)
27785796c8dcSSimon Schubert {
27795796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27805796c8dcSSimon Schubert   return gdbarch->frame_align != NULL;
27815796c8dcSSimon Schubert }
27825796c8dcSSimon Schubert 
27835796c8dcSSimon Schubert CORE_ADDR
27845796c8dcSSimon Schubert gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
27855796c8dcSSimon Schubert {
27865796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
27875796c8dcSSimon Schubert   gdb_assert (gdbarch->frame_align != NULL);
27885796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
27895796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_align called\n");
27905796c8dcSSimon Schubert   return gdbarch->frame_align (gdbarch, address);
27915796c8dcSSimon Schubert }
27925796c8dcSSimon Schubert 
27935796c8dcSSimon Schubert void
27945796c8dcSSimon Schubert set_gdbarch_frame_align (struct gdbarch *gdbarch,
27955796c8dcSSimon Schubert                          gdbarch_frame_align_ftype frame_align)
27965796c8dcSSimon Schubert {
27975796c8dcSSimon Schubert   gdbarch->frame_align = frame_align;
27985796c8dcSSimon Schubert }
27995796c8dcSSimon Schubert 
28005796c8dcSSimon Schubert int
28015796c8dcSSimon Schubert gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
28025796c8dcSSimon Schubert {
28035796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28045796c8dcSSimon Schubert   gdb_assert (gdbarch->stabs_argument_has_addr != NULL);
28055796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28065796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_stabs_argument_has_addr called\n");
28075796c8dcSSimon Schubert   return gdbarch->stabs_argument_has_addr (gdbarch, type);
28085796c8dcSSimon Schubert }
28095796c8dcSSimon Schubert 
28105796c8dcSSimon Schubert void
28115796c8dcSSimon Schubert set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch,
28125796c8dcSSimon Schubert                                      gdbarch_stabs_argument_has_addr_ftype stabs_argument_has_addr)
28135796c8dcSSimon Schubert {
28145796c8dcSSimon Schubert   gdbarch->stabs_argument_has_addr = stabs_argument_has_addr;
28155796c8dcSSimon Schubert }
28165796c8dcSSimon Schubert 
28175796c8dcSSimon Schubert int
28185796c8dcSSimon Schubert gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
28195796c8dcSSimon Schubert {
28205796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28215796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28225796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
28235796c8dcSSimon Schubert   return gdbarch->frame_red_zone_size;
28245796c8dcSSimon Schubert }
28255796c8dcSSimon Schubert 
28265796c8dcSSimon Schubert void
28275796c8dcSSimon Schubert set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
28285796c8dcSSimon Schubert                                  int frame_red_zone_size)
28295796c8dcSSimon Schubert {
28305796c8dcSSimon Schubert   gdbarch->frame_red_zone_size = frame_red_zone_size;
28315796c8dcSSimon Schubert }
28325796c8dcSSimon Schubert 
28335796c8dcSSimon Schubert CORE_ADDR
28345796c8dcSSimon Schubert gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
28355796c8dcSSimon Schubert {
28365796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28375796c8dcSSimon Schubert   gdb_assert (gdbarch->convert_from_func_ptr_addr != NULL);
28385796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28395796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
28405796c8dcSSimon Schubert   return gdbarch->convert_from_func_ptr_addr (gdbarch, addr, targ);
28415796c8dcSSimon Schubert }
28425796c8dcSSimon Schubert 
28435796c8dcSSimon Schubert void
28445796c8dcSSimon Schubert set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
28455796c8dcSSimon Schubert                                         gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
28465796c8dcSSimon Schubert {
28475796c8dcSSimon Schubert   gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
28485796c8dcSSimon Schubert }
28495796c8dcSSimon Schubert 
28505796c8dcSSimon Schubert CORE_ADDR
28515796c8dcSSimon Schubert gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
28525796c8dcSSimon Schubert {
28535796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28545796c8dcSSimon Schubert   gdb_assert (gdbarch->addr_bits_remove != NULL);
28555796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28565796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bits_remove called\n");
28575796c8dcSSimon Schubert   return gdbarch->addr_bits_remove (gdbarch, addr);
28585796c8dcSSimon Schubert }
28595796c8dcSSimon Schubert 
28605796c8dcSSimon Schubert void
28615796c8dcSSimon Schubert set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
28625796c8dcSSimon Schubert                               gdbarch_addr_bits_remove_ftype addr_bits_remove)
28635796c8dcSSimon Schubert {
28645796c8dcSSimon Schubert   gdbarch->addr_bits_remove = addr_bits_remove;
28655796c8dcSSimon Schubert }
28665796c8dcSSimon Schubert 
28675796c8dcSSimon Schubert CORE_ADDR
28685796c8dcSSimon Schubert gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
28695796c8dcSSimon Schubert {
28705796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28715796c8dcSSimon Schubert   gdb_assert (gdbarch->smash_text_address != NULL);
28725796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28735796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
28745796c8dcSSimon Schubert   return gdbarch->smash_text_address (gdbarch, addr);
28755796c8dcSSimon Schubert }
28765796c8dcSSimon Schubert 
28775796c8dcSSimon Schubert void
28785796c8dcSSimon Schubert set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
28795796c8dcSSimon Schubert                                 gdbarch_smash_text_address_ftype smash_text_address)
28805796c8dcSSimon Schubert {
28815796c8dcSSimon Schubert   gdbarch->smash_text_address = smash_text_address;
28825796c8dcSSimon Schubert }
28835796c8dcSSimon Schubert 
28845796c8dcSSimon Schubert int
28855796c8dcSSimon Schubert gdbarch_software_single_step_p (struct gdbarch *gdbarch)
28865796c8dcSSimon Schubert {
28875796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28885796c8dcSSimon Schubert   return gdbarch->software_single_step != NULL;
28895796c8dcSSimon Schubert }
28905796c8dcSSimon Schubert 
28915796c8dcSSimon Schubert int
28925796c8dcSSimon Schubert gdbarch_software_single_step (struct gdbarch *gdbarch, struct frame_info *frame)
28935796c8dcSSimon Schubert {
28945796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
28955796c8dcSSimon Schubert   gdb_assert (gdbarch->software_single_step != NULL);
28965796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
28975796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_software_single_step called\n");
28985796c8dcSSimon Schubert   return gdbarch->software_single_step (frame);
28995796c8dcSSimon Schubert }
29005796c8dcSSimon Schubert 
29015796c8dcSSimon Schubert void
29025796c8dcSSimon Schubert set_gdbarch_software_single_step (struct gdbarch *gdbarch,
29035796c8dcSSimon Schubert                                   gdbarch_software_single_step_ftype software_single_step)
29045796c8dcSSimon Schubert {
29055796c8dcSSimon Schubert   gdbarch->software_single_step = software_single_step;
29065796c8dcSSimon Schubert }
29075796c8dcSSimon Schubert 
29085796c8dcSSimon Schubert int
29095796c8dcSSimon Schubert gdbarch_single_step_through_delay_p (struct gdbarch *gdbarch)
29105796c8dcSSimon Schubert {
29115796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29125796c8dcSSimon Schubert   return gdbarch->single_step_through_delay != NULL;
29135796c8dcSSimon Schubert }
29145796c8dcSSimon Schubert 
29155796c8dcSSimon Schubert int
29165796c8dcSSimon Schubert gdbarch_single_step_through_delay (struct gdbarch *gdbarch, struct frame_info *frame)
29175796c8dcSSimon Schubert {
29185796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29195796c8dcSSimon Schubert   gdb_assert (gdbarch->single_step_through_delay != NULL);
29205796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
29215796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_single_step_through_delay called\n");
29225796c8dcSSimon Schubert   return gdbarch->single_step_through_delay (gdbarch, frame);
29235796c8dcSSimon Schubert }
29245796c8dcSSimon Schubert 
29255796c8dcSSimon Schubert void
29265796c8dcSSimon Schubert set_gdbarch_single_step_through_delay (struct gdbarch *gdbarch,
29275796c8dcSSimon Schubert                                        gdbarch_single_step_through_delay_ftype single_step_through_delay)
29285796c8dcSSimon Schubert {
29295796c8dcSSimon Schubert   gdbarch->single_step_through_delay = single_step_through_delay;
29305796c8dcSSimon Schubert }
29315796c8dcSSimon Schubert 
29325796c8dcSSimon Schubert int
29335796c8dcSSimon Schubert gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
29345796c8dcSSimon Schubert {
29355796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29365796c8dcSSimon Schubert   gdb_assert (gdbarch->print_insn != NULL);
29375796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
29385796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
29395796c8dcSSimon Schubert   return gdbarch->print_insn (vma, info);
29405796c8dcSSimon Schubert }
29415796c8dcSSimon Schubert 
29425796c8dcSSimon Schubert void
29435796c8dcSSimon Schubert set_gdbarch_print_insn (struct gdbarch *gdbarch,
29445796c8dcSSimon Schubert                         gdbarch_print_insn_ftype print_insn)
29455796c8dcSSimon Schubert {
29465796c8dcSSimon Schubert   gdbarch->print_insn = print_insn;
29475796c8dcSSimon Schubert }
29485796c8dcSSimon Schubert 
29495796c8dcSSimon Schubert CORE_ADDR
29505796c8dcSSimon Schubert gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, struct frame_info *frame, CORE_ADDR pc)
29515796c8dcSSimon Schubert {
29525796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29535796c8dcSSimon Schubert   gdb_assert (gdbarch->skip_trampoline_code != NULL);
29545796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
29555796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_trampoline_code called\n");
29565796c8dcSSimon Schubert   return gdbarch->skip_trampoline_code (frame, pc);
29575796c8dcSSimon Schubert }
29585796c8dcSSimon Schubert 
29595796c8dcSSimon Schubert void
29605796c8dcSSimon Schubert set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
29615796c8dcSSimon Schubert                                   gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
29625796c8dcSSimon Schubert {
29635796c8dcSSimon Schubert   gdbarch->skip_trampoline_code = skip_trampoline_code;
29645796c8dcSSimon Schubert }
29655796c8dcSSimon Schubert 
29665796c8dcSSimon Schubert CORE_ADDR
29675796c8dcSSimon Schubert gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
29685796c8dcSSimon Schubert {
29695796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29705796c8dcSSimon Schubert   gdb_assert (gdbarch->skip_solib_resolver != NULL);
29715796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
29725796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
29735796c8dcSSimon Schubert   return gdbarch->skip_solib_resolver (gdbarch, pc);
29745796c8dcSSimon Schubert }
29755796c8dcSSimon Schubert 
29765796c8dcSSimon Schubert void
29775796c8dcSSimon Schubert set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
29785796c8dcSSimon Schubert                                  gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
29795796c8dcSSimon Schubert {
29805796c8dcSSimon Schubert   gdbarch->skip_solib_resolver = skip_solib_resolver;
29815796c8dcSSimon Schubert }
29825796c8dcSSimon Schubert 
29835796c8dcSSimon Schubert int
29845796c8dcSSimon Schubert gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
29855796c8dcSSimon Schubert {
29865796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
29875796c8dcSSimon Schubert   gdb_assert (gdbarch->in_solib_return_trampoline != NULL);
29885796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
29895796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_return_trampoline called\n");
29905796c8dcSSimon Schubert   return gdbarch->in_solib_return_trampoline (gdbarch, pc, name);
29915796c8dcSSimon Schubert }
29925796c8dcSSimon Schubert 
29935796c8dcSSimon Schubert void
29945796c8dcSSimon Schubert set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch,
29955796c8dcSSimon Schubert                                         gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
29965796c8dcSSimon Schubert {
29975796c8dcSSimon Schubert   gdbarch->in_solib_return_trampoline = in_solib_return_trampoline;
29985796c8dcSSimon Schubert }
29995796c8dcSSimon Schubert 
30005796c8dcSSimon Schubert int
30015796c8dcSSimon Schubert gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
30025796c8dcSSimon Schubert {
30035796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30045796c8dcSSimon Schubert   gdb_assert (gdbarch->in_function_epilogue_p != NULL);
30055796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30065796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_in_function_epilogue_p called\n");
30075796c8dcSSimon Schubert   return gdbarch->in_function_epilogue_p (gdbarch, addr);
30085796c8dcSSimon Schubert }
30095796c8dcSSimon Schubert 
30105796c8dcSSimon Schubert void
30115796c8dcSSimon Schubert set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
30125796c8dcSSimon Schubert                                     gdbarch_in_function_epilogue_p_ftype in_function_epilogue_p)
30135796c8dcSSimon Schubert {
30145796c8dcSSimon Schubert   gdbarch->in_function_epilogue_p = in_function_epilogue_p;
30155796c8dcSSimon Schubert }
30165796c8dcSSimon Schubert 
30175796c8dcSSimon Schubert void
30185796c8dcSSimon Schubert gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
30195796c8dcSSimon Schubert {
30205796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30215796c8dcSSimon Schubert   gdb_assert (gdbarch->elf_make_msymbol_special != NULL);
30225796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30235796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
30245796c8dcSSimon Schubert   gdbarch->elf_make_msymbol_special (sym, msym);
30255796c8dcSSimon Schubert }
30265796c8dcSSimon Schubert 
30275796c8dcSSimon Schubert void
30285796c8dcSSimon Schubert set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
30295796c8dcSSimon Schubert                                       gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
30305796c8dcSSimon Schubert {
30315796c8dcSSimon Schubert   gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
30325796c8dcSSimon Schubert }
30335796c8dcSSimon Schubert 
30345796c8dcSSimon Schubert void
30355796c8dcSSimon Schubert gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
30365796c8dcSSimon Schubert {
30375796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30385796c8dcSSimon Schubert   gdb_assert (gdbarch->coff_make_msymbol_special != NULL);
30395796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30405796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
30415796c8dcSSimon Schubert   gdbarch->coff_make_msymbol_special (val, msym);
30425796c8dcSSimon Schubert }
30435796c8dcSSimon Schubert 
30445796c8dcSSimon Schubert void
30455796c8dcSSimon Schubert set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
30465796c8dcSSimon Schubert                                        gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
30475796c8dcSSimon Schubert {
30485796c8dcSSimon Schubert   gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
30495796c8dcSSimon Schubert }
30505796c8dcSSimon Schubert 
30515796c8dcSSimon Schubert int
30525796c8dcSSimon Schubert gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
30535796c8dcSSimon Schubert {
30545796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30555796c8dcSSimon Schubert   /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
30565796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30575796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
30585796c8dcSSimon Schubert   return gdbarch->cannot_step_breakpoint;
30595796c8dcSSimon Schubert }
30605796c8dcSSimon Schubert 
30615796c8dcSSimon Schubert void
30625796c8dcSSimon Schubert set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
30635796c8dcSSimon Schubert                                     int cannot_step_breakpoint)
30645796c8dcSSimon Schubert {
30655796c8dcSSimon Schubert   gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
30665796c8dcSSimon Schubert }
30675796c8dcSSimon Schubert 
30685796c8dcSSimon Schubert int
30695796c8dcSSimon Schubert gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
30705796c8dcSSimon Schubert {
30715796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30725796c8dcSSimon Schubert   /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
30735796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30745796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
30755796c8dcSSimon Schubert   return gdbarch->have_nonsteppable_watchpoint;
30765796c8dcSSimon Schubert }
30775796c8dcSSimon Schubert 
30785796c8dcSSimon Schubert void
30795796c8dcSSimon Schubert set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
30805796c8dcSSimon Schubert                                           int have_nonsteppable_watchpoint)
30815796c8dcSSimon Schubert {
30825796c8dcSSimon Schubert   gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
30835796c8dcSSimon Schubert }
30845796c8dcSSimon Schubert 
30855796c8dcSSimon Schubert int
30865796c8dcSSimon Schubert gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch)
30875796c8dcSSimon Schubert {
30885796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30895796c8dcSSimon Schubert   return gdbarch->address_class_type_flags != NULL;
30905796c8dcSSimon Schubert }
30915796c8dcSSimon Schubert 
30925796c8dcSSimon Schubert int
30935796c8dcSSimon Schubert gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class)
30945796c8dcSSimon Schubert {
30955796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
30965796c8dcSSimon Schubert   gdb_assert (gdbarch->address_class_type_flags != NULL);
30975796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
30985796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags called\n");
30995796c8dcSSimon Schubert   return gdbarch->address_class_type_flags (byte_size, dwarf2_addr_class);
31005796c8dcSSimon Schubert }
31015796c8dcSSimon Schubert 
31025796c8dcSSimon Schubert void
31035796c8dcSSimon Schubert set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch,
31045796c8dcSSimon Schubert                                       gdbarch_address_class_type_flags_ftype address_class_type_flags)
31055796c8dcSSimon Schubert {
31065796c8dcSSimon Schubert   gdbarch->address_class_type_flags = address_class_type_flags;
31075796c8dcSSimon Schubert }
31085796c8dcSSimon Schubert 
31095796c8dcSSimon Schubert int
31105796c8dcSSimon Schubert gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch)
31115796c8dcSSimon Schubert {
31125796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31135796c8dcSSimon Schubert   return gdbarch->address_class_type_flags_to_name != NULL;
31145796c8dcSSimon Schubert }
31155796c8dcSSimon Schubert 
31165796c8dcSSimon Schubert const char *
31175796c8dcSSimon Schubert gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
31185796c8dcSSimon Schubert {
31195796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31205796c8dcSSimon Schubert   gdb_assert (gdbarch->address_class_type_flags_to_name != NULL);
31215796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
31225796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
31235796c8dcSSimon Schubert   return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
31245796c8dcSSimon Schubert }
31255796c8dcSSimon Schubert 
31265796c8dcSSimon Schubert void
31275796c8dcSSimon Schubert set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch,
31285796c8dcSSimon Schubert                                               gdbarch_address_class_type_flags_to_name_ftype address_class_type_flags_to_name)
31295796c8dcSSimon Schubert {
31305796c8dcSSimon Schubert   gdbarch->address_class_type_flags_to_name = address_class_type_flags_to_name;
31315796c8dcSSimon Schubert }
31325796c8dcSSimon Schubert 
31335796c8dcSSimon Schubert int
31345796c8dcSSimon Schubert gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch)
31355796c8dcSSimon Schubert {
31365796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31375796c8dcSSimon Schubert   return gdbarch->address_class_name_to_type_flags != NULL;
31385796c8dcSSimon Schubert }
31395796c8dcSSimon Schubert 
31405796c8dcSSimon Schubert int
31415796c8dcSSimon Schubert gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr)
31425796c8dcSSimon Schubert {
31435796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31445796c8dcSSimon Schubert   gdb_assert (gdbarch->address_class_name_to_type_flags != NULL);
31455796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
31465796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
31475796c8dcSSimon Schubert   return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
31485796c8dcSSimon Schubert }
31495796c8dcSSimon Schubert 
31505796c8dcSSimon Schubert void
31515796c8dcSSimon Schubert set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch,
31525796c8dcSSimon Schubert                                               gdbarch_address_class_name_to_type_flags_ftype address_class_name_to_type_flags)
31535796c8dcSSimon Schubert {
31545796c8dcSSimon Schubert   gdbarch->address_class_name_to_type_flags = address_class_name_to_type_flags;
31555796c8dcSSimon Schubert }
31565796c8dcSSimon Schubert 
31575796c8dcSSimon Schubert int
31585796c8dcSSimon Schubert gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *reggroup)
31595796c8dcSSimon Schubert {
31605796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31615796c8dcSSimon Schubert   gdb_assert (gdbarch->register_reggroup_p != NULL);
31625796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
31635796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_register_reggroup_p called\n");
31645796c8dcSSimon Schubert   return gdbarch->register_reggroup_p (gdbarch, regnum, reggroup);
31655796c8dcSSimon Schubert }
31665796c8dcSSimon Schubert 
31675796c8dcSSimon Schubert void
31685796c8dcSSimon Schubert set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch,
31695796c8dcSSimon Schubert                                  gdbarch_register_reggroup_p_ftype register_reggroup_p)
31705796c8dcSSimon Schubert {
31715796c8dcSSimon Schubert   gdbarch->register_reggroup_p = register_reggroup_p;
31725796c8dcSSimon Schubert }
31735796c8dcSSimon Schubert 
31745796c8dcSSimon Schubert int
31755796c8dcSSimon Schubert gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch)
31765796c8dcSSimon Schubert {
31775796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31785796c8dcSSimon Schubert   return gdbarch->fetch_pointer_argument != NULL;
31795796c8dcSSimon Schubert }
31805796c8dcSSimon Schubert 
31815796c8dcSSimon Schubert CORE_ADDR
31825796c8dcSSimon Schubert gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type)
31835796c8dcSSimon Schubert {
31845796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
31855796c8dcSSimon Schubert   gdb_assert (gdbarch->fetch_pointer_argument != NULL);
31865796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
31875796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pointer_argument called\n");
31885796c8dcSSimon Schubert   return gdbarch->fetch_pointer_argument (frame, argi, type);
31895796c8dcSSimon Schubert }
31905796c8dcSSimon Schubert 
31915796c8dcSSimon Schubert void
31925796c8dcSSimon Schubert set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch,
31935796c8dcSSimon Schubert                                     gdbarch_fetch_pointer_argument_ftype fetch_pointer_argument)
31945796c8dcSSimon Schubert {
31955796c8dcSSimon Schubert   gdbarch->fetch_pointer_argument = fetch_pointer_argument;
31965796c8dcSSimon Schubert }
31975796c8dcSSimon Schubert 
31985796c8dcSSimon Schubert int
31995796c8dcSSimon Schubert gdbarch_regset_from_core_section_p (struct gdbarch *gdbarch)
32005796c8dcSSimon Schubert {
32015796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32025796c8dcSSimon Schubert   return gdbarch->regset_from_core_section != NULL;
32035796c8dcSSimon Schubert }
32045796c8dcSSimon Schubert 
32055796c8dcSSimon Schubert const struct regset *
32065796c8dcSSimon Schubert gdbarch_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size)
32075796c8dcSSimon Schubert {
32085796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32095796c8dcSSimon Schubert   gdb_assert (gdbarch->regset_from_core_section != NULL);
32105796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
32115796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_regset_from_core_section called\n");
32125796c8dcSSimon Schubert   return gdbarch->regset_from_core_section (gdbarch, sect_name, sect_size);
32135796c8dcSSimon Schubert }
32145796c8dcSSimon Schubert 
32155796c8dcSSimon Schubert void
32165796c8dcSSimon Schubert set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
32175796c8dcSSimon Schubert                                       gdbarch_regset_from_core_section_ftype regset_from_core_section)
32185796c8dcSSimon Schubert {
32195796c8dcSSimon Schubert   gdbarch->regset_from_core_section = regset_from_core_section;
32205796c8dcSSimon Schubert }
32215796c8dcSSimon Schubert 
32225796c8dcSSimon Schubert struct core_regset_section *
32235796c8dcSSimon Schubert gdbarch_core_regset_sections (struct gdbarch *gdbarch)
32245796c8dcSSimon Schubert {
32255796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32265796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
32275796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_regset_sections called\n");
32285796c8dcSSimon Schubert   return gdbarch->core_regset_sections;
32295796c8dcSSimon Schubert }
32305796c8dcSSimon Schubert 
32315796c8dcSSimon Schubert void
32325796c8dcSSimon Schubert set_gdbarch_core_regset_sections (struct gdbarch *gdbarch,
32335796c8dcSSimon Schubert                                   struct core_regset_section * core_regset_sections)
32345796c8dcSSimon Schubert {
32355796c8dcSSimon Schubert   gdbarch->core_regset_sections = core_regset_sections;
32365796c8dcSSimon Schubert }
32375796c8dcSSimon Schubert 
32385796c8dcSSimon Schubert int
32395796c8dcSSimon Schubert gdbarch_core_xfer_shared_libraries_p (struct gdbarch *gdbarch)
32405796c8dcSSimon Schubert {
32415796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32425796c8dcSSimon Schubert   return gdbarch->core_xfer_shared_libraries != NULL;
32435796c8dcSSimon Schubert }
32445796c8dcSSimon Schubert 
32455796c8dcSSimon Schubert LONGEST
32465796c8dcSSimon Schubert gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
32475796c8dcSSimon Schubert {
32485796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32495796c8dcSSimon Schubert   gdb_assert (gdbarch->core_xfer_shared_libraries != NULL);
32505796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
32515796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_xfer_shared_libraries called\n");
32525796c8dcSSimon Schubert   return gdbarch->core_xfer_shared_libraries (gdbarch, readbuf, offset, len);
32535796c8dcSSimon Schubert }
32545796c8dcSSimon Schubert 
32555796c8dcSSimon Schubert void
32565796c8dcSSimon Schubert set_gdbarch_core_xfer_shared_libraries (struct gdbarch *gdbarch,
32575796c8dcSSimon Schubert                                         gdbarch_core_xfer_shared_libraries_ftype core_xfer_shared_libraries)
32585796c8dcSSimon Schubert {
32595796c8dcSSimon Schubert   gdbarch->core_xfer_shared_libraries = core_xfer_shared_libraries;
32605796c8dcSSimon Schubert }
32615796c8dcSSimon Schubert 
32625796c8dcSSimon Schubert int
32635796c8dcSSimon Schubert gdbarch_core_pid_to_str_p (struct gdbarch *gdbarch)
32645796c8dcSSimon Schubert {
32655796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32665796c8dcSSimon Schubert   return gdbarch->core_pid_to_str != NULL;
32675796c8dcSSimon Schubert }
32685796c8dcSSimon Schubert 
32695796c8dcSSimon Schubert char *
32705796c8dcSSimon Schubert gdbarch_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
32715796c8dcSSimon Schubert {
32725796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32735796c8dcSSimon Schubert   gdb_assert (gdbarch->core_pid_to_str != NULL);
32745796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
32755796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_pid_to_str called\n");
32765796c8dcSSimon Schubert   return gdbarch->core_pid_to_str (gdbarch, ptid);
32775796c8dcSSimon Schubert }
32785796c8dcSSimon Schubert 
32795796c8dcSSimon Schubert void
32805796c8dcSSimon Schubert set_gdbarch_core_pid_to_str (struct gdbarch *gdbarch,
32815796c8dcSSimon Schubert                              gdbarch_core_pid_to_str_ftype core_pid_to_str)
32825796c8dcSSimon Schubert {
32835796c8dcSSimon Schubert   gdbarch->core_pid_to_str = core_pid_to_str;
32845796c8dcSSimon Schubert }
32855796c8dcSSimon Schubert 
32865796c8dcSSimon Schubert int
32875796c8dcSSimon Schubert gdbarch_gcore_bfd_target_p (struct gdbarch *gdbarch)
32885796c8dcSSimon Schubert {
32895796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32905796c8dcSSimon Schubert   return gdbarch->gcore_bfd_target != 0;
32915796c8dcSSimon Schubert }
32925796c8dcSSimon Schubert 
32935796c8dcSSimon Schubert const char *
32945796c8dcSSimon Schubert gdbarch_gcore_bfd_target (struct gdbarch *gdbarch)
32955796c8dcSSimon Schubert {
32965796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
32975796c8dcSSimon Schubert   /* Check variable changed from pre-default.  */
32985796c8dcSSimon Schubert   gdb_assert (gdbarch->gcore_bfd_target != 0);
32995796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
33005796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_gcore_bfd_target called\n");
33015796c8dcSSimon Schubert   return gdbarch->gcore_bfd_target;
33025796c8dcSSimon Schubert }
33035796c8dcSSimon Schubert 
33045796c8dcSSimon Schubert void
33055796c8dcSSimon Schubert set_gdbarch_gcore_bfd_target (struct gdbarch *gdbarch,
33065796c8dcSSimon Schubert                               const char * gcore_bfd_target)
33075796c8dcSSimon Schubert {
33085796c8dcSSimon Schubert   gdbarch->gcore_bfd_target = gcore_bfd_target;
33095796c8dcSSimon Schubert }
33105796c8dcSSimon Schubert 
33115796c8dcSSimon Schubert int
33125796c8dcSSimon Schubert gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch)
33135796c8dcSSimon Schubert {
33145796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33155796c8dcSSimon Schubert   /* Skip verify of vtable_function_descriptors, invalid_p == 0 */
33165796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
33175796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_vtable_function_descriptors called\n");
33185796c8dcSSimon Schubert   return gdbarch->vtable_function_descriptors;
33195796c8dcSSimon Schubert }
33205796c8dcSSimon Schubert 
33215796c8dcSSimon Schubert void
33225796c8dcSSimon Schubert set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch,
33235796c8dcSSimon Schubert                                          int vtable_function_descriptors)
33245796c8dcSSimon Schubert {
33255796c8dcSSimon Schubert   gdbarch->vtable_function_descriptors = vtable_function_descriptors;
33265796c8dcSSimon Schubert }
33275796c8dcSSimon Schubert 
33285796c8dcSSimon Schubert int
33295796c8dcSSimon Schubert gdbarch_vbit_in_delta (struct gdbarch *gdbarch)
33305796c8dcSSimon Schubert {
33315796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33325796c8dcSSimon Schubert   /* Skip verify of vbit_in_delta, invalid_p == 0 */
33335796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
33345796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_vbit_in_delta called\n");
33355796c8dcSSimon Schubert   return gdbarch->vbit_in_delta;
33365796c8dcSSimon Schubert }
33375796c8dcSSimon Schubert 
33385796c8dcSSimon Schubert void
33395796c8dcSSimon Schubert set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
33405796c8dcSSimon Schubert                            int vbit_in_delta)
33415796c8dcSSimon Schubert {
33425796c8dcSSimon Schubert   gdbarch->vbit_in_delta = vbit_in_delta;
33435796c8dcSSimon Schubert }
33445796c8dcSSimon Schubert 
33455796c8dcSSimon Schubert int
33465796c8dcSSimon Schubert gdbarch_skip_permanent_breakpoint_p (struct gdbarch *gdbarch)
33475796c8dcSSimon Schubert {
33485796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33495796c8dcSSimon Schubert   return gdbarch->skip_permanent_breakpoint != NULL;
33505796c8dcSSimon Schubert }
33515796c8dcSSimon Schubert 
33525796c8dcSSimon Schubert void
33535796c8dcSSimon Schubert gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
33545796c8dcSSimon Schubert {
33555796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33565796c8dcSSimon Schubert   gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
33575796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
33585796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
33595796c8dcSSimon Schubert   gdbarch->skip_permanent_breakpoint (regcache);
33605796c8dcSSimon Schubert }
33615796c8dcSSimon Schubert 
33625796c8dcSSimon Schubert void
33635796c8dcSSimon Schubert set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
33645796c8dcSSimon Schubert                                        gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
33655796c8dcSSimon Schubert {
33665796c8dcSSimon Schubert   gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
33675796c8dcSSimon Schubert }
33685796c8dcSSimon Schubert 
33695796c8dcSSimon Schubert int
33705796c8dcSSimon Schubert gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
33715796c8dcSSimon Schubert {
33725796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33735796c8dcSSimon Schubert   return gdbarch->max_insn_length != 0;
33745796c8dcSSimon Schubert }
33755796c8dcSSimon Schubert 
33765796c8dcSSimon Schubert ULONGEST
33775796c8dcSSimon Schubert gdbarch_max_insn_length (struct gdbarch *gdbarch)
33785796c8dcSSimon Schubert {
33795796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33805796c8dcSSimon Schubert   /* Check variable changed from pre-default.  */
33815796c8dcSSimon Schubert   gdb_assert (gdbarch->max_insn_length != 0);
33825796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
33835796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_max_insn_length called\n");
33845796c8dcSSimon Schubert   return gdbarch->max_insn_length;
33855796c8dcSSimon Schubert }
33865796c8dcSSimon Schubert 
33875796c8dcSSimon Schubert void
33885796c8dcSSimon Schubert set_gdbarch_max_insn_length (struct gdbarch *gdbarch,
33895796c8dcSSimon Schubert                              ULONGEST max_insn_length)
33905796c8dcSSimon Schubert {
33915796c8dcSSimon Schubert   gdbarch->max_insn_length = max_insn_length;
33925796c8dcSSimon Schubert }
33935796c8dcSSimon Schubert 
33945796c8dcSSimon Schubert int
33955796c8dcSSimon Schubert gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch)
33965796c8dcSSimon Schubert {
33975796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
33985796c8dcSSimon Schubert   return gdbarch->displaced_step_copy_insn != NULL;
33995796c8dcSSimon Schubert }
34005796c8dcSSimon Schubert 
34015796c8dcSSimon Schubert struct displaced_step_closure *
34025796c8dcSSimon Schubert gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
34035796c8dcSSimon Schubert {
34045796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34055796c8dcSSimon Schubert   gdb_assert (gdbarch->displaced_step_copy_insn != NULL);
34065796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
34075796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_copy_insn called\n");
34085796c8dcSSimon Schubert   return gdbarch->displaced_step_copy_insn (gdbarch, from, to, regs);
34095796c8dcSSimon Schubert }
34105796c8dcSSimon Schubert 
34115796c8dcSSimon Schubert void
34125796c8dcSSimon Schubert set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
34135796c8dcSSimon Schubert                                       gdbarch_displaced_step_copy_insn_ftype displaced_step_copy_insn)
34145796c8dcSSimon Schubert {
34155796c8dcSSimon Schubert   gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
34165796c8dcSSimon Schubert }
34175796c8dcSSimon Schubert 
34185796c8dcSSimon Schubert int
34195796c8dcSSimon Schubert gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
34205796c8dcSSimon Schubert {
34215796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34225796c8dcSSimon Schubert   gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL);
34235796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
34245796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n");
34255796c8dcSSimon Schubert   return gdbarch->displaced_step_hw_singlestep (gdbarch, closure);
34265796c8dcSSimon Schubert }
34275796c8dcSSimon Schubert 
34285796c8dcSSimon Schubert void
34295796c8dcSSimon Schubert set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
34305796c8dcSSimon Schubert                                           gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep)
34315796c8dcSSimon Schubert {
34325796c8dcSSimon Schubert   gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep;
34335796c8dcSSimon Schubert }
34345796c8dcSSimon Schubert 
34355796c8dcSSimon Schubert int
34365796c8dcSSimon Schubert gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch)
34375796c8dcSSimon Schubert {
34385796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34395796c8dcSSimon Schubert   return gdbarch->displaced_step_fixup != NULL;
34405796c8dcSSimon Schubert }
34415796c8dcSSimon Schubert 
34425796c8dcSSimon Schubert void
34435796c8dcSSimon Schubert gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
34445796c8dcSSimon Schubert {
34455796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34465796c8dcSSimon Schubert   gdb_assert (gdbarch->displaced_step_fixup != NULL);
34475796c8dcSSimon Schubert   /* Do not check predicate: gdbarch->displaced_step_fixup != NULL, allow call.  */
34485796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
34495796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_fixup called\n");
34505796c8dcSSimon Schubert   gdbarch->displaced_step_fixup (gdbarch, closure, from, to, regs);
34515796c8dcSSimon Schubert }
34525796c8dcSSimon Schubert 
34535796c8dcSSimon Schubert void
34545796c8dcSSimon Schubert set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
34555796c8dcSSimon Schubert                                   gdbarch_displaced_step_fixup_ftype displaced_step_fixup)
34565796c8dcSSimon Schubert {
34575796c8dcSSimon Schubert   gdbarch->displaced_step_fixup = displaced_step_fixup;
34585796c8dcSSimon Schubert }
34595796c8dcSSimon Schubert 
34605796c8dcSSimon Schubert void
34615796c8dcSSimon Schubert gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
34625796c8dcSSimon Schubert {
34635796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34645796c8dcSSimon Schubert   gdb_assert (gdbarch->displaced_step_free_closure != NULL);
34655796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
34665796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
34675796c8dcSSimon Schubert   gdbarch->displaced_step_free_closure (gdbarch, closure);
34685796c8dcSSimon Schubert }
34695796c8dcSSimon Schubert 
34705796c8dcSSimon Schubert void
34715796c8dcSSimon Schubert set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
34725796c8dcSSimon Schubert                                          gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
34735796c8dcSSimon Schubert {
34745796c8dcSSimon Schubert   gdbarch->displaced_step_free_closure = displaced_step_free_closure;
34755796c8dcSSimon Schubert }
34765796c8dcSSimon Schubert 
34775796c8dcSSimon Schubert CORE_ADDR
34785796c8dcSSimon Schubert gdbarch_displaced_step_location (struct gdbarch *gdbarch)
34795796c8dcSSimon Schubert {
34805796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
34815796c8dcSSimon Schubert   gdb_assert (gdbarch->displaced_step_location != NULL);
34825796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
34835796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_location called\n");
34845796c8dcSSimon Schubert   return gdbarch->displaced_step_location (gdbarch);
34855796c8dcSSimon Schubert }
34865796c8dcSSimon Schubert 
34875796c8dcSSimon Schubert void
34885796c8dcSSimon Schubert set_gdbarch_displaced_step_location (struct gdbarch *gdbarch,
34895796c8dcSSimon Schubert                                      gdbarch_displaced_step_location_ftype displaced_step_location)
34905796c8dcSSimon Schubert {
34915796c8dcSSimon Schubert   gdbarch->displaced_step_location = displaced_step_location;
34925796c8dcSSimon Schubert }
34935796c8dcSSimon Schubert 
34945796c8dcSSimon Schubert int
3495cf7f2e2dSJohn Marino gdbarch_relocate_instruction_p (struct gdbarch *gdbarch)
3496cf7f2e2dSJohn Marino {
3497cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3498cf7f2e2dSJohn Marino   return gdbarch->relocate_instruction != NULL;
3499cf7f2e2dSJohn Marino }
3500cf7f2e2dSJohn Marino 
3501cf7f2e2dSJohn Marino void
3502cf7f2e2dSJohn Marino gdbarch_relocate_instruction (struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
3503cf7f2e2dSJohn Marino {
3504cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3505cf7f2e2dSJohn Marino   gdb_assert (gdbarch->relocate_instruction != NULL);
3506cf7f2e2dSJohn Marino   /* Do not check predicate: gdbarch->relocate_instruction != NULL, allow call.  */
3507cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3508cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_relocate_instruction called\n");
3509cf7f2e2dSJohn Marino   gdbarch->relocate_instruction (gdbarch, to, from);
3510cf7f2e2dSJohn Marino }
3511cf7f2e2dSJohn Marino 
3512cf7f2e2dSJohn Marino void
3513cf7f2e2dSJohn Marino set_gdbarch_relocate_instruction (struct gdbarch *gdbarch,
3514cf7f2e2dSJohn Marino                                   gdbarch_relocate_instruction_ftype relocate_instruction)
3515cf7f2e2dSJohn Marino {
3516cf7f2e2dSJohn Marino   gdbarch->relocate_instruction = relocate_instruction;
3517cf7f2e2dSJohn Marino }
3518cf7f2e2dSJohn Marino 
3519cf7f2e2dSJohn Marino int
35205796c8dcSSimon Schubert gdbarch_overlay_update_p (struct gdbarch *gdbarch)
35215796c8dcSSimon Schubert {
35225796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35235796c8dcSSimon Schubert   return gdbarch->overlay_update != NULL;
35245796c8dcSSimon Schubert }
35255796c8dcSSimon Schubert 
35265796c8dcSSimon Schubert void
35275796c8dcSSimon Schubert gdbarch_overlay_update (struct gdbarch *gdbarch, struct obj_section *osect)
35285796c8dcSSimon Schubert {
35295796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35305796c8dcSSimon Schubert   gdb_assert (gdbarch->overlay_update != NULL);
35315796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
35325796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_overlay_update called\n");
35335796c8dcSSimon Schubert   gdbarch->overlay_update (osect);
35345796c8dcSSimon Schubert }
35355796c8dcSSimon Schubert 
35365796c8dcSSimon Schubert void
35375796c8dcSSimon Schubert set_gdbarch_overlay_update (struct gdbarch *gdbarch,
35385796c8dcSSimon Schubert                             gdbarch_overlay_update_ftype overlay_update)
35395796c8dcSSimon Schubert {
35405796c8dcSSimon Schubert   gdbarch->overlay_update = overlay_update;
35415796c8dcSSimon Schubert }
35425796c8dcSSimon Schubert 
35435796c8dcSSimon Schubert int
35445796c8dcSSimon Schubert gdbarch_core_read_description_p (struct gdbarch *gdbarch)
35455796c8dcSSimon Schubert {
35465796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35475796c8dcSSimon Schubert   return gdbarch->core_read_description != NULL;
35485796c8dcSSimon Schubert }
35495796c8dcSSimon Schubert 
35505796c8dcSSimon Schubert const struct target_desc *
35515796c8dcSSimon Schubert gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
35525796c8dcSSimon Schubert {
35535796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35545796c8dcSSimon Schubert   gdb_assert (gdbarch->core_read_description != NULL);
35555796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
35565796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_core_read_description called\n");
35575796c8dcSSimon Schubert   return gdbarch->core_read_description (gdbarch, target, abfd);
35585796c8dcSSimon Schubert }
35595796c8dcSSimon Schubert 
35605796c8dcSSimon Schubert void
35615796c8dcSSimon Schubert set_gdbarch_core_read_description (struct gdbarch *gdbarch,
35625796c8dcSSimon Schubert                                    gdbarch_core_read_description_ftype core_read_description)
35635796c8dcSSimon Schubert {
35645796c8dcSSimon Schubert   gdbarch->core_read_description = core_read_description;
35655796c8dcSSimon Schubert }
35665796c8dcSSimon Schubert 
35675796c8dcSSimon Schubert int
35685796c8dcSSimon Schubert gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
35695796c8dcSSimon Schubert {
35705796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35715796c8dcSSimon Schubert   return gdbarch->static_transform_name != NULL;
35725796c8dcSSimon Schubert }
35735796c8dcSSimon Schubert 
35745796c8dcSSimon Schubert char *
35755796c8dcSSimon Schubert gdbarch_static_transform_name (struct gdbarch *gdbarch, char *name)
35765796c8dcSSimon Schubert {
35775796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35785796c8dcSSimon Schubert   gdb_assert (gdbarch->static_transform_name != NULL);
35795796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
35805796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
35815796c8dcSSimon Schubert   return gdbarch->static_transform_name (name);
35825796c8dcSSimon Schubert }
35835796c8dcSSimon Schubert 
35845796c8dcSSimon Schubert void
35855796c8dcSSimon Schubert set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
35865796c8dcSSimon Schubert                                    gdbarch_static_transform_name_ftype static_transform_name)
35875796c8dcSSimon Schubert {
35885796c8dcSSimon Schubert   gdbarch->static_transform_name = static_transform_name;
35895796c8dcSSimon Schubert }
35905796c8dcSSimon Schubert 
35915796c8dcSSimon Schubert int
35925796c8dcSSimon Schubert gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
35935796c8dcSSimon Schubert {
35945796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
35955796c8dcSSimon Schubert   /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
35965796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
35975796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_sofun_address_maybe_missing called\n");
35985796c8dcSSimon Schubert   return gdbarch->sofun_address_maybe_missing;
35995796c8dcSSimon Schubert }
36005796c8dcSSimon Schubert 
36015796c8dcSSimon Schubert void
36025796c8dcSSimon Schubert set_gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch,
36035796c8dcSSimon Schubert                                          int sofun_address_maybe_missing)
36045796c8dcSSimon Schubert {
36055796c8dcSSimon Schubert   gdbarch->sofun_address_maybe_missing = sofun_address_maybe_missing;
36065796c8dcSSimon Schubert }
36075796c8dcSSimon Schubert 
36085796c8dcSSimon Schubert int
36095796c8dcSSimon Schubert gdbarch_process_record_p (struct gdbarch *gdbarch)
36105796c8dcSSimon Schubert {
36115796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36125796c8dcSSimon Schubert   return gdbarch->process_record != NULL;
36135796c8dcSSimon Schubert }
36145796c8dcSSimon Schubert 
36155796c8dcSSimon Schubert int
36165796c8dcSSimon Schubert gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
36175796c8dcSSimon Schubert {
36185796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36195796c8dcSSimon Schubert   gdb_assert (gdbarch->process_record != NULL);
36205796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
36215796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record called\n");
36225796c8dcSSimon Schubert   return gdbarch->process_record (gdbarch, regcache, addr);
36235796c8dcSSimon Schubert }
36245796c8dcSSimon Schubert 
36255796c8dcSSimon Schubert void
36265796c8dcSSimon Schubert set_gdbarch_process_record (struct gdbarch *gdbarch,
36275796c8dcSSimon Schubert                             gdbarch_process_record_ftype process_record)
36285796c8dcSSimon Schubert {
36295796c8dcSSimon Schubert   gdbarch->process_record = process_record;
36305796c8dcSSimon Schubert }
36315796c8dcSSimon Schubert 
36325796c8dcSSimon Schubert int
36335796c8dcSSimon Schubert gdbarch_process_record_signal_p (struct gdbarch *gdbarch)
36345796c8dcSSimon Schubert {
36355796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36365796c8dcSSimon Schubert   return gdbarch->process_record_signal != NULL;
36375796c8dcSSimon Schubert }
36385796c8dcSSimon Schubert 
36395796c8dcSSimon Schubert int
36405796c8dcSSimon Schubert gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal)
36415796c8dcSSimon Schubert {
36425796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36435796c8dcSSimon Schubert   gdb_assert (gdbarch->process_record_signal != NULL);
36445796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
36455796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n");
36465796c8dcSSimon Schubert   return gdbarch->process_record_signal (gdbarch, regcache, signal);
36475796c8dcSSimon Schubert }
36485796c8dcSSimon Schubert 
36495796c8dcSSimon Schubert void
36505796c8dcSSimon Schubert set_gdbarch_process_record_signal (struct gdbarch *gdbarch,
36515796c8dcSSimon Schubert                                    gdbarch_process_record_signal_ftype process_record_signal)
36525796c8dcSSimon Schubert {
36535796c8dcSSimon Schubert   gdbarch->process_record_signal = process_record_signal;
36545796c8dcSSimon Schubert }
36555796c8dcSSimon Schubert 
36565796c8dcSSimon Schubert enum target_signal
36575796c8dcSSimon Schubert gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo)
36585796c8dcSSimon Schubert {
36595796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36605796c8dcSSimon Schubert   gdb_assert (gdbarch->target_signal_from_host != NULL);
36615796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
36625796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_from_host called\n");
36635796c8dcSSimon Schubert   return gdbarch->target_signal_from_host (gdbarch, signo);
36645796c8dcSSimon Schubert }
36655796c8dcSSimon Schubert 
36665796c8dcSSimon Schubert void
36675796c8dcSSimon Schubert set_gdbarch_target_signal_from_host (struct gdbarch *gdbarch,
36685796c8dcSSimon Schubert                                      gdbarch_target_signal_from_host_ftype target_signal_from_host)
36695796c8dcSSimon Schubert {
36705796c8dcSSimon Schubert   gdbarch->target_signal_from_host = target_signal_from_host;
36715796c8dcSSimon Schubert }
36725796c8dcSSimon Schubert 
36735796c8dcSSimon Schubert int
36745796c8dcSSimon Schubert gdbarch_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
36755796c8dcSSimon Schubert {
36765796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36775796c8dcSSimon Schubert   gdb_assert (gdbarch->target_signal_to_host != NULL);
36785796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
36795796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_target_signal_to_host called\n");
36805796c8dcSSimon Schubert   return gdbarch->target_signal_to_host (gdbarch, ts);
36815796c8dcSSimon Schubert }
36825796c8dcSSimon Schubert 
36835796c8dcSSimon Schubert void
36845796c8dcSSimon Schubert set_gdbarch_target_signal_to_host (struct gdbarch *gdbarch,
36855796c8dcSSimon Schubert                                    gdbarch_target_signal_to_host_ftype target_signal_to_host)
36865796c8dcSSimon Schubert {
36875796c8dcSSimon Schubert   gdbarch->target_signal_to_host = target_signal_to_host;
36885796c8dcSSimon Schubert }
36895796c8dcSSimon Schubert 
36905796c8dcSSimon Schubert int
36915796c8dcSSimon Schubert gdbarch_get_siginfo_type_p (struct gdbarch *gdbarch)
36925796c8dcSSimon Schubert {
36935796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
36945796c8dcSSimon Schubert   return gdbarch->get_siginfo_type != NULL;
36955796c8dcSSimon Schubert }
36965796c8dcSSimon Schubert 
36975796c8dcSSimon Schubert struct type *
36985796c8dcSSimon Schubert gdbarch_get_siginfo_type (struct gdbarch *gdbarch)
36995796c8dcSSimon Schubert {
37005796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37015796c8dcSSimon Schubert   gdb_assert (gdbarch->get_siginfo_type != NULL);
37025796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
37035796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_siginfo_type called\n");
37045796c8dcSSimon Schubert   return gdbarch->get_siginfo_type (gdbarch);
37055796c8dcSSimon Schubert }
37065796c8dcSSimon Schubert 
37075796c8dcSSimon Schubert void
37085796c8dcSSimon Schubert set_gdbarch_get_siginfo_type (struct gdbarch *gdbarch,
37095796c8dcSSimon Schubert                               gdbarch_get_siginfo_type_ftype get_siginfo_type)
37105796c8dcSSimon Schubert {
37115796c8dcSSimon Schubert   gdbarch->get_siginfo_type = get_siginfo_type;
37125796c8dcSSimon Schubert }
37135796c8dcSSimon Schubert 
37145796c8dcSSimon Schubert int
37155796c8dcSSimon Schubert gdbarch_record_special_symbol_p (struct gdbarch *gdbarch)
37165796c8dcSSimon Schubert {
37175796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37185796c8dcSSimon Schubert   return gdbarch->record_special_symbol != NULL;
37195796c8dcSSimon Schubert }
37205796c8dcSSimon Schubert 
37215796c8dcSSimon Schubert void
37225796c8dcSSimon Schubert gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym)
37235796c8dcSSimon Schubert {
37245796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37255796c8dcSSimon Schubert   gdb_assert (gdbarch->record_special_symbol != NULL);
37265796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
37275796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_record_special_symbol called\n");
37285796c8dcSSimon Schubert   gdbarch->record_special_symbol (gdbarch, objfile, sym);
37295796c8dcSSimon Schubert }
37305796c8dcSSimon Schubert 
37315796c8dcSSimon Schubert void
37325796c8dcSSimon Schubert set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
37335796c8dcSSimon Schubert                                    gdbarch_record_special_symbol_ftype record_special_symbol)
37345796c8dcSSimon Schubert {
37355796c8dcSSimon Schubert   gdbarch->record_special_symbol = record_special_symbol;
37365796c8dcSSimon Schubert }
37375796c8dcSSimon Schubert 
37385796c8dcSSimon Schubert int
37395796c8dcSSimon Schubert gdbarch_get_syscall_number_p (struct gdbarch *gdbarch)
37405796c8dcSSimon Schubert {
37415796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37425796c8dcSSimon Schubert   return gdbarch->get_syscall_number != NULL;
37435796c8dcSSimon Schubert }
37445796c8dcSSimon Schubert 
37455796c8dcSSimon Schubert LONGEST
37465796c8dcSSimon Schubert gdbarch_get_syscall_number (struct gdbarch *gdbarch, ptid_t ptid)
37475796c8dcSSimon Schubert {
37485796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37495796c8dcSSimon Schubert   gdb_assert (gdbarch->get_syscall_number != NULL);
37505796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
37515796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_get_syscall_number called\n");
37525796c8dcSSimon Schubert   return gdbarch->get_syscall_number (gdbarch, ptid);
37535796c8dcSSimon Schubert }
37545796c8dcSSimon Schubert 
37555796c8dcSSimon Schubert void
37565796c8dcSSimon Schubert set_gdbarch_get_syscall_number (struct gdbarch *gdbarch,
37575796c8dcSSimon Schubert                                 gdbarch_get_syscall_number_ftype get_syscall_number)
37585796c8dcSSimon Schubert {
37595796c8dcSSimon Schubert   gdbarch->get_syscall_number = get_syscall_number;
37605796c8dcSSimon Schubert }
37615796c8dcSSimon Schubert 
37625796c8dcSSimon Schubert int
37635796c8dcSSimon Schubert gdbarch_has_global_solist (struct gdbarch *gdbarch)
37645796c8dcSSimon Schubert {
37655796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37665796c8dcSSimon Schubert   /* Skip verify of has_global_solist, invalid_p == 0 */
37675796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
37685796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
37695796c8dcSSimon Schubert   return gdbarch->has_global_solist;
37705796c8dcSSimon Schubert }
37715796c8dcSSimon Schubert 
37725796c8dcSSimon Schubert void
37735796c8dcSSimon Schubert set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
37745796c8dcSSimon Schubert                                int has_global_solist)
37755796c8dcSSimon Schubert {
37765796c8dcSSimon Schubert   gdbarch->has_global_solist = has_global_solist;
37775796c8dcSSimon Schubert }
37785796c8dcSSimon Schubert 
37795796c8dcSSimon Schubert int
37805796c8dcSSimon Schubert gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
37815796c8dcSSimon Schubert {
37825796c8dcSSimon Schubert   gdb_assert (gdbarch != NULL);
37835796c8dcSSimon Schubert   /* Skip verify of has_global_breakpoints, invalid_p == 0 */
37845796c8dcSSimon Schubert   if (gdbarch_debug >= 2)
37855796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
37865796c8dcSSimon Schubert   return gdbarch->has_global_breakpoints;
37875796c8dcSSimon Schubert }
37885796c8dcSSimon Schubert 
37895796c8dcSSimon Schubert void
37905796c8dcSSimon Schubert set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
37915796c8dcSSimon Schubert                                     int has_global_breakpoints)
37925796c8dcSSimon Schubert {
37935796c8dcSSimon Schubert   gdbarch->has_global_breakpoints = has_global_breakpoints;
37945796c8dcSSimon Schubert }
37955796c8dcSSimon Schubert 
3796cf7f2e2dSJohn Marino int
3797cf7f2e2dSJohn Marino gdbarch_has_shared_address_space (struct gdbarch *gdbarch)
3798cf7f2e2dSJohn Marino {
3799cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3800cf7f2e2dSJohn Marino   gdb_assert (gdbarch->has_shared_address_space != NULL);
3801cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3802cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_has_shared_address_space called\n");
3803cf7f2e2dSJohn Marino   return gdbarch->has_shared_address_space (gdbarch);
3804cf7f2e2dSJohn Marino }
3805cf7f2e2dSJohn Marino 
3806cf7f2e2dSJohn Marino void
3807cf7f2e2dSJohn Marino set_gdbarch_has_shared_address_space (struct gdbarch *gdbarch,
3808cf7f2e2dSJohn Marino                                       gdbarch_has_shared_address_space_ftype has_shared_address_space)
3809cf7f2e2dSJohn Marino {
3810cf7f2e2dSJohn Marino   gdbarch->has_shared_address_space = has_shared_address_space;
3811cf7f2e2dSJohn Marino }
3812cf7f2e2dSJohn Marino 
3813cf7f2e2dSJohn Marino int
3814cf7f2e2dSJohn Marino gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
3815cf7f2e2dSJohn Marino {
3816cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3817cf7f2e2dSJohn Marino   gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
3818cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3819cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
3820cf7f2e2dSJohn Marino   return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
3821cf7f2e2dSJohn Marino }
3822cf7f2e2dSJohn Marino 
3823cf7f2e2dSJohn Marino void
3824cf7f2e2dSJohn Marino set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
3825cf7f2e2dSJohn Marino                                       gdbarch_fast_tracepoint_valid_at_ftype fast_tracepoint_valid_at)
3826cf7f2e2dSJohn Marino {
3827cf7f2e2dSJohn Marino   gdbarch->fast_tracepoint_valid_at = fast_tracepoint_valid_at;
3828cf7f2e2dSJohn Marino }
3829cf7f2e2dSJohn Marino 
3830cf7f2e2dSJohn Marino const char *
3831cf7f2e2dSJohn Marino gdbarch_auto_charset (struct gdbarch *gdbarch)
3832cf7f2e2dSJohn Marino {
3833cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3834cf7f2e2dSJohn Marino   gdb_assert (gdbarch->auto_charset != NULL);
3835cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3836cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_charset called\n");
3837cf7f2e2dSJohn Marino   return gdbarch->auto_charset ();
3838cf7f2e2dSJohn Marino }
3839cf7f2e2dSJohn Marino 
3840cf7f2e2dSJohn Marino void
3841cf7f2e2dSJohn Marino set_gdbarch_auto_charset (struct gdbarch *gdbarch,
3842cf7f2e2dSJohn Marino                           gdbarch_auto_charset_ftype auto_charset)
3843cf7f2e2dSJohn Marino {
3844cf7f2e2dSJohn Marino   gdbarch->auto_charset = auto_charset;
3845cf7f2e2dSJohn Marino }
3846cf7f2e2dSJohn Marino 
3847cf7f2e2dSJohn Marino const char *
3848cf7f2e2dSJohn Marino gdbarch_auto_wide_charset (struct gdbarch *gdbarch)
3849cf7f2e2dSJohn Marino {
3850cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3851cf7f2e2dSJohn Marino   gdb_assert (gdbarch->auto_wide_charset != NULL);
3852cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3853cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_auto_wide_charset called\n");
3854cf7f2e2dSJohn Marino   return gdbarch->auto_wide_charset ();
3855cf7f2e2dSJohn Marino }
3856cf7f2e2dSJohn Marino 
3857cf7f2e2dSJohn Marino void
3858cf7f2e2dSJohn Marino set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch,
3859cf7f2e2dSJohn Marino                                gdbarch_auto_wide_charset_ftype auto_wide_charset)
3860cf7f2e2dSJohn Marino {
3861cf7f2e2dSJohn Marino   gdbarch->auto_wide_charset = auto_wide_charset;
3862cf7f2e2dSJohn Marino }
3863cf7f2e2dSJohn Marino 
3864cf7f2e2dSJohn Marino const char *
3865cf7f2e2dSJohn Marino gdbarch_solib_symbols_extension (struct gdbarch *gdbarch)
3866cf7f2e2dSJohn Marino {
3867cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3868cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3869cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_solib_symbols_extension called\n");
3870cf7f2e2dSJohn Marino   return gdbarch->solib_symbols_extension;
3871cf7f2e2dSJohn Marino }
3872cf7f2e2dSJohn Marino 
3873cf7f2e2dSJohn Marino void
3874cf7f2e2dSJohn Marino set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch,
3875cf7f2e2dSJohn Marino                                      const char * solib_symbols_extension)
3876cf7f2e2dSJohn Marino {
3877cf7f2e2dSJohn Marino   gdbarch->solib_symbols_extension = solib_symbols_extension;
3878cf7f2e2dSJohn Marino }
3879cf7f2e2dSJohn Marino 
3880cf7f2e2dSJohn Marino int
3881cf7f2e2dSJohn Marino gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch)
3882cf7f2e2dSJohn Marino {
3883cf7f2e2dSJohn Marino   gdb_assert (gdbarch != NULL);
3884cf7f2e2dSJohn Marino   /* Skip verify of has_dos_based_file_system, invalid_p == 0 */
3885cf7f2e2dSJohn Marino   if (gdbarch_debug >= 2)
3886cf7f2e2dSJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_has_dos_based_file_system called\n");
3887cf7f2e2dSJohn Marino   return gdbarch->has_dos_based_file_system;
3888cf7f2e2dSJohn Marino }
3889cf7f2e2dSJohn Marino 
3890cf7f2e2dSJohn Marino void
3891cf7f2e2dSJohn Marino set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
3892cf7f2e2dSJohn Marino                                        int has_dos_based_file_system)
3893cf7f2e2dSJohn Marino {
3894cf7f2e2dSJohn Marino   gdbarch->has_dos_based_file_system = has_dos_based_file_system;
3895cf7f2e2dSJohn Marino }
3896cf7f2e2dSJohn Marino 
3897*a45ae5f8SJohn Marino void
3898*a45ae5f8SJohn Marino gdbarch_gen_return_address (struct gdbarch *gdbarch, struct agent_expr *ax, struct axs_value *value, CORE_ADDR scope)
3899*a45ae5f8SJohn Marino {
3900*a45ae5f8SJohn Marino   gdb_assert (gdbarch != NULL);
3901*a45ae5f8SJohn Marino   gdb_assert (gdbarch->gen_return_address != NULL);
3902*a45ae5f8SJohn Marino   if (gdbarch_debug >= 2)
3903*a45ae5f8SJohn Marino     fprintf_unfiltered (gdb_stdlog, "gdbarch_gen_return_address called\n");
3904*a45ae5f8SJohn Marino   gdbarch->gen_return_address (gdbarch, ax, value, scope);
3905*a45ae5f8SJohn Marino }
3906*a45ae5f8SJohn Marino 
3907*a45ae5f8SJohn Marino void
3908*a45ae5f8SJohn Marino set_gdbarch_gen_return_address (struct gdbarch *gdbarch,
3909*a45ae5f8SJohn Marino                                 gdbarch_gen_return_address_ftype gen_return_address)
3910*a45ae5f8SJohn Marino {
3911*a45ae5f8SJohn Marino   gdbarch->gen_return_address = gen_return_address;
3912*a45ae5f8SJohn Marino }
3913*a45ae5f8SJohn Marino 
39145796c8dcSSimon Schubert 
39155796c8dcSSimon Schubert /* Keep a registry of per-architecture data-pointers required by GDB
39165796c8dcSSimon Schubert    modules.  */
39175796c8dcSSimon Schubert 
39185796c8dcSSimon Schubert struct gdbarch_data
39195796c8dcSSimon Schubert {
39205796c8dcSSimon Schubert   unsigned index;
39215796c8dcSSimon Schubert   int init_p;
39225796c8dcSSimon Schubert   gdbarch_data_pre_init_ftype *pre_init;
39235796c8dcSSimon Schubert   gdbarch_data_post_init_ftype *post_init;
39245796c8dcSSimon Schubert };
39255796c8dcSSimon Schubert 
39265796c8dcSSimon Schubert struct gdbarch_data_registration
39275796c8dcSSimon Schubert {
39285796c8dcSSimon Schubert   struct gdbarch_data *data;
39295796c8dcSSimon Schubert   struct gdbarch_data_registration *next;
39305796c8dcSSimon Schubert };
39315796c8dcSSimon Schubert 
39325796c8dcSSimon Schubert struct gdbarch_data_registry
39335796c8dcSSimon Schubert {
39345796c8dcSSimon Schubert   unsigned nr;
39355796c8dcSSimon Schubert   struct gdbarch_data_registration *registrations;
39365796c8dcSSimon Schubert };
39375796c8dcSSimon Schubert 
39385796c8dcSSimon Schubert struct gdbarch_data_registry gdbarch_data_registry =
39395796c8dcSSimon Schubert {
39405796c8dcSSimon Schubert   0, NULL,
39415796c8dcSSimon Schubert };
39425796c8dcSSimon Schubert 
39435796c8dcSSimon Schubert static struct gdbarch_data *
39445796c8dcSSimon Schubert gdbarch_data_register (gdbarch_data_pre_init_ftype *pre_init,
39455796c8dcSSimon Schubert 		       gdbarch_data_post_init_ftype *post_init)
39465796c8dcSSimon Schubert {
39475796c8dcSSimon Schubert   struct gdbarch_data_registration **curr;
3948cf7f2e2dSJohn Marino 
3949cf7f2e2dSJohn Marino   /* Append the new registration.  */
39505796c8dcSSimon Schubert   for (curr = &gdbarch_data_registry.registrations;
39515796c8dcSSimon Schubert        (*curr) != NULL;
39525796c8dcSSimon Schubert        curr = &(*curr)->next);
39535796c8dcSSimon Schubert   (*curr) = XMALLOC (struct gdbarch_data_registration);
39545796c8dcSSimon Schubert   (*curr)->next = NULL;
39555796c8dcSSimon Schubert   (*curr)->data = XMALLOC (struct gdbarch_data);
39565796c8dcSSimon Schubert   (*curr)->data->index = gdbarch_data_registry.nr++;
39575796c8dcSSimon Schubert   (*curr)->data->pre_init = pre_init;
39585796c8dcSSimon Schubert   (*curr)->data->post_init = post_init;
39595796c8dcSSimon Schubert   (*curr)->data->init_p = 1;
39605796c8dcSSimon Schubert   return (*curr)->data;
39615796c8dcSSimon Schubert }
39625796c8dcSSimon Schubert 
39635796c8dcSSimon Schubert struct gdbarch_data *
39645796c8dcSSimon Schubert gdbarch_data_register_pre_init (gdbarch_data_pre_init_ftype *pre_init)
39655796c8dcSSimon Schubert {
39665796c8dcSSimon Schubert   return gdbarch_data_register (pre_init, NULL);
39675796c8dcSSimon Schubert }
39685796c8dcSSimon Schubert 
39695796c8dcSSimon Schubert struct gdbarch_data *
39705796c8dcSSimon Schubert gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
39715796c8dcSSimon Schubert {
39725796c8dcSSimon Schubert   return gdbarch_data_register (NULL, post_init);
39735796c8dcSSimon Schubert }
39745796c8dcSSimon Schubert 
39755796c8dcSSimon Schubert /* Create/delete the gdbarch data vector.  */
39765796c8dcSSimon Schubert 
39775796c8dcSSimon Schubert static void
39785796c8dcSSimon Schubert alloc_gdbarch_data (struct gdbarch *gdbarch)
39795796c8dcSSimon Schubert {
39805796c8dcSSimon Schubert   gdb_assert (gdbarch->data == NULL);
39815796c8dcSSimon Schubert   gdbarch->nr_data = gdbarch_data_registry.nr;
39825796c8dcSSimon Schubert   gdbarch->data = GDBARCH_OBSTACK_CALLOC (gdbarch, gdbarch->nr_data, void *);
39835796c8dcSSimon Schubert }
39845796c8dcSSimon Schubert 
39855796c8dcSSimon Schubert /* Initialize the current value of the specified per-architecture
39865796c8dcSSimon Schubert    data-pointer.  */
39875796c8dcSSimon Schubert 
39885796c8dcSSimon Schubert void
39895796c8dcSSimon Schubert deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
39905796c8dcSSimon Schubert 			     struct gdbarch_data *data,
39915796c8dcSSimon Schubert 			     void *pointer)
39925796c8dcSSimon Schubert {
39935796c8dcSSimon Schubert   gdb_assert (data->index < gdbarch->nr_data);
39945796c8dcSSimon Schubert   gdb_assert (gdbarch->data[data->index] == NULL);
39955796c8dcSSimon Schubert   gdb_assert (data->pre_init == NULL);
39965796c8dcSSimon Schubert   gdbarch->data[data->index] = pointer;
39975796c8dcSSimon Schubert }
39985796c8dcSSimon Schubert 
39995796c8dcSSimon Schubert /* Return the current value of the specified per-architecture
40005796c8dcSSimon Schubert    data-pointer.  */
40015796c8dcSSimon Schubert 
40025796c8dcSSimon Schubert void *
40035796c8dcSSimon Schubert gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
40045796c8dcSSimon Schubert {
40055796c8dcSSimon Schubert   gdb_assert (data->index < gdbarch->nr_data);
40065796c8dcSSimon Schubert   if (gdbarch->data[data->index] == NULL)
40075796c8dcSSimon Schubert     {
40085796c8dcSSimon Schubert       /* The data-pointer isn't initialized, call init() to get a
40095796c8dcSSimon Schubert 	 value.  */
40105796c8dcSSimon Schubert       if (data->pre_init != NULL)
40115796c8dcSSimon Schubert 	/* Mid architecture creation: pass just the obstack, and not
40125796c8dcSSimon Schubert 	   the entire architecture, as that way it isn't possible for
40135796c8dcSSimon Schubert 	   pre-init code to refer to undefined architecture
40145796c8dcSSimon Schubert 	   fields.  */
40155796c8dcSSimon Schubert 	gdbarch->data[data->index] = data->pre_init (gdbarch->obstack);
40165796c8dcSSimon Schubert       else if (gdbarch->initialized_p
40175796c8dcSSimon Schubert 	       && data->post_init != NULL)
40185796c8dcSSimon Schubert 	/* Post architecture creation: pass the entire architecture
40195796c8dcSSimon Schubert 	   (as all fields are valid), but be careful to also detect
40205796c8dcSSimon Schubert 	   recursive references.  */
40215796c8dcSSimon Schubert 	{
40225796c8dcSSimon Schubert 	  gdb_assert (data->init_p);
40235796c8dcSSimon Schubert 	  data->init_p = 0;
40245796c8dcSSimon Schubert 	  gdbarch->data[data->index] = data->post_init (gdbarch);
40255796c8dcSSimon Schubert 	  data->init_p = 1;
40265796c8dcSSimon Schubert 	}
40275796c8dcSSimon Schubert       else
40285796c8dcSSimon Schubert 	/* The architecture initialization hasn't completed - punt -
40295796c8dcSSimon Schubert 	 hope that the caller knows what they are doing.  Once
40305796c8dcSSimon Schubert 	 deprecated_set_gdbarch_data has been initialized, this can be
40315796c8dcSSimon Schubert 	 changed to an internal error.  */
40325796c8dcSSimon Schubert 	return NULL;
40335796c8dcSSimon Schubert       gdb_assert (gdbarch->data[data->index] != NULL);
40345796c8dcSSimon Schubert     }
40355796c8dcSSimon Schubert   return gdbarch->data[data->index];
40365796c8dcSSimon Schubert }
40375796c8dcSSimon Schubert 
40385796c8dcSSimon Schubert 
40395796c8dcSSimon Schubert /* Keep a registry of the architectures known by GDB.  */
40405796c8dcSSimon Schubert 
40415796c8dcSSimon Schubert struct gdbarch_registration
40425796c8dcSSimon Schubert {
40435796c8dcSSimon Schubert   enum bfd_architecture bfd_architecture;
40445796c8dcSSimon Schubert   gdbarch_init_ftype *init;
40455796c8dcSSimon Schubert   gdbarch_dump_tdep_ftype *dump_tdep;
40465796c8dcSSimon Schubert   struct gdbarch_list *arches;
40475796c8dcSSimon Schubert   struct gdbarch_registration *next;
40485796c8dcSSimon Schubert };
40495796c8dcSSimon Schubert 
40505796c8dcSSimon Schubert static struct gdbarch_registration *gdbarch_registry = NULL;
40515796c8dcSSimon Schubert 
40525796c8dcSSimon Schubert static void
40535796c8dcSSimon Schubert append_name (const char ***buf, int *nr, const char *name)
40545796c8dcSSimon Schubert {
40555796c8dcSSimon Schubert   *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
40565796c8dcSSimon Schubert   (*buf)[*nr] = name;
40575796c8dcSSimon Schubert   *nr += 1;
40585796c8dcSSimon Schubert }
40595796c8dcSSimon Schubert 
40605796c8dcSSimon Schubert const char **
40615796c8dcSSimon Schubert gdbarch_printable_names (void)
40625796c8dcSSimon Schubert {
40635796c8dcSSimon Schubert   /* Accumulate a list of names based on the registed list of
40645796c8dcSSimon Schubert      architectures.  */
40655796c8dcSSimon Schubert   int nr_arches = 0;
40665796c8dcSSimon Schubert   const char **arches = NULL;
40675796c8dcSSimon Schubert   struct gdbarch_registration *rego;
4068cf7f2e2dSJohn Marino 
40695796c8dcSSimon Schubert   for (rego = gdbarch_registry;
40705796c8dcSSimon Schubert        rego != NULL;
40715796c8dcSSimon Schubert        rego = rego->next)
40725796c8dcSSimon Schubert     {
40735796c8dcSSimon Schubert       const struct bfd_arch_info *ap;
40745796c8dcSSimon Schubert       ap = bfd_lookup_arch (rego->bfd_architecture, 0);
40755796c8dcSSimon Schubert       if (ap == NULL)
40765796c8dcSSimon Schubert         internal_error (__FILE__, __LINE__,
40775796c8dcSSimon Schubert                         _("gdbarch_architecture_names: multi-arch unknown"));
40785796c8dcSSimon Schubert       do
40795796c8dcSSimon Schubert         {
40805796c8dcSSimon Schubert           append_name (&arches, &nr_arches, ap->printable_name);
40815796c8dcSSimon Schubert           ap = ap->next;
40825796c8dcSSimon Schubert         }
40835796c8dcSSimon Schubert       while (ap != NULL);
40845796c8dcSSimon Schubert     }
40855796c8dcSSimon Schubert   append_name (&arches, &nr_arches, NULL);
40865796c8dcSSimon Schubert   return arches;
40875796c8dcSSimon Schubert }
40885796c8dcSSimon Schubert 
40895796c8dcSSimon Schubert 
40905796c8dcSSimon Schubert void
40915796c8dcSSimon Schubert gdbarch_register (enum bfd_architecture bfd_architecture,
40925796c8dcSSimon Schubert                   gdbarch_init_ftype *init,
40935796c8dcSSimon Schubert 		  gdbarch_dump_tdep_ftype *dump_tdep)
40945796c8dcSSimon Schubert {
40955796c8dcSSimon Schubert   struct gdbarch_registration **curr;
40965796c8dcSSimon Schubert   const struct bfd_arch_info *bfd_arch_info;
4097cf7f2e2dSJohn Marino 
40985796c8dcSSimon Schubert   /* Check that BFD recognizes this architecture */
40995796c8dcSSimon Schubert   bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
41005796c8dcSSimon Schubert   if (bfd_arch_info == NULL)
41015796c8dcSSimon Schubert     {
41025796c8dcSSimon Schubert       internal_error (__FILE__, __LINE__,
4103c50c785cSJohn Marino                       _("gdbarch: Attempt to register "
4104c50c785cSJohn Marino 			"unknown architecture (%d)"),
41055796c8dcSSimon Schubert                       bfd_architecture);
41065796c8dcSSimon Schubert     }
4107c50c785cSJohn Marino   /* Check that we haven't seen this architecture before.  */
41085796c8dcSSimon Schubert   for (curr = &gdbarch_registry;
41095796c8dcSSimon Schubert        (*curr) != NULL;
41105796c8dcSSimon Schubert        curr = &(*curr)->next)
41115796c8dcSSimon Schubert     {
41125796c8dcSSimon Schubert       if (bfd_architecture == (*curr)->bfd_architecture)
41135796c8dcSSimon Schubert 	internal_error (__FILE__, __LINE__,
4114*a45ae5f8SJohn Marino                         _("gdbarch: Duplicate registration "
4115c50c785cSJohn Marino 			  "of architecture (%s)"),
41165796c8dcSSimon Schubert 	                bfd_arch_info->printable_name);
41175796c8dcSSimon Schubert     }
41185796c8dcSSimon Schubert   /* log it */
41195796c8dcSSimon Schubert   if (gdbarch_debug)
41205796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, %s)\n",
41215796c8dcSSimon Schubert 			bfd_arch_info->printable_name,
41225796c8dcSSimon Schubert 			host_address_to_string (init));
41235796c8dcSSimon Schubert   /* Append it */
41245796c8dcSSimon Schubert   (*curr) = XMALLOC (struct gdbarch_registration);
41255796c8dcSSimon Schubert   (*curr)->bfd_architecture = bfd_architecture;
41265796c8dcSSimon Schubert   (*curr)->init = init;
41275796c8dcSSimon Schubert   (*curr)->dump_tdep = dump_tdep;
41285796c8dcSSimon Schubert   (*curr)->arches = NULL;
41295796c8dcSSimon Schubert   (*curr)->next = NULL;
41305796c8dcSSimon Schubert }
41315796c8dcSSimon Schubert 
41325796c8dcSSimon Schubert void
41335796c8dcSSimon Schubert register_gdbarch_init (enum bfd_architecture bfd_architecture,
41345796c8dcSSimon Schubert 		       gdbarch_init_ftype *init)
41355796c8dcSSimon Schubert {
41365796c8dcSSimon Schubert   gdbarch_register (bfd_architecture, init, NULL);
41375796c8dcSSimon Schubert }
41385796c8dcSSimon Schubert 
41395796c8dcSSimon Schubert 
41405796c8dcSSimon Schubert /* Look for an architecture using gdbarch_info.  */
41415796c8dcSSimon Schubert 
41425796c8dcSSimon Schubert struct gdbarch_list *
41435796c8dcSSimon Schubert gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
41445796c8dcSSimon Schubert                              const struct gdbarch_info *info)
41455796c8dcSSimon Schubert {
41465796c8dcSSimon Schubert   for (; arches != NULL; arches = arches->next)
41475796c8dcSSimon Schubert     {
41485796c8dcSSimon Schubert       if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info)
41495796c8dcSSimon Schubert 	continue;
41505796c8dcSSimon Schubert       if (info->byte_order != arches->gdbarch->byte_order)
41515796c8dcSSimon Schubert 	continue;
41525796c8dcSSimon Schubert       if (info->osabi != arches->gdbarch->osabi)
41535796c8dcSSimon Schubert 	continue;
41545796c8dcSSimon Schubert       if (info->target_desc != arches->gdbarch->target_desc)
41555796c8dcSSimon Schubert 	continue;
41565796c8dcSSimon Schubert       return arches;
41575796c8dcSSimon Schubert     }
41585796c8dcSSimon Schubert   return NULL;
41595796c8dcSSimon Schubert }
41605796c8dcSSimon Schubert 
41615796c8dcSSimon Schubert 
41625796c8dcSSimon Schubert /* Find an architecture that matches the specified INFO.  Create a new
41635796c8dcSSimon Schubert    architecture if needed.  Return that new architecture.  */
41645796c8dcSSimon Schubert 
41655796c8dcSSimon Schubert struct gdbarch *
41665796c8dcSSimon Schubert gdbarch_find_by_info (struct gdbarch_info info)
41675796c8dcSSimon Schubert {
41685796c8dcSSimon Schubert   struct gdbarch *new_gdbarch;
41695796c8dcSSimon Schubert   struct gdbarch_registration *rego;
41705796c8dcSSimon Schubert 
41715796c8dcSSimon Schubert   /* Fill in missing parts of the INFO struct using a number of
41725796c8dcSSimon Schubert      sources: "set ..."; INFOabfd supplied; and the global
41735796c8dcSSimon Schubert      defaults.  */
41745796c8dcSSimon Schubert   gdbarch_info_fill (&info);
41755796c8dcSSimon Schubert 
41765796c8dcSSimon Schubert   /* Must have found some sort of architecture.  */
41775796c8dcSSimon Schubert   gdb_assert (info.bfd_arch_info != NULL);
41785796c8dcSSimon Schubert 
41795796c8dcSSimon Schubert   if (gdbarch_debug)
41805796c8dcSSimon Schubert     {
41815796c8dcSSimon Schubert       fprintf_unfiltered (gdb_stdlog,
41825796c8dcSSimon Schubert 			  "gdbarch_find_by_info: info.bfd_arch_info %s\n",
41835796c8dcSSimon Schubert 			  (info.bfd_arch_info != NULL
41845796c8dcSSimon Schubert 			   ? info.bfd_arch_info->printable_name
41855796c8dcSSimon Schubert 			   : "(null)"));
41865796c8dcSSimon Schubert       fprintf_unfiltered (gdb_stdlog,
41875796c8dcSSimon Schubert 			  "gdbarch_find_by_info: info.byte_order %d (%s)\n",
41885796c8dcSSimon Schubert 			  info.byte_order,
41895796c8dcSSimon Schubert 			  (info.byte_order == BFD_ENDIAN_BIG ? "big"
41905796c8dcSSimon Schubert 			   : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
41915796c8dcSSimon Schubert 			   : "default"));
41925796c8dcSSimon Schubert       fprintf_unfiltered (gdb_stdlog,
41935796c8dcSSimon Schubert 			  "gdbarch_find_by_info: info.osabi %d (%s)\n",
41945796c8dcSSimon Schubert 			  info.osabi, gdbarch_osabi_name (info.osabi));
41955796c8dcSSimon Schubert       fprintf_unfiltered (gdb_stdlog,
41965796c8dcSSimon Schubert 			  "gdbarch_find_by_info: info.abfd %s\n",
41975796c8dcSSimon Schubert 			  host_address_to_string (info.abfd));
41985796c8dcSSimon Schubert       fprintf_unfiltered (gdb_stdlog,
41995796c8dcSSimon Schubert 			  "gdbarch_find_by_info: info.tdep_info %s\n",
42005796c8dcSSimon Schubert 			  host_address_to_string (info.tdep_info));
42015796c8dcSSimon Schubert     }
42025796c8dcSSimon Schubert 
42035796c8dcSSimon Schubert   /* Find the tdep code that knows about this architecture.  */
42045796c8dcSSimon Schubert   for (rego = gdbarch_registry;
42055796c8dcSSimon Schubert        rego != NULL;
42065796c8dcSSimon Schubert        rego = rego->next)
42075796c8dcSSimon Schubert     if (rego->bfd_architecture == info.bfd_arch_info->arch)
42085796c8dcSSimon Schubert       break;
42095796c8dcSSimon Schubert   if (rego == NULL)
42105796c8dcSSimon Schubert     {
42115796c8dcSSimon Schubert       if (gdbarch_debug)
42125796c8dcSSimon Schubert 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
42135796c8dcSSimon Schubert 			    "No matching architecture\n");
42145796c8dcSSimon Schubert       return 0;
42155796c8dcSSimon Schubert     }
42165796c8dcSSimon Schubert 
42175796c8dcSSimon Schubert   /* Ask the tdep code for an architecture that matches "info".  */
42185796c8dcSSimon Schubert   new_gdbarch = rego->init (info, rego->arches);
42195796c8dcSSimon Schubert 
42205796c8dcSSimon Schubert   /* Did the tdep code like it?  No.  Reject the change and revert to
42215796c8dcSSimon Schubert      the old architecture.  */
42225796c8dcSSimon Schubert   if (new_gdbarch == NULL)
42235796c8dcSSimon Schubert     {
42245796c8dcSSimon Schubert       if (gdbarch_debug)
42255796c8dcSSimon Schubert 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
42265796c8dcSSimon Schubert 			    "Target rejected architecture\n");
42275796c8dcSSimon Schubert       return NULL;
42285796c8dcSSimon Schubert     }
42295796c8dcSSimon Schubert 
42305796c8dcSSimon Schubert   /* Is this a pre-existing architecture (as determined by already
42315796c8dcSSimon Schubert      being initialized)?  Move it to the front of the architecture
42325796c8dcSSimon Schubert      list (keeping the list sorted Most Recently Used).  */
42335796c8dcSSimon Schubert   if (new_gdbarch->initialized_p)
42345796c8dcSSimon Schubert     {
42355796c8dcSSimon Schubert       struct gdbarch_list **list;
42365796c8dcSSimon Schubert       struct gdbarch_list *this;
42375796c8dcSSimon Schubert       if (gdbarch_debug)
42385796c8dcSSimon Schubert 	fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
42395796c8dcSSimon Schubert 			    "Previous architecture %s (%s) selected\n",
42405796c8dcSSimon Schubert 			    host_address_to_string (new_gdbarch),
42415796c8dcSSimon Schubert 			    new_gdbarch->bfd_arch_info->printable_name);
42425796c8dcSSimon Schubert       /* Find the existing arch in the list.  */
42435796c8dcSSimon Schubert       for (list = &rego->arches;
42445796c8dcSSimon Schubert 	   (*list) != NULL && (*list)->gdbarch != new_gdbarch;
42455796c8dcSSimon Schubert 	   list = &(*list)->next);
42465796c8dcSSimon Schubert       /* It had better be in the list of architectures.  */
42475796c8dcSSimon Schubert       gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
42485796c8dcSSimon Schubert       /* Unlink THIS.  */
42495796c8dcSSimon Schubert       this = (*list);
42505796c8dcSSimon Schubert       (*list) = this->next;
42515796c8dcSSimon Schubert       /* Insert THIS at the front.  */
42525796c8dcSSimon Schubert       this->next = rego->arches;
42535796c8dcSSimon Schubert       rego->arches = this;
42545796c8dcSSimon Schubert       /* Return it.  */
42555796c8dcSSimon Schubert       return new_gdbarch;
42565796c8dcSSimon Schubert     }
42575796c8dcSSimon Schubert 
42585796c8dcSSimon Schubert   /* It's a new architecture.  */
42595796c8dcSSimon Schubert   if (gdbarch_debug)
42605796c8dcSSimon Schubert     fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
42615796c8dcSSimon Schubert 			"New architecture %s (%s) selected\n",
42625796c8dcSSimon Schubert 			host_address_to_string (new_gdbarch),
42635796c8dcSSimon Schubert 			new_gdbarch->bfd_arch_info->printable_name);
42645796c8dcSSimon Schubert 
42655796c8dcSSimon Schubert   /* Insert the new architecture into the front of the architecture
42665796c8dcSSimon Schubert      list (keep the list sorted Most Recently Used).  */
42675796c8dcSSimon Schubert   {
42685796c8dcSSimon Schubert     struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
42695796c8dcSSimon Schubert     this->next = rego->arches;
42705796c8dcSSimon Schubert     this->gdbarch = new_gdbarch;
42715796c8dcSSimon Schubert     rego->arches = this;
42725796c8dcSSimon Schubert   }
42735796c8dcSSimon Schubert 
42745796c8dcSSimon Schubert   /* Check that the newly installed architecture is valid.  Plug in
42755796c8dcSSimon Schubert      any post init values.  */
42765796c8dcSSimon Schubert   new_gdbarch->dump_tdep = rego->dump_tdep;
42775796c8dcSSimon Schubert   verify_gdbarch (new_gdbarch);
42785796c8dcSSimon Schubert   new_gdbarch->initialized_p = 1;
42795796c8dcSSimon Schubert 
42805796c8dcSSimon Schubert   if (gdbarch_debug)
42815796c8dcSSimon Schubert     gdbarch_dump (new_gdbarch, gdb_stdlog);
42825796c8dcSSimon Schubert 
42835796c8dcSSimon Schubert   return new_gdbarch;
42845796c8dcSSimon Schubert }
42855796c8dcSSimon Schubert 
42865796c8dcSSimon Schubert /* Make the specified architecture current.  */
42875796c8dcSSimon Schubert 
42885796c8dcSSimon Schubert void
42895796c8dcSSimon Schubert deprecated_target_gdbarch_select_hack (struct gdbarch *new_gdbarch)
42905796c8dcSSimon Schubert {
42915796c8dcSSimon Schubert   gdb_assert (new_gdbarch != NULL);
42925796c8dcSSimon Schubert   gdb_assert (new_gdbarch->initialized_p);
42935796c8dcSSimon Schubert   target_gdbarch = new_gdbarch;
42945796c8dcSSimon Schubert   observer_notify_architecture_changed (new_gdbarch);
42955796c8dcSSimon Schubert   registers_changed ();
42965796c8dcSSimon Schubert }
42975796c8dcSSimon Schubert 
42985796c8dcSSimon Schubert extern void _initialize_gdbarch (void);
42995796c8dcSSimon Schubert 
43005796c8dcSSimon Schubert void
43015796c8dcSSimon Schubert _initialize_gdbarch (void)
43025796c8dcSSimon Schubert {
43035796c8dcSSimon Schubert   add_setshow_zinteger_cmd ("arch", class_maintenance, &gdbarch_debug, _("\
43045796c8dcSSimon Schubert Set architecture debugging."), _("\
43055796c8dcSSimon Schubert Show architecture debugging."), _("\
43065796c8dcSSimon Schubert When non-zero, architecture debugging is enabled."),
43075796c8dcSSimon Schubert                             NULL,
43085796c8dcSSimon Schubert                             show_gdbarch_debug,
43095796c8dcSSimon Schubert                             &setdebuglist, &showdebuglist);
43105796c8dcSSimon Schubert }
4311