* gdbarch.sh: Assert that gdbarch is non-NULL.
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index b1276c7d5ad0c657cc51444c4edf15641b781b03..ce4540d859d6134fda37df8884fc89b41d6375d4 100644 (file)
@@ -1,7 +1,7 @@
 /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
 
 /* Dynamic architecture support for GDB, the GNU debugger.
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -74,13 +74,6 @@ static void init_gdbarch_swap (struct gdbarch *);
 static void swapout_gdbarch_swap (struct gdbarch *);
 static void swapin_gdbarch_swap (struct gdbarch *);
 
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
-
 /* Non-zero if we want to trace architecture code.  */
 
 #ifndef GDBARCH_DEBUG
@@ -145,11 +138,9 @@ struct gdbarch
   int addr_bit;
   int bfd_vma_bit;
   int char_signed;
-  int ieee_float;
   gdbarch_read_pc_ftype *read_pc;
   gdbarch_write_pc_ftype *write_pc;
   gdbarch_read_fp_ftype *read_fp;
-  gdbarch_write_fp_ftype *write_fp;
   gdbarch_read_sp_ftype *read_sp;
   gdbarch_write_sp_ftype *write_sp;
   gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
@@ -160,6 +151,7 @@ struct gdbarch
   int sp_regnum;
   int fp_regnum;
   int pc_regnum;
+  int ps_regnum;
   int fp0_regnum;
   int npc_regnum;
   int nnpc_regnum;
@@ -178,10 +170,12 @@ struct gdbarch
   int max_register_virtual_size;
   gdbarch_register_virtual_type_ftype *register_virtual_type;
   gdbarch_do_registers_info_ftype *do_registers_info;
+  gdbarch_print_float_info_ftype *print_float_info;
   gdbarch_register_sim_regno_ftype *register_sim_regno;
   gdbarch_register_bytes_ok_ftype *register_bytes_ok;
   gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
   gdbarch_cannot_store_register_ftype *cannot_store_register;
+  gdbarch_get_longjmp_target_ftype *get_longjmp_target;
   int use_generic_dummy_frames;
   int call_dummy_location;
   gdbarch_call_dummy_address_ftype *call_dummy_address;
@@ -251,13 +245,17 @@ struct gdbarch
   const struct floatformat * long_double_format;
   gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
   gdbarch_addr_bits_remove_ftype *addr_bits_remove;
+  gdbarch_smash_text_address_ftype *smash_text_address;
   gdbarch_software_single_step_ftype *software_single_step;
   gdbarch_print_insn_ftype *print_insn;
   gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
   gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+  gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
   gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
   gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
+  gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
+  gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
 };
 
 
@@ -270,7 +268,7 @@ struct gdbarch startup_gdbarch =
 {
   /* basic architecture information */
   &bfd_default_arch_struct,
-  BIG_ENDIAN,
+  BFD_ENDIAN_BIG,
   /* target specific vector and its dump routine */
   NULL, NULL,
   /*per-architecture data-pointers and swap regions */
@@ -297,6 +295,10 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  -1,
+  -1,
+  -1,
+  -1,
   0,
   0,
   0,
@@ -309,14 +311,13 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  generic_register_raw_size,
   0,
+  generic_register_virtual_size,
   0,
   0,
   0,
   0,
-  generic_register_raw_size,
-  0,
-  generic_register_virtual_size,
   0,
   0,
   0,
@@ -341,9 +342,9 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  generic_get_saved_register,
   0,
   0,
-  generic_get_saved_register,
   0,
   0,
   0,
@@ -400,6 +401,8 @@ struct gdbarch startup_gdbarch =
   generic_in_function_epilogue_p,
   construct_inferior_arguments,
   0,
+  0,
+  0,
   /* startup_gdbarch() */
 };
 
@@ -411,6 +414,7 @@ void
 initialize_non_multiarch ()
 {
   alloc_gdbarch_data (&startup_gdbarch);
+  init_gdbarch_swap (&startup_gdbarch);
   init_gdbarch_data (&startup_gdbarch);
 }
 
@@ -445,14 +449,13 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
   current_gdbarch->float_bit = 4*TARGET_CHAR_BIT;
   current_gdbarch->double_bit = 8*TARGET_CHAR_BIT;
-  current_gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
+  current_gdbarch->long_double_bit = 8*TARGET_CHAR_BIT;
   current_gdbarch->ptr_bit = TARGET_INT_BIT;
   current_gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
   current_gdbarch->char_signed = -1;
   current_gdbarch->read_pc = generic_target_read_pc;
   current_gdbarch->write_pc = generic_target_write_pc;
   current_gdbarch->read_fp = generic_target_read_fp;
-  current_gdbarch->write_fp = generic_target_write_fp;
   current_gdbarch->read_sp = generic_target_read_sp;
   current_gdbarch->write_sp = generic_target_write_sp;
   current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
@@ -460,6 +463,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->sp_regnum = -1;
   current_gdbarch->fp_regnum = -1;
   current_gdbarch->pc_regnum = -1;
+  current_gdbarch->ps_regnum = -1;
   current_gdbarch->fp0_regnum = -1;
   current_gdbarch->npc_regnum = -1;
   current_gdbarch->nnpc_regnum = -1;
@@ -474,6 +478,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->max_register_raw_size = -1;
   current_gdbarch->max_register_virtual_size = -1;
   current_gdbarch->do_registers_info = do_registers_info;
+  current_gdbarch->print_float_info = default_print_float_info;
   current_gdbarch->register_sim_regno = default_register_sim_regno;
   current_gdbarch->cannot_fetch_register = cannot_register_not;
   current_gdbarch->cannot_store_register = cannot_register_not;
@@ -493,6 +498,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
   current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
   current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+  current_gdbarch->push_arguments = default_push_arguments;
   current_gdbarch->use_struct_convention = generic_use_struct_convention;
   current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
   current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
@@ -504,14 +510,19 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
   current_gdbarch->frame_args_skip = -1;
   current_gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
+  current_gdbarch->frame_chain_valid = func_frame_chain_valid;
   current_gdbarch->extra_stack_alignment_needed = 1;
   current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
   current_gdbarch->addr_bits_remove = core_addr_identity;
+  current_gdbarch->smash_text_address = core_addr_identity;
   current_gdbarch->print_insn = legacy_print_insn;
   current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
   current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+  current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
   current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
   current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
+  current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
+  current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
   /* gdbarch_alloc() */
 
   return current_gdbarch;
@@ -548,7 +559,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   log = mem_fileopen ();
   cleanups = make_cleanup_ui_file_delete (log);
   /* fundamental */
-  if (gdbarch->byte_order == 0)
+  if (gdbarch->byte_order == BFD_ENDIAN_UNKNOWN)
     fprintf_unfiltered (log, "\n\tbyte-order");
   if (gdbarch->bfd_arch_info == NULL)
     fprintf_unfiltered (log, "\n\tbfd_arch_info");
@@ -566,29 +577,22 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
   if (gdbarch->char_signed == -1)
     gdbarch->char_signed = 1;
-  /* Skip verify of ieee_float, invalid_p == 0 */
   /* Skip verify of read_pc, invalid_p == 0 */
   /* Skip verify of write_pc, invalid_p == 0 */
   /* Skip verify of read_fp, invalid_p == 0 */
-  /* Skip verify of write_fp, invalid_p == 0 */
   /* Skip verify of read_sp, invalid_p == 0 */
   /* Skip verify of write_sp, invalid_p == 0 */
   /* Skip verify of virtual_frame_pointer, invalid_p == 0 */
   /* Skip verify of register_read, has predicate */
   /* Skip verify of register_write, has predicate */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->num_regs == -1))
     fprintf_unfiltered (log, "\n\tnum_regs");
   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->sp_regnum == -1))
-    fprintf_unfiltered (log, "\n\tsp_regnum");
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->fp_regnum == -1))
-    fprintf_unfiltered (log, "\n\tfp_regnum");
-  if ((GDB_MULTI_ARCH >= 2)
-      && (gdbarch->pc_regnum == -1))
-    fprintf_unfiltered (log, "\n\tpc_regnum");
+  /* Skip verify of sp_regnum, invalid_p == 0 */
+  /* Skip verify of fp_regnum, invalid_p == 0 */
+  /* Skip verify of pc_regnum, invalid_p == 0 */
+  /* Skip verify of ps_regnum, invalid_p == 0 */
   /* Skip verify of fp0_regnum, invalid_p == 0 */
   /* Skip verify of npc_regnum, invalid_p == 0 */
   /* Skip verify of nnpc_regnum, invalid_p == 0 */
@@ -598,77 +602,79 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
   /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
   /* Skip verify of register_name, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_size == -1))
     fprintf_unfiltered (log, "\n\tregister_size");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_bytes == -1))
     fprintf_unfiltered (log, "\n\tregister_bytes");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_byte == 0))
     fprintf_unfiltered (log, "\n\tregister_byte");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_raw_size == 0))
     fprintf_unfiltered (log, "\n\tregister_raw_size");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->max_register_raw_size == -1))
     fprintf_unfiltered (log, "\n\tmax_register_raw_size");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_virtual_size == 0))
     fprintf_unfiltered (log, "\n\tregister_virtual_size");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->max_register_virtual_size == -1))
     fprintf_unfiltered (log, "\n\tmax_register_virtual_size");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->register_virtual_type == 0))
     fprintf_unfiltered (log, "\n\tregister_virtual_type");
   /* Skip verify of do_registers_info, invalid_p == 0 */
+  /* Skip verify of print_float_info, invalid_p == 0 */
   /* Skip verify of register_sim_regno, invalid_p == 0 */
   /* Skip verify of register_bytes_ok, has predicate */
   /* Skip verify of cannot_fetch_register, invalid_p == 0 */
   /* Skip verify of cannot_store_register, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 1)
+  /* Skip verify of get_longjmp_target, has predicate */
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->use_generic_dummy_frames == -1))
     fprintf_unfiltered (log, "\n\tuse_generic_dummy_frames");
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_location == 0))
     fprintf_unfiltered (log, "\n\tcall_dummy_location");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0))
     fprintf_unfiltered (log, "\n\tcall_dummy_address");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_start_offset == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_start_offset");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset");
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_breakpoint_offset_p == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_breakpoint_offset_p");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_length == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_length");
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->pc_in_call_dummy == 0))
     fprintf_unfiltered (log, "\n\tpc_in_call_dummy");
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_p == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_p");
   /* Skip verify of call_dummy_words, invalid_p == 0 */
   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_stack_adjust_p == -1))
     fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust_p");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0))
     fprintf_unfiltered (log, "\n\tcall_dummy_stack_adjust");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->fix_call_dummy == 0))
     fprintf_unfiltered (log, "\n\tfix_call_dummy");
   /* Skip verify of init_frame_pc_first, invalid_p == 0 */
   /* Skip verify of init_frame_pc, invalid_p == 0 */
   /* Skip verify of coerce_float_to_double, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 1)
+  if ((GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->get_saved_register == 0))
     fprintf_unfiltered (log, "\n\tget_saved_register");
   /* Skip verify of register_convertible, invalid_p == 0 */
@@ -680,72 +686,68 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of address_to_pointer, invalid_p == 0 */
   /* Skip verify of integer_to_address, has predicate */
   /* Skip verify of return_value_on_stack, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->extract_return_value == 0))
     fprintf_unfiltered (log, "\n\textract_return_value");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->push_arguments == 0))
-    fprintf_unfiltered (log, "\n\tpush_arguments");
-  if ((GDB_MULTI_ARCH >= 2)
+  /* Skip verify of push_arguments, invalid_p == 0 */
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->push_dummy_frame == 0))
     fprintf_unfiltered (log, "\n\tpush_dummy_frame");
   /* Skip verify of push_return_address, has predicate */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->pop_frame == 0))
     fprintf_unfiltered (log, "\n\tpop_frame");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->store_struct_return == 0))
     fprintf_unfiltered (log, "\n\tstore_struct_return");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->store_return_value == 0))
     fprintf_unfiltered (log, "\n\tstore_return_value");
   /* Skip verify of extract_struct_value_address, has predicate */
   /* Skip verify of use_struct_convention, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_init_saved_regs == 0))
     fprintf_unfiltered (log, "\n\tframe_init_saved_regs");
   /* Skip verify of init_extra_frame_info, has predicate */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->skip_prologue == 0))
     fprintf_unfiltered (log, "\n\tskip_prologue");
   /* Skip verify of prologue_frameless_p, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->inner_than == 0))
     fprintf_unfiltered (log, "\n\tinner_than");
   /* Skip verify of breakpoint_from_pc, invalid_p == 0 */
   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->decr_pc_after_break == -1))
     fprintf_unfiltered (log, "\n\tdecr_pc_after_break");
   /* Skip verify of prepare_to_proceed, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->function_start_offset == -1))
     fprintf_unfiltered (log, "\n\tfunction_start_offset");
   /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_args_skip == -1))
     fprintf_unfiltered (log, "\n\tframe_args_skip");
   /* Skip verify of frameless_function_invocation, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_chain == 0))
     fprintf_unfiltered (log, "\n\tframe_chain");
-  if ((GDB_MULTI_ARCH >= 1)
-      && (gdbarch->frame_chain_valid == 0))
-    fprintf_unfiltered (log, "\n\tframe_chain_valid");
-  if ((GDB_MULTI_ARCH >= 2)
+  /* Skip verify of frame_chain_valid, invalid_p == 0 */
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_saved_pc == 0))
     fprintf_unfiltered (log, "\n\tframe_saved_pc");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_args_address == 0))
     fprintf_unfiltered (log, "\n\tframe_args_address");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_locals_address == 0))
     fprintf_unfiltered (log, "\n\tframe_locals_address");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->saved_pc_after_call == 0))
     fprintf_unfiltered (log, "\n\tsaved_pc_after_call");
-  if ((GDB_MULTI_ARCH >= 2)
+  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->frame_num_args == 0))
     fprintf_unfiltered (log, "\n\tframe_num_args");
   /* Skip verify of stack_align, has predicate */
@@ -757,16 +759,20 @@ verify_gdbarch (struct gdbarch *gdbarch)
   if (gdbarch->double_format == 0)
     gdbarch->double_format = default_double_format (gdbarch);
   if (gdbarch->long_double_format == 0)
-    gdbarch->long_double_format = &floatformat_unknown;
+    gdbarch->long_double_format = default_double_format (gdbarch);
   /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
   /* Skip verify of addr_bits_remove, invalid_p == 0 */
+  /* Skip verify of smash_text_address, invalid_p == 0 */
   /* Skip verify of software_single_step, has predicate */
   /* Skip verify of print_insn, invalid_p == 0 */
   /* Skip verify of skip_trampoline_code, invalid_p == 0 */
   /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+  /* Skip verify of pc_in_sigtramp, invalid_p == 0 */
   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
   /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
   /* Skip verify of dwarf2_build_frame_info, has predicate */
+  /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
+  /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
   buf = ui_file_xstrdup (log, &dummy);
   make_cleanup (xfree, buf);
   if (strlen (buf) > 0)
@@ -973,6 +979,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         "gdbarch_dump: COERCE_FLOAT_TO_DOUBLE = 0x%08lx\n",
                         (long) current_gdbarch->coerce_float_to_double
                         /*COERCE_FLOAT_TO_DOUBLE ()*/);
+#endif
+#ifdef COFF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
+                      XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+                        (long) current_gdbarch->coff_make_msymbol_special
+                        /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
 #endif
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
@@ -1058,6 +1078,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->ecoff_reg_to_regnum
                         /*ECOFF_REG_TO_REGNUM ()*/);
 #endif
+#ifdef ELF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
+                      XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+                        (long) current_gdbarch->elf_make_msymbol_special
+                        /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
+#endif
 #ifdef EXTRACT_RETURN_VALUE
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -1242,6 +1276,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
                       (long) FUNCTION_START_OFFSET);
 #endif
+#ifdef GET_LONGJMP_TARGET
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "GET_LONGJMP_TARGET(pc)",
+                      XSTRING (GET_LONGJMP_TARGET (pc)));
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: GET_LONGJMP_TARGET = 0x%08lx\n",
+                        (long) current_gdbarch->get_longjmp_target
+                        /*GET_LONGJMP_TARGET ()*/);
+#endif
 #ifdef GET_SAVED_REGISTER
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -1256,14 +1301,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->get_saved_register
                         /*GET_SAVED_REGISTER ()*/);
 #endif
-#ifdef IEEE_FLOAT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: IEEE_FLOAT # %s\n",
-                      XSTRING (IEEE_FLOAT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: IEEE_FLOAT = %d\n",
-                      IEEE_FLOAT);
-#endif
 #ifdef INIT_EXTRA_FRAME_INFO
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -1428,6 +1465,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->pc_in_call_dummy
                         /*PC_IN_CALL_DUMMY ()*/);
 #endif
+#ifdef PC_IN_SIGTRAMP
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "PC_IN_SIGTRAMP(pc, name)",
+                      XSTRING (PC_IN_SIGTRAMP (pc, name)));
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: PC_IN_SIGTRAMP = 0x%08lx\n",
+                        (long) current_gdbarch->pc_in_sigtramp
+                        /*PC_IN_SIGTRAMP ()*/);
+#endif
 #ifdef PC_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: PC_REGNUM # %s\n",
@@ -1472,6 +1520,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->prepare_to_proceed
                         /*PREPARE_TO_PROCEED ()*/);
 #endif
+#ifdef PRINT_FLOAT_INFO
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "PRINT_FLOAT_INFO()",
+                      XSTRING (PRINT_FLOAT_INFO ()));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: PRINT_FLOAT_INFO = 0x%08lx\n",
+                        (long) current_gdbarch->print_float_info
+                        /*PRINT_FLOAT_INFO ()*/);
+#endif
 #ifdef PROLOGUE_FRAMELESS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1483,6 +1545,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->prologue_frameless_p
                         /*PROLOGUE_FRAMELESS_P ()*/);
 #endif
+#ifdef PS_REGNUM
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: PS_REGNUM # %s\n",
+                      XSTRING (PS_REGNUM));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: PS_REGNUM = %d\n",
+                      PS_REGNUM);
+#endif
 #ifdef PUSH_ARGUMENTS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1753,6 +1823,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->skip_trampoline_code
                         /*SKIP_TRAMPOLINE_CODE ()*/);
 #endif
+#ifdef SMASH_TEXT_ADDRESS
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "SMASH_TEXT_ADDRESS(addr)",
+                      XSTRING (SMASH_TEXT_ADDRESS (addr)));
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n",
+                        (long) current_gdbarch->smash_text_address
+                        /*SMASH_TEXT_ADDRESS ()*/);
+#endif
 #ifdef SOFTWARE_SINGLE_STEP
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -2026,20 +2107,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->virtual_frame_pointer
                         /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
 #endif
-#ifdef TARGET_WRITE_FP
-#if GDB_MULTI_ARCH
-  /* Macro might contain `[{}]' when not multi-arch */
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_WRITE_FP(val)",
-                      XSTRING (TARGET_WRITE_FP (val)));
-#endif
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
-                        (long) current_gdbarch->write_fp
-                        /*TARGET_WRITE_FP ()*/);
-#endif
 #ifdef TARGET_WRITE_PC
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -2103,6 +2170,7 @@ gdbarch_tdep (struct gdbarch *gdbarch)
 const struct bfd_arch_info *
 gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
   return gdbarch->bfd_arch_info;
@@ -2111,6 +2179,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
 int
 gdbarch_byte_order (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
   return gdbarch->byte_order;
@@ -2119,6 +2188,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
 int
 gdbarch_short_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of short_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
@@ -2135,6 +2205,7 @@ set_gdbarch_short_bit (struct gdbarch *gdbarch,
 int
 gdbarch_int_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of int_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
@@ -2151,6 +2222,7 @@ set_gdbarch_int_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of long_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
@@ -2167,6 +2239,7 @@ set_gdbarch_long_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_long_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of long_long_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
@@ -2183,6 +2256,7 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
 int
 gdbarch_float_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of float_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
@@ -2199,6 +2273,7 @@ set_gdbarch_float_bit (struct gdbarch *gdbarch,
 int
 gdbarch_double_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of double_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
@@ -2215,6 +2290,7 @@ set_gdbarch_double_bit (struct gdbarch *gdbarch,
 int
 gdbarch_long_double_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of long_double_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
@@ -2231,6 +2307,7 @@ set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
 int
 gdbarch_ptr_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of ptr_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
@@ -2247,6 +2324,7 @@ set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
 int
 gdbarch_addr_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->addr_bit == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_addr_bit invalid");
@@ -2265,6 +2343,7 @@ set_gdbarch_addr_bit (struct gdbarch *gdbarch,
 int
 gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of bfd_vma_bit, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
@@ -2281,6 +2360,7 @@ set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
 int
 gdbarch_char_signed (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->char_signed == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_char_signed invalid");
@@ -2296,25 +2376,10 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch,
   gdbarch->char_signed = char_signed;
 }
 
-int
-gdbarch_ieee_float (struct gdbarch *gdbarch)
-{
-  /* Skip verify of ieee_float, invalid_p == 0 */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
-  return gdbarch->ieee_float;
-}
-
-void
-set_gdbarch_ieee_float (struct gdbarch *gdbarch,
-                        int ieee_float)
-{
-  gdbarch->ieee_float = ieee_float;
-}
-
 CORE_ADDR
 gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->read_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_read_pc invalid");
@@ -2333,6 +2398,7 @@ set_gdbarch_read_pc (struct gdbarch *gdbarch,
 void
 gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->write_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_write_pc invalid");
@@ -2351,6 +2417,7 @@ set_gdbarch_write_pc (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_read_fp (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->read_fp == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_read_fp invalid");
@@ -2366,27 +2433,10 @@ set_gdbarch_read_fp (struct gdbarch *gdbarch,
   gdbarch->read_fp = read_fp;
 }
 
-void
-gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
-{
-  if (gdbarch->write_fp == 0)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_write_fp invalid");
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
-  gdbarch->write_fp (val);
-}
-
-void
-set_gdbarch_write_fp (struct gdbarch *gdbarch,
-                      gdbarch_write_fp_ftype write_fp)
-{
-  gdbarch->write_fp = write_fp;
-}
-
 CORE_ADDR
 gdbarch_read_sp (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->read_sp == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_read_sp invalid");
@@ -2405,6 +2455,7 @@ set_gdbarch_read_sp (struct gdbarch *gdbarch,
 void
 gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->write_sp == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_write_sp invalid");
@@ -2423,6 +2474,7 @@ set_gdbarch_write_sp (struct gdbarch *gdbarch,
 void
 gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->virtual_frame_pointer == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_virtual_frame_pointer invalid");
@@ -2441,12 +2493,14 @@ set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
 int
 gdbarch_register_read_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->register_read != 0;
 }
 
 void
 gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_read == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_read invalid");
@@ -2465,12 +2519,14 @@ set_gdbarch_register_read (struct gdbarch *gdbarch,
 int
 gdbarch_register_write_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->register_write != 0;
 }
 
 void
 gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_write == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_write invalid");
@@ -2489,6 +2545,7 @@ set_gdbarch_register_write (struct gdbarch *gdbarch,
 int
 gdbarch_num_regs (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->num_regs == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_num_regs invalid");
@@ -2507,6 +2564,7 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch,
 int
 gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
@@ -2523,9 +2581,8 @@ set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
 int
 gdbarch_sp_regnum (struct gdbarch *gdbarch)
 {
-  if (gdbarch->sp_regnum == -1)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_sp_regnum invalid");
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of sp_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
   return gdbarch->sp_regnum;
@@ -2541,9 +2598,8 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_fp_regnum (struct gdbarch *gdbarch)
 {
-  if (gdbarch->fp_regnum == -1)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_fp_regnum invalid");
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of fp_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
   return gdbarch->fp_regnum;
@@ -2559,9 +2615,8 @@ set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_pc_regnum (struct gdbarch *gdbarch)
 {
-  if (gdbarch->pc_regnum == -1)
-    internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_pc_regnum invalid");
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of pc_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
   return gdbarch->pc_regnum;
@@ -2574,9 +2629,27 @@ set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
   gdbarch->pc_regnum = pc_regnum;
 }
 
+int
+gdbarch_ps_regnum (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of ps_regnum, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
+  return gdbarch->ps_regnum;
+}
+
+void
+set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
+                       int ps_regnum)
+{
+  gdbarch->ps_regnum = ps_regnum;
+}
+
 int
 gdbarch_fp0_regnum (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of fp0_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
@@ -2593,6 +2666,7 @@ set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_npc_regnum (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of npc_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
@@ -2609,6 +2683,7 @@ set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of nnpc_regnum, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
@@ -2625,6 +2700,7 @@ set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->stab_reg_to_regnum == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_stab_reg_to_regnum invalid");
@@ -2643,6 +2719,7 @@ set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->ecoff_reg_to_regnum == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
@@ -2661,6 +2738,7 @@ set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->dwarf_reg_to_regnum == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
@@ -2679,6 +2757,7 @@ set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->sdb_reg_to_regnum == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_sdb_reg_to_regnum invalid");
@@ -2697,6 +2776,7 @@ set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
 int
 gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->dwarf2_reg_to_regnum == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
@@ -2715,6 +2795,7 @@ set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
 char *
 gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_name == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_name invalid");
@@ -2733,6 +2814,7 @@ set_gdbarch_register_name (struct gdbarch *gdbarch,
 int
 gdbarch_register_size (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_size == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_size invalid");
@@ -2751,6 +2833,7 @@ set_gdbarch_register_size (struct gdbarch *gdbarch,
 int
 gdbarch_register_bytes (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_bytes == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_bytes invalid");
@@ -2769,6 +2852,7 @@ set_gdbarch_register_bytes (struct gdbarch *gdbarch,
 int
 gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_byte == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_byte invalid");
@@ -2787,6 +2871,7 @@ set_gdbarch_register_byte (struct gdbarch *gdbarch,
 int
 gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_raw_size == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_raw_size invalid");
@@ -2805,6 +2890,7 @@ set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
 int
 gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->max_register_raw_size == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_max_register_raw_size invalid");
@@ -2823,6 +2909,7 @@ set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
 int
 gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_virtual_size == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_virtual_size invalid");
@@ -2841,6 +2928,7 @@ set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
 int
 gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->max_register_virtual_size == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_max_register_virtual_size invalid");
@@ -2859,6 +2947,7 @@ set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
 struct type *
 gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_virtual_type == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_virtual_type invalid");
@@ -2877,6 +2966,7 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
 void
 gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->do_registers_info == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_do_registers_info invalid");
@@ -2892,9 +2982,29 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
   gdbarch->do_registers_info = do_registers_info;
 }
 
+void
+gdbarch_print_float_info (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->print_float_info == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_print_float_info invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_print_float_info called\n");
+  gdbarch->print_float_info ();
+}
+
+void
+set_gdbarch_print_float_info (struct gdbarch *gdbarch,
+                              gdbarch_print_float_info_ftype print_float_info)
+{
+  gdbarch->print_float_info = print_float_info;
+}
+
 int
 gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_sim_regno == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_sim_regno invalid");
@@ -2913,12 +3023,14 @@ set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
 int
 gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->register_bytes_ok != 0;
 }
 
 int
 gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_bytes_ok == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_bytes_ok invalid");
@@ -2937,6 +3049,7 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
 int
 gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->cannot_fetch_register == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_cannot_fetch_register invalid");
@@ -2955,6 +3068,7 @@ set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
 int
 gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->cannot_store_register == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_cannot_store_register invalid");
@@ -2970,9 +3084,36 @@ set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
   gdbarch->cannot_store_register = cannot_store_register;
 }
 
+int
+gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->get_longjmp_target != 0;
+}
+
+int
+gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->get_longjmp_target == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_get_longjmp_target invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_longjmp_target called\n");
+  return gdbarch->get_longjmp_target (pc);
+}
+
+void
+set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
+                                gdbarch_get_longjmp_target_ftype get_longjmp_target)
+{
+  gdbarch->get_longjmp_target = get_longjmp_target;
+}
+
 int
 gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->use_generic_dummy_frames == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_use_generic_dummy_frames invalid");
@@ -2991,6 +3132,7 @@ set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_location (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_location == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_location invalid");
@@ -3009,6 +3151,7 @@ set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_call_dummy_address (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_address invalid");
@@ -3027,6 +3170,7 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_start_offset == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_start_offset invalid");
@@ -3045,6 +3189,7 @@ set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
@@ -3063,6 +3208,7 @@ set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_breakpoint_offset_p == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
@@ -3081,6 +3227,7 @@ set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_length (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_length == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_length invalid");
@@ -3099,6 +3246,7 @@ set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
 int
 gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->pc_in_call_dummy == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_pc_in_call_dummy invalid");
@@ -3117,6 +3265,7 @@ set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_p == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_p invalid");
@@ -3135,6 +3284,7 @@ set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
 LONGEST *
 gdbarch_call_dummy_words (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of call_dummy_words, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
@@ -3151,6 +3301,7 @@ set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
 int
 gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
@@ -3167,6 +3318,7 @@ set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_stack_adjust_p == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
@@ -3185,6 +3337,7 @@ set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
 int
 gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_call_dummy_stack_adjust invalid");
@@ -3203,6 +3356,7 @@ set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
 void
 gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->fix_call_dummy == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_fix_call_dummy invalid");
@@ -3221,6 +3375,7 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
 void
 gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->init_frame_pc_first == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_init_frame_pc_first invalid");
@@ -3239,6 +3394,7 @@ set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
 void
 gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->init_frame_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_init_frame_pc invalid");
@@ -3257,6 +3413,7 @@ set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
 int
 gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
   return gdbarch->believe_pcc_promotion;
@@ -3272,6 +3429,7 @@ set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
 int
 gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
   return gdbarch->believe_pcc_promotion_type;
@@ -3287,6 +3445,7 @@ set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
 int
 gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->coerce_float_to_double == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_coerce_float_to_double invalid");
@@ -3305,6 +3464,7 @@ set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
 void
 gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->get_saved_register == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_get_saved_register invalid");
@@ -3323,6 +3483,7 @@ set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
 int
 gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_convertible == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_convertible invalid");
@@ -3341,6 +3502,7 @@ set_gdbarch_register_convertible (struct gdbarch *gdbarch,
 void
 gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_convert_to_virtual == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_convert_to_virtual invalid");
@@ -3359,6 +3521,7 @@ set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
 void
 gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->register_convert_to_raw == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_register_convert_to_raw invalid");
@@ -3377,12 +3540,14 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
 int
 gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->fetch_pseudo_register != 0;
 }
 
 void
 gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->fetch_pseudo_register == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_fetch_pseudo_register invalid");
@@ -3401,12 +3566,14 @@ set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
 int
 gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->store_pseudo_register != 0;
 }
 
 void
 gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->store_pseudo_register == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_store_pseudo_register invalid");
@@ -3425,6 +3592,7 @@ set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->pointer_to_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_pointer_to_address invalid");
@@ -3443,6 +3611,7 @@ set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
 void
 gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->address_to_pointer == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_address_to_pointer invalid");
@@ -3461,12 +3630,14 @@ set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
 int
 gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->integer_to_address != 0;
 }
 
 CORE_ADDR
 gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->integer_to_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_integer_to_address invalid");
@@ -3485,6 +3656,7 @@ set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
 int
 gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->return_value_on_stack == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_return_value_on_stack invalid");
@@ -3503,6 +3675,7 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
 void
 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->extract_return_value == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_extract_return_value invalid");
@@ -3521,6 +3694,7 @@ set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->push_arguments == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_push_arguments invalid");
@@ -3539,6 +3713,7 @@ set_gdbarch_push_arguments (struct gdbarch *gdbarch,
 void
 gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->push_dummy_frame == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_push_dummy_frame invalid");
@@ -3557,12 +3732,14 @@ set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
 int
 gdbarch_push_return_address_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->push_return_address != 0;
 }
 
 CORE_ADDR
 gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->push_return_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_push_return_address invalid");
@@ -3581,6 +3758,7 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
 void
 gdbarch_pop_frame (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->pop_frame == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_pop_frame invalid");
@@ -3599,6 +3777,7 @@ set_gdbarch_pop_frame (struct gdbarch *gdbarch,
 void
 gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->store_struct_return == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_store_struct_return invalid");
@@ -3617,6 +3796,7 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
 void
 gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->store_return_value == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_store_return_value invalid");
@@ -3635,12 +3815,14 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
 int
 gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->extract_struct_value_address != 0;
 }
 
 CORE_ADDR
 gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->extract_struct_value_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_extract_struct_value_address invalid");
@@ -3659,6 +3841,7 @@ set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
 int
 gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->use_struct_convention == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_use_struct_convention invalid");
@@ -3677,6 +3860,7 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
 void
 gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_init_saved_regs == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_init_saved_regs invalid");
@@ -3695,12 +3879,14 @@ set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
 int
 gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->init_extra_frame_info != 0;
 }
 
 void
 gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->init_extra_frame_info == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_init_extra_frame_info invalid");
@@ -3719,6 +3905,7 @@ set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->skip_prologue == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_skip_prologue invalid");
@@ -3737,6 +3924,7 @@ set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
 int
 gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->prologue_frameless_p == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_prologue_frameless_p invalid");
@@ -3755,6 +3943,7 @@ set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
 int
 gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->inner_than == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_inner_than invalid");
@@ -3770,9 +3959,10 @@ set_gdbarch_inner_than (struct gdbarch *gdbarch,
   gdbarch->inner_than = inner_than;
 }
 
-unsigned char *
+const unsigned char *
 gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->breakpoint_from_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_breakpoint_from_pc invalid");
@@ -3791,6 +3981,7 @@ set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
 int
 gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->memory_insert_breakpoint == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_memory_insert_breakpoint invalid");
@@ -3809,6 +4000,7 @@ set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
 int
 gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->memory_remove_breakpoint == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_memory_remove_breakpoint invalid");
@@ -3827,6 +4019,7 @@ set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->decr_pc_after_break == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_decr_pc_after_break invalid");
@@ -3845,6 +4038,7 @@ set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
 int
 gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->prepare_to_proceed == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_prepare_to_proceed invalid");
@@ -3863,6 +4057,7 @@ set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_function_start_offset (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->function_start_offset == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_function_start_offset invalid");
@@ -3881,6 +4076,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
 void
 gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->remote_translate_xfer_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_remote_translate_xfer_address invalid");
@@ -3899,6 +4095,7 @@ set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_frame_args_skip (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_args_skip == -1)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_args_skip invalid");
@@ -3917,6 +4114,7 @@ set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
 int
 gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frameless_function_invocation == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frameless_function_invocation invalid");
@@ -3935,6 +4133,7 @@ set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_chain == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_chain invalid");
@@ -3953,6 +4152,7 @@ set_gdbarch_frame_chain (struct gdbarch *gdbarch,
 int
 gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_chain_valid == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_chain_valid invalid");
@@ -3971,6 +4171,7 @@ set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_saved_pc == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_saved_pc invalid");
@@ -3989,6 +4190,7 @@ set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_args_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_args_address invalid");
@@ -4007,6 +4209,7 @@ set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_locals_address == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_locals_address invalid");
@@ -4025,6 +4228,7 @@ set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->saved_pc_after_call == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_saved_pc_after_call invalid");
@@ -4043,6 +4247,7 @@ set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
 int
 gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->frame_num_args == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_frame_num_args invalid");
@@ -4061,12 +4266,14 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
 int
 gdbarch_stack_align_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->stack_align != 0;
 }
 
 CORE_ADDR
 gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->stack_align == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_stack_align invalid");
@@ -4085,6 +4292,7 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch,
 int
 gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
@@ -4101,12 +4309,14 @@ set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
 int
 gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->reg_struct_has_addr != 0;
 }
 
 int
 gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->reg_struct_has_addr == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_reg_struct_has_addr invalid");
@@ -4125,12 +4335,14 @@ set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
 int
 gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->save_dummy_frame_tos != 0;
 }
 
 void
 gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->save_dummy_frame_tos == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_save_dummy_frame_tos invalid");
@@ -4149,6 +4361,7 @@ set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
 int
 gdbarch_parm_boundary (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
   return gdbarch->parm_boundary;
@@ -4164,6 +4377,7 @@ set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
 const struct floatformat *
 gdbarch_float_format (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
   return gdbarch->float_format;
@@ -4179,6 +4393,7 @@ set_gdbarch_float_format (struct gdbarch *gdbarch,
 const struct floatformat *
 gdbarch_double_format (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
   return gdbarch->double_format;
@@ -4194,6 +4409,7 @@ set_gdbarch_double_format (struct gdbarch *gdbarch,
 const struct floatformat *
 gdbarch_long_double_format (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
   return gdbarch->long_double_format;
@@ -4209,6 +4425,7 @@ set_gdbarch_long_double_format (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->convert_from_func_ptr_addr == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
@@ -4227,6 +4444,7 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->addr_bits_remove == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_addr_bits_remove invalid");
@@ -4242,15 +4460,36 @@ set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
   gdbarch->addr_bits_remove = addr_bits_remove;
 }
 
+CORE_ADDR
+gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->smash_text_address == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_smash_text_address invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
+  return gdbarch->smash_text_address (addr);
+}
+
+void
+set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
+                                gdbarch_smash_text_address_ftype smash_text_address)
+{
+  gdbarch->smash_text_address = smash_text_address;
+}
+
 int
 gdbarch_software_single_step_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->software_single_step != 0;
 }
 
 void
 gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->software_single_step == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_software_single_step invalid");
@@ -4269,6 +4508,7 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
 int
 gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->print_insn == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_print_insn invalid");
@@ -4287,6 +4527,7 @@ set_gdbarch_print_insn (struct gdbarch *gdbarch,
 CORE_ADDR
 gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->skip_trampoline_code == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_skip_trampoline_code invalid");
@@ -4305,6 +4546,7 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
 int
 gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->in_solib_call_trampoline == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_in_solib_call_trampoline invalid");
@@ -4320,9 +4562,29 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
   gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
 }
 
+int
+gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->pc_in_sigtramp == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_pc_in_sigtramp invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n");
+  return gdbarch->pc_in_sigtramp (pc, name);
+}
+
+void
+set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
+                            gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp)
+{
+  gdbarch->pc_in_sigtramp = pc_in_sigtramp;
+}
+
 int
 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->in_function_epilogue_p == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_in_function_epilogue_p invalid");
@@ -4341,6 +4603,7 @@ set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
 char *
 gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->construct_inferior_arguments == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_construct_inferior_arguments invalid");
@@ -4359,12 +4622,14 @@ set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
 int
 gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
 {
+  gdb_assert (gdbarch != NULL);
   return gdbarch->dwarf2_build_frame_info != 0;
 }
 
 void
 gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
 {
+  gdb_assert (gdbarch != NULL);
   if (gdbarch->dwarf2_build_frame_info == 0)
     internal_error (__FILE__, __LINE__,
                     "gdbarch: gdbarch_dwarf2_build_frame_info invalid");
@@ -4380,6 +4645,44 @@ set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
   gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
 }
 
+void
+gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->elf_make_msymbol_special == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_elf_make_msymbol_special invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
+  gdbarch->elf_make_msymbol_special (sym, msym);
+}
+
+void
+set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
+                                      gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
+{
+  gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
+}
+
+void
+gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->coff_make_msymbol_special == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_coff_make_msymbol_special invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
+  gdbarch->coff_make_msymbol_special (val, msym);
+}
+
+void
+set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
+                                       gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
+{
+  gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
@@ -4730,7 +5033,6 @@ int
 gdbarch_update_p (struct gdbarch_info info)
 {
   struct gdbarch *new_gdbarch;
-  struct gdbarch_list **list;
   struct gdbarch_registration *rego;
 
   /* Fill in missing parts of the INFO struct using a number of
@@ -4749,17 +5051,17 @@ gdbarch_update_p (struct gdbarch_info info)
     info.bfd_arch_info = TARGET_ARCHITECTURE;
 
   /* ``(gdb) set byte-order ...'' */
-  if (info.byte_order == 0
+  if (info.byte_order == BFD_ENDIAN_UNKNOWN
       && !TARGET_BYTE_ORDER_AUTO)
     info.byte_order = TARGET_BYTE_ORDER;
   /* From the INFO struct. */
-  if (info.byte_order == 0
+  if (info.byte_order == BFD_ENDIAN_UNKNOWN
       && info.abfd != NULL)
-    info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN
+    info.byte_order = (bfd_big_endian (info.abfd) ? BFD_ENDIAN_BIG
                       : bfd_little_endian (info.abfd) ? BFD_ENDIAN_LITTLE
-                      : 0);
+                      : BFD_ENDIAN_UNKNOWN);
   /* From the current target. */
-  if (info.byte_order == 0)
+  if (info.byte_order == BFD_ENDIAN_UNKNOWN)
     info.byte_order = TARGET_BYTE_ORDER;
 
   /* Must have found some sort of architecture. */
@@ -4775,7 +5077,7 @@ gdbarch_update_p (struct gdbarch_info info)
       fprintf_unfiltered (gdb_stdlog,
                          "gdbarch_update: info.byte_order %d (%s)\n",
                          info.byte_order,
-                         (info.byte_order == BIG_ENDIAN ? "big"
+                         (info.byte_order == BFD_ENDIAN_BIG ? "big"
                           : info.byte_order == BFD_ENDIAN_LITTLE ? "little"
                           : "default"));
       fprintf_unfiltered (gdb_stdlog,
@@ -4823,29 +5125,46 @@ gdbarch_update_p (struct gdbarch_info info)
   /* Swap all data belonging to the old target out */
   swapout_gdbarch_swap (current_gdbarch);
 
-  /* Is this a pre-existing architecture?  Yes. Swap it in.  */
-  for (list = &rego->arches;
-       (*list) != NULL;
-       list = &(*list)->next)
-    {
-      if ((*list)->gdbarch == new_gdbarch)
-       {
-         if (gdbarch_debug)
-           fprintf_unfiltered (gdb_stdlog,
-                                "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
-                               (long) new_gdbarch,
-                               new_gdbarch->bfd_arch_info->printable_name);
-         current_gdbarch = new_gdbarch;
-         swapin_gdbarch_swap (new_gdbarch);
-         architecture_changed_event ();
-         return 1;
-       }
-    }
-
-  /* Append this new architecture to this targets list. */
-  (*list) = XMALLOC (struct gdbarch_list);
-  (*list)->next = NULL;
-  (*list)->gdbarch = new_gdbarch;
+  /* Is this a pre-existing architecture?  Yes. Move it to the front
+     of the list of architectures (keeping the list sorted Most
+     Recently Used) and then copy it in.  */
+  {
+    struct gdbarch_list **list;
+    for (list = &rego->arches;
+        (*list) != NULL;
+        list = &(*list)->next)
+      {
+       if ((*list)->gdbarch == new_gdbarch)
+         {
+           struct gdbarch_list *this;
+           if (gdbarch_debug)
+             fprintf_unfiltered (gdb_stdlog,
+                                 "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n",
+                                 (long) new_gdbarch,
+                                 new_gdbarch->bfd_arch_info->printable_name);
+           /* Unlink this.  */
+           this = (*list);
+           (*list) = this->next;
+           /* Insert in the front.  */
+           this->next = rego->arches;
+           rego->arches = this;
+           /* Copy the new architecture in.  */
+           current_gdbarch = new_gdbarch;
+           swapin_gdbarch_swap (new_gdbarch);
+           architecture_changed_event ();
+           return 1;
+         }
+      }
+  }
+
+  /* Prepend this new architecture to the architecture list (keep the
+     list sorted Most Recently Used).  */
+  {
+    struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
+    this->next = rego->arches;
+    this->gdbarch = new_gdbarch;
+    rego->arches = this;
+  }    
 
   /* Switch to this new architecture.  Dump it out. */
   current_gdbarch = new_gdbarch;
This page took 0.04989 seconds and 4 git commands to generate.