This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] s/get_regcache_arch (regcache)/regcache->arch ()/g


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ac7936dfd0c85e5de2dfec45ca0dbf72baeffa51

commit ac7936dfd0c85e5de2dfec45ca0dbf72baeffa51
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Oct 25 16:37:03 2017 +0100

    s/get_regcache_arch (regcache)/regcache->arch ()/g
    
    This patches removes get_regcache_arch, and use regache->arch () instead.
    The motivation of this change is that I am going to move some basic stuff
    into a base class of regcache.  I don't need to update "client" code
    regcache->arch ().  On the other hand, this patch shortens the code a
    little bit.
    
    gdb:
    
    2017-10-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use
    	regcache->arch () instead get_regcache_arch.
    	* aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers):
    	Likewise.
    	(aarch64_fbsd_store_inferior_registers): Likewise.
    	* aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise.
    	(store_gregs_to_thread): Likewise.
    	(fetch_fpregs_from_thread): Likewise.
    	(store_fpregs_to_thread): Likewise.
    	* aarch64-tdep.c (aarch64_extract_return_value): Likewise.
    	(aarch64_store_return_value): Likewise.
    	(aarch64_software_single_step): Likewise.
    	* aix-thread.c (aix_thread_wait): Likewise.
    	(supply_reg32): Likewise.
    	(supply_sprs64): Likewise.
    	(supply_sprs32): Likewise.
    	(fill_gprs64): Likewise.
    	(fill_gprs32): Likewise.
    	(fill_sprs64): Likewise.
    	(fill_sprs32): Likewise.
    	(store_regs_user_thread): Likewise.
    	(store_regs_kernel_thread): Likewise.
    	* alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise.
    	(alphabsd_store_inferior_registers): Likewise.
    	* alpha-tdep.c (alpha_extract_return_value): Likewise.
    	(alpha_store_return_value): Likewise.
    	(alpha_deal_with_atomic_sequence): Likewise.
    	(alpha_next_pc): Likewise.
    	(alpha_software_single_step): Likewise.
    	* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise.
    	(amd64bsd_store_inferior_registers): Likewise.
    	* amd64-linux-nat.c (amd64_linux_fetch_inferior_registers):
    	Likewise.
    	(amd64_linux_store_inferior_registers): Likewise.
    	* amd64-nat.c (amd64_supply_native_gregset): Likewise.
    	(amd64_collect_native_gregset): Likewise.
    	* amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise.
    	(amd64obsd_collect_uthread): Likewise.
    	* amd64-tdep.c (amd64_supply_fpregset): Likewise.
    	(amd64_collect_fpregset): Likewise.
    	(amd64_supply_fxsave): Likewise.
    	(amd64_supply_xsave): Likewise.
    	(amd64_collect_fxsave): Likewise.
    	(amd64_collect_xsave): Likewise.
    	* arc-tdep.c (arc_write_pc): Likewise.
    	* arch-utils.c (default_skip_permanent_breakpoint): Likewise.
    	* arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise.
    	(arm_fbsd_store_inferior_registers): Likewise.
    	* arm-linux-nat.c (fetch_vfp_regs): Likewise.
    	(store_vfp_regs): Likewise.
    	(arm_linux_fetch_inferior_registers): Likewise.
    	(arm_linux_store_inferior_registers): Likewise.
    	* arm-linux-tdep.c (arm_linux_supply_gregset): Likewise.
    	(arm_linux_sigreturn_next_pc): Likewise.
    	(arm_linux_get_next_pcs_syscall_next_pc): Likewise.
    	* arm-nbsd-nat.c (arm_supply_gregset): Likewise.
    	(fetch_register): Likewise.
    	(store_register): Likewise.
    	* arm-tdep.c (arm_is_thumb): Likewise.
    	(displaced_in_arm_mode): Likewise.
    	(bx_write_pc): Likewise.
    	(arm_get_next_pcs_addr_bits_remove): Likewise.
    	(arm_software_single_step): Likewise.
    	(arm_extract_return_value): Likewise.
    	(arm_store_return_value): Likewise.
    	(arm_write_pc): Likewise.
    	* bfin-tdep.c (bfin_extract_return_value): Likewise.
    	* bsd-uthread.c (bsd_uthread_fetch_registers): Likewise.
    	(bsd_uthread_store_registers): Likewise.
    	* core-regset.c (fetch_core_registers): Likewise.
    	* corelow.c (get_core_registers): Likewise.
    	* cris-tdep.c (cris_store_return_value): Likewise.
    	(cris_extract_return_value): Likewise.
    	(find_step_target): Likewise.
    	(find_step_target): Likewise.
    	(cris_software_single_step): Likewise.
    	* ctf.c (ctf_fetch_registers): Likewise.
    	* darwin-nat.c (cancel_breakpoint): Likewise.
    	* fbsd-tdep.c (fbsd_collect_thread_registers): Likewise.
    	* frv-tdep.c (frv_extract_return_value): Likewise.
    	* ft32-tdep.c (ft32_store_return_value): Likewise.
    	(ft32_extract_return_value): Likewise.
    	* go32-nat.c (fetch_register): Likewise.
    	(go32_fetch_registers): Likewise.
    	(go32_store_registers): Likewise.
    	(store_register): Likewise.
    	* h8300-tdep.c (h8300_extract_return_value): Likewise.
    	(h8300_store_return_value): Likewise.
    	* hppa-linux-nat.c (fetch_register): Likewise.
    	(store_register): Likewise.
    	(hppa_linux_fetch_inferior_registers): Likewise.
    	(hppa_linux_store_inferior_registers): Likewise.
    	* i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise.
    	(i386_darwin_store_inferior_registers): Likewise.
    	* i386-gnu-nat.c (gnu_fetch_registers): Likewise.
    	(gnu_store_registers): Likewise.
    	* i386-linux-nat.c (fetch_register): Likewise.
    	(store_register): Likewise.
    	(supply_gregset): Likewise.
    	(fill_gregset): Likewise.
    	(i386_linux_fetch_inferior_registers): Likewise.
    	(i386_linux_store_inferior_registers): Likewise.
    	(i386_linux_resume): Likewise.
    	* i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache):
    	Likewise.
    	* i386-nto-tdep.c (i386nto_supply_gregset): Likewise.
    	* i386-obsd-nat.c (i386obsd_supply_pcb): Likewise.
    	* i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise.
    	(i386obsd_collect_uthread): Likewise.
    	* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
    	(i386_supply_gregset): Likewise.
    	(i386_collect_gregset): Likewise.
    	(i386_supply_fpregset): Likewise.
    	(i386_collect_fpregset): Likewise.
    	(i386_mpx_bd_base): Likewise.
    	* i386-v4-nat.c	(supply_fpregset): Likewise.
    	(fill_fpregset): Likewise.
    	* i387-tdep.c (i387_supply_fsave): Likewise.
    	(i387_collect_fsave): Likewise.
    	(i387_supply_fxsave): Likewise.
    	(i387_collect_fxsave): Likewise.
    	(i387_supply_xsave): Likewise.
    	(i387_collect_xsave): Likewise.
    	* ia64-linux-nat.c (ia64_linux_fetch_registers): Likewise.
    	(ia64_linux_store_registers): Likewise.
    	* ia64-tdep.c (ia64_access_rse_reg): Likewise.
    	(ia64_extract_return_value): Likewise.
    	(ia64_store_return_value): Likewise.
    	(find_func_descr): Likewise.
    	* inf-child.c (inf_child_fetch_inferior_registers): Likewise.
    	* inf-ptrace.c (inf_ptrace_fetch_registers): Likewise.
    	(inf_ptrace_store_registers): Likewise.
    	* infrun.c (use_displaced_stepping): Likewise.
    	(displaced_step_prepare_throw): Likewise.
    	(resume): Likewise.
    	(proceed): Likewise.
    	(do_target_wait): Likewise.
    	(adjust_pc_after_break): Likewise.
    	(handle_inferior_event_1): Likewise.
    	(handle_signal_stop): Likewise.
    	(save_infcall_suspend_state): Likewise.
    	(restore_infcall_suspend_state): Likewise.
    	* iq2000-tdep.c (iq2000_extract_return_value): Likewise.
    	* jit.c (jit_frame_prev_register): Likewise.
    	* linux-nat.c (save_stop_reason): Likewise.
    	(linux_nat_wait_1): Likewise.
    	(resume_stopped_resumed_lwps): Likewise.
    	* linux-record.c (record_linux_sockaddr): Likewise.
    	(record_linux_msghdr): Likewise.
    	(record_linux_system_call): Likewise.
    	* linux-tdep.c (linux_collect_thread_registers): Likewise.
    	* lm32-tdep.c (lm32_extract_return_value): Likewise.
    	(lm32_store_return_value): Likewise.
    	* m32c-tdep.c (m32c_read_flg): Likewise.
    	(m32c_pseudo_register_read): Likewise.
    	(m32c_pseudo_register_write): Likewise.
    	* m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise.
    	(m32r_linux_collect_gregset): Likewise.
    	* m32r-tdep.c (m32r_store_return_value): Likewise.
    	(m32r_extract_return_value): Likewise.
    	* m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise.
    	(m68kbsd_collect_fpregset): Likewise.
    	* m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise.
    	* m68k-linux-nat.c (fetch_register): Likewise.
    	(old_fetch_inferior_registers): Likewise.
    	(old_store_inferior_registers): Likewise.
    	(store_regs): Likewise.
    	* m68k-tdep.c (m68k_svr4_extract_return_value): Likewise.
    	(m68k_svr4_store_return_value): Likewise.
    	* m88k-tdep.c (m88k_store_arguments): Likewise.
    	* mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise.
    	(mi_cmd_data_write_register_values): Likewise.
    	* mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise.
    	(mips_fbsd_store_inferior_registers): Likewise.
    	* mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise.
    	(mips_fbsd_supply_gregs): Likewise.
    	(mips_fbsd_collect_fpregs): Likewise.
    	(mips_fbsd_collect_gregs): Likewise.
    	(mips_fbsd_supply_fpregset): Likewise.
    	(mips_fbsd_collect_fpregset): Likewise.
    	(mips_fbsd_supply_gregset): Likewise.
    	(mips_fbsd_collect_gregset): Likewise.
    	* mips-linux-nat.c (supply_gregset): Likewise.
    	(fill_gregset): Likewise.
    	(supply_fpregset): Likewise.
    	(fill_fpregset): Likewise.
    	* mips-linux-tdep.c (mips_supply_gregset): Likewise.
    	(mips_fill_gregset): Likewise.
    	(mips_supply_fpregset): Likewise.
    	(mips_fill_fpregset): Likewise.
    	(mips64_supply_gregset): Likewise.
    	(micromips_linux_sigframe_validate): Likewise.
    	* mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise.
    	(mipsnbsd_fetch_inferior_registers): Likewise.
    	(mipsnbsd_store_inferior_registers): Likewise.
    	* mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise.
    	(mipsnbsd_supply_gregset): Likewise.
    	(mipsnbsd_iterate_over_regset_sections): Likewise.
    	(mipsnbsd_supply_reg): Likewise.
    	(mipsnbsd_supply_fpreg): Likewise.
    	* mips-tdep.c (mips_in_frame_stub): Likewise.
    	(mips_dummy_id): Likewise.
    	(is_octeon_bbit_op): Likewise.
    	(micromips_bc1_pc): Likewise.
    	(extended_mips16_next_pc): Likewise.
    	(mips16_next_pc): Likewise.
    	(deal_with_atomic_sequence): Likewise.
    	* moxie-tdep.c (moxie_process_readu): Likewise.
    	* nios2-tdep.c (nios2_get_next_pc): Likewise.
    	* nto-procfs.c (procfs_store_registers): Likewise.
    	* ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise.
    	(ppcfbsd_store_inferior_registers): Likewise.
    	* ppc-linux-nat.c (fetch_vsx_register): Likewise.
    	(fetch_altivec_register): Likewise.
    	(get_spe_registers): Likewise.
    	(fetch_spe_register): Likewise.
    	(fetch_altivec_registers): Likewise.
    	(fetch_all_gp_regs): Likewise.
    	(fetch_all_fp_regs): Likewise.
    	(store_vsx_register): Likewise.
    	(store_altivec_register): Likewise.
    	(set_spe_registers): Likewise.
    	(store_spe_register): Likewise.
    	(store_altivec_registers): Likewise.
    	(store_all_gp_regs): Likewise.
    	(store_all_fp_regs): Likewise.
    	* ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise.
    	(ppc_linux_collect_gregset): Likewise.
    	(ppc_canonicalize_syscall): Likewise.
    	(ppc_linux_record_signal): Likewise.
    	(ppu2spu_prev_register): Likewise.
    	* ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
    	* ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise.
    	(ppcobsd_store_registers): Likewise.
    	* ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers):
    	Likewise.
    	(ppc_ravenscar_generic_store_registers): Likewise.
    	* procfs.c (procfs_fetch_registers): Likewise.
    	(procfs_store_registers): Likewise.
    	* ravenscar-thread.c (ravenscar_fetch_registers): Likewise.
    	(ravenscar_store_registers): Likewise.
    	(ravenscar_prepare_to_store): Likewise.
    	* record-btrace.c (record_btrace_fetch_registers): Likewise.
    	* record-full.c (record_full_wait_1): Likewise.
    	(record_full_registers_change): Likewise.
    	(record_full_store_registers): Likewise.
    	(record_full_core_fetch_registers): Likewise.
    	(record_full_save): Likewise.
    	(record_full_goto_insn): Likewise.
    	* regcache.c (regcache_register_size): Likewise.
    	(get_regcache_arch): Remove.
    	(regcache_read_pc): Likewise.
    	* regcache.h (get_regcache_arch): Remove.
    	* remote-sim.c (gdbsim_fetch_register): Likewise.
    	(gdbsim_store_register): Likewise.
    	* remote.c (fetch_register_using_p): Likewise.
    	(send_g_packet): Likewise.
    	(remote_prepare_to_store): Likewise.
    	(store_registers_using_G): Likewise.
    	* reverse.c (save_bookmark_command): Likewise.
    	(goto_bookmark_command): Likewise.
    	* rs6000-aix-tdep.c (branch_dest): Likewise.
    	* rs6000-nat.c (rs6000_ptrace64): Likewise.
    	(fetch_register): Likewise.
    	* rs6000-tdep.c (ppc_supply_reg): Likewise.
    	(ppc_collect_reg): Likewise.
    	(ppc_collect_gregset): Likewise.
    	(ppc_collect_fpregset): Likewise.
    	(ppc_collect_vsxregset): Likewise.
    	(ppc_collect_vrregset): Likewise.
    	(ppc_displaced_step_hw_singlestep): Likewise.
    	(rs6000_pseudo_register_read): Likewise.
    	(rs6000_pseudo_register_write): Likewise.
    	* s390-linux-nat.c (supply_gregset): Likewise.
    	(fill_gregset): Likewise.
    	(s390_linux_fetch_inferior_registers): Likewise.
    	* s390-linux-tdep.c (s390_write_pc): Likewise.
    	(s390_software_single_step): Likewise.
    	(s390_all_but_pc_registers_record): Likewise.
    	(s390_linux_syscall_record): Likewise.
    	* sentinel-frame.c (sentinel_frame_prev_arch): Likewise.
    	* sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise.
    	(shnbsd_store_inferior_registers): Likewise.
    	* sh-tdep.c (sh_extract_return_value_nofpu): Likewise.
    	(sh_extract_return_value_fpu): Likewise.
    	(sh_store_return_value_nofpu): Likewise.
    	(sh_corefile_supply_regset): Likewise.
    	(sh_corefile_collect_regset): Likewise.
    	* sh64-tdep.c (sh64_extract_return_value): Likewise.
    	(sh64_store_return_value): Likewise.
    	* sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise.
    	* sparc-nat.c (sparc_fetch_inferior_registers): Likewise.
    	(sparc_store_inferior_registers): Likewise.
    	* sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise.
    	(sparc_ravenscar_prepare_to_store): Likewise.
    	* sparc-tdep.c (sparc32_store_arguments): Likewise.
    	(sparc_analyze_control_transfer): Likewise.
    	(sparc_step_trap): Likewise.
    	(sparc_software_single_step): Likewise.
    	(sparc32_gdbarch_init): Likewise.
    	(sparc_supply_rwindow): Likewise.
    	(sparc_collect_rwindow): Likewise.
    	* sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise.
    	* sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise.
    	(sparc64nbsd_collect_gregset): Likewise.
    	(sparc64nbsd_supply_fpregset): Likewise.
    	(sparc64nbsd_collect_fpregset): Likewise.
    	* sparc64-tdep.c (sparc64_store_arguments): Likewise.
    	(sparc64_supply_gregset): Likewise.
    	(sparc64_collect_gregset): Likewise.
    	(sparc64_supply_fpregset): Likewise.
    	(sparc64_collect_fpregset): Likewise.
    	* spu-linux-nat.c (spu_fetch_inferior_registers): Likewise.
    	* spu-tdep.c (spu_unwind_sp): Likewise.
    	(spu2ppu_prev_register): Likewise.
    	(spu_memory_remove_breakpoint): Likewise.
    	* stack.c (return_command): Likewise.
    	* tic6x-tdep.c (tic6x_extract_signed_field): Likewise.
    	* tracefile-tfile.c (tfile_fetch_registers): Likewise.
    	* tracefile.c (trace_save_ctf): Likewise.
    	* windows-nat.c (do_windows_fetch_inferior_registers): Likewise.
    	(do_windows_store_inferior_registers): Likewise.
    	(windows_resume): Likewise.
    	* xtensa-linux-nat.c (fill_gregset): Likewise.
    	(supply_gregset_reg): Likewise.
    	* xtensa-tdep.c (xtensa_register_write_masked): Likewise.
    	(xtensa_register_read_masked): Likewise.
    	(xtensa_supply_gregset): Likewise.
    	(xtensa_extract_return_value): Likewise.
    	(xtensa_store_return_value): Likewise.

Diff:
---
 gdb/ChangeLog                | 333 +++++++++++++++++++++++++++++++++++++++++++
 gdb/aarch32-linux-nat.c      |   2 +-
 gdb/aarch64-fbsd-nat.c       |   4 +-
 gdb/aarch64-linux-nat.c      |   8 +-
 gdb/aarch64-tdep.c           |   6 +-
 gdb/aix-thread.c             |  28 ++--
 gdb/alpha-bsd-nat.c          |   4 +-
 gdb/alpha-tdep.c             |  10 +-
 gdb/amd64-bsd-nat.c          |   4 +-
 gdb/amd64-linux-nat.c        |   4 +-
 gdb/amd64-nat.c              |   4 +-
 gdb/amd64-obsd-tdep.c        |   4 +-
 gdb/amd64-tdep.c             |  12 +-
 gdb/arc-tdep.c               |   2 +-
 gdb/arch-utils.c             |   2 +-
 gdb/arm-fbsd-nat.c           |   4 +-
 gdb/arm-linux-nat.c          |   8 +-
 gdb/arm-linux-tdep.c         |   8 +-
 gdb/arm-nbsd-nat.c           |   8 +-
 gdb/arm-tdep.c               |  16 +--
 gdb/bfin-tdep.c              |   2 +-
 gdb/bsd-uthread.c            |   4 +-
 gdb/core-regset.c            |   2 +-
 gdb/corelow.c                |   4 +-
 gdb/cris-tdep.c              |  10 +-
 gdb/ctf.c                    |   2 +-
 gdb/darwin-nat.c             |   2 +-
 gdb/fbsd-tdep.c              |   2 +-
 gdb/frv-tdep.c               |   2 +-
 gdb/ft32-tdep.c              |   4 +-
 gdb/go32-nat.c               |   8 +-
 gdb/h8300-tdep.c             |   8 +-
 gdb/hppa-linux-nat.c         |   8 +-
 gdb/i386-darwin-nat.c        |   4 +-
 gdb/i386-gnu-nat.c           |   4 +-
 gdb/i386-linux-nat.c         |  14 +-
 gdb/i386-linux-tdep.c        |   2 +-
 gdb/i386-nto-tdep.c          |   2 +-
 gdb/i386-obsd-nat.c          |   2 +-
 gdb/i386-obsd-tdep.c         |   4 +-
 gdb/i386-tdep.c              |  12 +-
 gdb/i386-v4-nat.c            |   4 +-
 gdb/i387-tdep.c              |  12 +-
 gdb/ia64-linux-nat.c         |   8 +-
 gdb/ia64-tdep.c              |   8 +-
 gdb/inf-child.c              |   2 +-
 gdb/inf-ptrace.c             |   8 +-
 gdb/infrun.c                 |  28 ++--
 gdb/iq2000-tdep.c            |   2 +-
 gdb/jit.c                    |   2 +-
 gdb/linux-nat.c              |   6 +-
 gdb/linux-record.c           |   8 +-
 gdb/linux-tdep.c             |   2 +-
 gdb/lm32-tdep.c              |   4 +-
 gdb/m32c-tdep.c              |   6 +-
 gdb/m32r-linux-tdep.c        |   4 +-
 gdb/m32r-tdep.c              |   4 +-
 gdb/m68k-bsd-nat.c           |   4 +-
 gdb/m68k-bsd-tdep.c          |   2 +-
 gdb/m68k-linux-nat.c         |  14 +-
 gdb/m68k-tdep.c              |   4 +-
 gdb/m88k-tdep.c              |   2 +-
 gdb/mi/mi-main.c             |   8 +-
 gdb/mips-fbsd-nat.c          |   4 +-
 gdb/mips-fbsd-tdep.c         |  16 +--
 gdb/mips-linux-nat.c         |  12 +-
 gdb/mips-linux-tdep.c        |  20 +--
 gdb/mips-nbsd-nat.c          |   8 +-
 gdb/mips-nbsd-tdep.c         |  12 +-
 gdb/mips-tdep.c              |  16 +--
 gdb/moxie-tdep.c             |   6 +-
 gdb/nios2-tdep.c             |   4 +-
 gdb/nto-procfs.c             |   2 +-
 gdb/ppc-fbsd-nat.c           |   6 +-
 gdb/ppc-linux-nat.c          |  40 +++---
 gdb/ppc-linux-tdep.c         |  12 +-
 gdb/ppc-nbsd-nat.c           |   6 +-
 gdb/ppc-obsd-nat.c           |   6 +-
 gdb/ppc-ravenscar-thread.c   |   6 +-
 gdb/procfs.c                 |   4 +-
 gdb/ravenscar-thread.c       |   6 +-
 gdb/record-btrace.c          |   2 +-
 gdb/record-full.c            |  20 +--
 gdb/regcache.c               |  14 +-
 gdb/regcache.h               |   5 +-
 gdb/remote-sim.c             |   4 +-
 gdb/remote.c                 |  14 +-
 gdb/reverse.c                |   4 +-
 gdb/rs6000-aix-tdep.c        |   4 +-
 gdb/rs6000-nat.c             |   8 +-
 gdb/rs6000-tdep.c            |  28 ++--
 gdb/s390-linux-nat.c         |   6 +-
 gdb/s390-linux-tdep.c        |   8 +-
 gdb/sentinel-frame.c         |   2 +-
 gdb/sh-nbsd-nat.c            |   4 +-
 gdb/sh-tdep.c                |  12 +-
 gdb/sh64-tdep.c              |   4 +-
 gdb/sparc-linux-tdep.c       |   2 +-
 gdb/sparc-nat.c              |   4 +-
 gdb/sparc-obsd-tdep.c        |   4 +-
 gdb/sparc-ravenscar-thread.c |   6 +-
 gdb/sparc-tdep.c             |  16 +--
 gdb/sparc64-linux-tdep.c     |   2 +-
 gdb/sparc64-nbsd-nat.c       |   8 +-
 gdb/sparc64-obsd-tdep.c      |   4 +-
 gdb/sparc64-tdep.c           |  14 +-
 gdb/spu-linux-nat.c          |   2 +-
 gdb/spu-multiarch.c          |   4 +-
 gdb/spu-tdep.c               |  12 +-
 gdb/stack.c                  |   2 +-
 gdb/tic6x-tdep.c             |   2 +-
 gdb/tracefile-tfile.c        |   4 +-
 gdb/tracefile.c              |   2 +-
 gdb/v850-tdep.c              |   4 +-
 gdb/vax-tdep.c               |   2 +-
 gdb/windows-nat.c            |   6 +-
 gdb/xtensa-linux-nat.c       |   4 +-
 gdb/xtensa-tdep.c            |  10 +-
 118 files changed, 738 insertions(+), 416 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8835572..3c71797 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,336 @@
+2017-10-25  Yao Qi  <yao.qi@linaro.org>
+
+	* aarch32-linux-nat.c (aarch32_gp_regcache_supply): Use
+	regcache->arch () instead get_regcache_arch.
+	* aarch64-fbsd-nat.c (aarch64_fbsd_fetch_inferior_registers):
+	Likewise.
+	(aarch64_fbsd_store_inferior_registers): Likewise.
+	* aarch64-linux-nat.c (fetch_gregs_from_thread): Likewise.
+	(store_gregs_to_thread): Likewise.
+	(fetch_fpregs_from_thread): Likewise.
+	(store_fpregs_to_thread): Likewise.
+	* aarch64-tdep.c (aarch64_extract_return_value): Likewise.
+	(aarch64_store_return_value): Likewise.
+	(aarch64_software_single_step): Likewise.
+	* aix-thread.c (aix_thread_wait): Likewise.
+	(supply_reg32): Likewise.
+	(supply_sprs64): Likewise.
+	(supply_sprs32): Likewise.
+	(fill_gprs64): Likewise.
+	(fill_gprs32): Likewise.
+	(fill_sprs64): Likewise.
+	(fill_sprs32): Likewise.
+	(store_regs_user_thread): Likewise.
+	(store_regs_kernel_thread): Likewise.
+	* alpha-bsd-nat.c (alphabsd_fetch_inferior_registers): Likewise.
+	(alphabsd_store_inferior_registers): Likewise.
+	* alpha-tdep.c (alpha_extract_return_value): Likewise.
+	(alpha_store_return_value): Likewise.
+	(alpha_deal_with_atomic_sequence): Likewise.
+	(alpha_next_pc): Likewise.
+	(alpha_software_single_step): Likewise.
+	* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Likewise.
+	(amd64bsd_store_inferior_registers): Likewise.
+	* amd64-linux-nat.c (amd64_linux_fetch_inferior_registers):
+	Likewise.
+	(amd64_linux_store_inferior_registers): Likewise.
+	* amd64-nat.c (amd64_supply_native_gregset): Likewise.
+	(amd64_collect_native_gregset): Likewise.
+	* amd64-obsd-tdep.c (amd64obsd_supply_uthread): Likewise.
+	(amd64obsd_collect_uthread): Likewise.
+	* amd64-tdep.c (amd64_supply_fpregset): Likewise.
+	(amd64_collect_fpregset): Likewise.
+	(amd64_supply_fxsave): Likewise.
+	(amd64_supply_xsave): Likewise.
+	(amd64_collect_fxsave): Likewise.
+	(amd64_collect_xsave): Likewise.
+	* arc-tdep.c (arc_write_pc): Likewise.
+	* arch-utils.c (default_skip_permanent_breakpoint): Likewise.
+	* arm-fbsd-nat.c (arm_fbsd_fetch_inferior_registers): Likewise.
+	(arm_fbsd_store_inferior_registers): Likewise.
+	* arm-linux-nat.c (fetch_vfp_regs): Likewise.
+	(store_vfp_regs): Likewise.
+	(arm_linux_fetch_inferior_registers): Likewise.
+	(arm_linux_store_inferior_registers): Likewise.
+	* arm-linux-tdep.c (arm_linux_supply_gregset): Likewise.
+	(arm_linux_sigreturn_next_pc): Likewise.
+	(arm_linux_get_next_pcs_syscall_next_pc): Likewise.
+	* arm-nbsd-nat.c (arm_supply_gregset): Likewise.
+	(fetch_register): Likewise.
+	(store_register): Likewise.
+	* arm-tdep.c (arm_is_thumb): Likewise.
+	(displaced_in_arm_mode): Likewise.
+	(bx_write_pc): Likewise.
+	(arm_get_next_pcs_addr_bits_remove): Likewise.
+	(arm_software_single_step): Likewise.
+	(arm_extract_return_value): Likewise.
+	(arm_store_return_value): Likewise.
+	(arm_write_pc): Likewise.
+	* bfin-tdep.c (bfin_extract_return_value): Likewise.
+	* bsd-uthread.c (bsd_uthread_fetch_registers): Likewise.
+	(bsd_uthread_store_registers): Likewise.
+	* core-regset.c (fetch_core_registers): Likewise.
+	* corelow.c (get_core_registers): Likewise.
+	* cris-tdep.c (cris_store_return_value): Likewise.
+	(cris_extract_return_value): Likewise.
+	(find_step_target): Likewise.
+	(find_step_target): Likewise.
+	(cris_software_single_step): Likewise.
+	* ctf.c (ctf_fetch_registers): Likewise.
+	* darwin-nat.c (cancel_breakpoint): Likewise.
+	* fbsd-tdep.c (fbsd_collect_thread_registers): Likewise.
+	* frv-tdep.c (frv_extract_return_value): Likewise.
+	* ft32-tdep.c (ft32_store_return_value): Likewise.
+	(ft32_extract_return_value): Likewise.
+	* go32-nat.c (fetch_register): Likewise.
+	(go32_fetch_registers): Likewise.
+	(go32_store_registers): Likewise.
+	(store_register): Likewise.
+	* h8300-tdep.c (h8300_extract_return_value): Likewise.
+	(h8300_store_return_value): Likewise.
+	* hppa-linux-nat.c (fetch_register): Likewise.
+	(store_register): Likewise.
+	(hppa_linux_fetch_inferior_registers): Likewise.
+	(hppa_linux_store_inferior_registers): Likewise.
+	* i386-darwin-nat.c (i386_darwin_fetch_inferior_registers): Likewise.
+	(i386_darwin_store_inferior_registers): Likewise.
+	* i386-gnu-nat.c (gnu_fetch_registers): Likewise.
+	(gnu_store_registers): Likewise.
+	* i386-linux-nat.c (fetch_register): Likewise.
+	(store_register): Likewise.
+	(supply_gregset): Likewise.
+	(fill_gregset): Likewise.
+	(i386_linux_fetch_inferior_registers): Likewise.
+	(i386_linux_store_inferior_registers): Likewise.
+	(i386_linux_resume): Likewise.
+	* i386-linux-tdep.c (i386_linux_get_syscall_number_from_regcache):
+	Likewise.
+	* i386-nto-tdep.c (i386nto_supply_gregset): Likewise.
+	* i386-obsd-nat.c (i386obsd_supply_pcb): Likewise.
+	* i386-obsd-tdep.c (i386obsd_supply_uthread): Likewise.
+	(i386obsd_collect_uthread): Likewise.
+	* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
+	(i386_supply_gregset): Likewise.
+	(i386_collect_gregset): Likewise.
+	(i386_supply_fpregset): Likewise.
+	(i386_collect_fpregset): Likewise.
+	(i386_mpx_bd_base): Likewise.
+	* i386-v4-nat.c	(supply_fpregset): Likewise.
+	(fill_fpregset): Likewise.
+	* i387-tdep.c (i387_supply_fsave): Likewise.
+	(i387_collect_fsave): Likewise.
+	(i387_supply_fxsave): Likewise.
+	(i387_collect_fxsave): Likewise.
+	(i387_supply_xsave): Likewise.
+	(i387_collect_xsave): Likewise.
+	* ia64-linux-nat.c (ia64_linux_fetch_registers): Likewise.
+	(ia64_linux_store_registers): Likewise.
+	* ia64-tdep.c (ia64_access_rse_reg): Likewise.
+	(ia64_extract_return_value): Likewise.
+	(ia64_store_return_value): Likewise.
+	(find_func_descr): Likewise.
+	* inf-child.c (inf_child_fetch_inferior_registers): Likewise.
+	* inf-ptrace.c (inf_ptrace_fetch_registers): Likewise.
+	(inf_ptrace_store_registers): Likewise.
+	* infrun.c (use_displaced_stepping): Likewise.
+	(displaced_step_prepare_throw): Likewise.
+	(resume): Likewise.
+	(proceed): Likewise.
+	(do_target_wait): Likewise.
+	(adjust_pc_after_break): Likewise.
+	(handle_inferior_event_1): Likewise.
+	(handle_signal_stop): Likewise.
+	(save_infcall_suspend_state): Likewise.
+	(restore_infcall_suspend_state): Likewise.
+	* iq2000-tdep.c (iq2000_extract_return_value): Likewise.
+	* jit.c (jit_frame_prev_register): Likewise.
+	* linux-nat.c (save_stop_reason): Likewise.
+	(linux_nat_wait_1): Likewise.
+	(resume_stopped_resumed_lwps): Likewise.
+	* linux-record.c (record_linux_sockaddr): Likewise.
+	(record_linux_msghdr): Likewise.
+	(record_linux_system_call): Likewise.
+	* linux-tdep.c (linux_collect_thread_registers): Likewise.
+	* lm32-tdep.c (lm32_extract_return_value): Likewise.
+	(lm32_store_return_value): Likewise.
+	* m32c-tdep.c (m32c_read_flg): Likewise.
+	(m32c_pseudo_register_read): Likewise.
+	(m32c_pseudo_register_write): Likewise.
+	* m32r-linux-tdep.c (m32r_linux_supply_gregset): Likewise.
+	(m32r_linux_collect_gregset): Likewise.
+	* m32r-tdep.c (m32r_store_return_value): Likewise.
+	(m32r_extract_return_value): Likewise.
+	* m68k-bsd-nat.c (m68kbsd_supply_fpregset): Likewise.
+	(m68kbsd_collect_fpregset): Likewise.
+	* m68k-bsd-tdep.c (m68kbsd_supply_fpregset): Likewise.
+	* m68k-linux-nat.c (fetch_register): Likewise.
+	(old_fetch_inferior_registers): Likewise.
+	(old_store_inferior_registers): Likewise.
+	(store_regs): Likewise.
+	* m68k-tdep.c (m68k_svr4_extract_return_value): Likewise.
+	(m68k_svr4_store_return_value): Likewise.
+	* m88k-tdep.c (m88k_store_arguments): Likewise.
+	* mi/mi-main.c (mi_cmd_data_list_changed_registers): Likewise.
+	(mi_cmd_data_write_register_values): Likewise.
+	* mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers): Likewise.
+	(mips_fbsd_store_inferior_registers): Likewise.
+	* mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Likewise.
+	(mips_fbsd_supply_gregs): Likewise.
+	(mips_fbsd_collect_fpregs): Likewise.
+	(mips_fbsd_collect_gregs): Likewise.
+	(mips_fbsd_supply_fpregset): Likewise.
+	(mips_fbsd_collect_fpregset): Likewise.
+	(mips_fbsd_supply_gregset): Likewise.
+	(mips_fbsd_collect_gregset): Likewise.
+	* mips-linux-nat.c (supply_gregset): Likewise.
+	(fill_gregset): Likewise.
+	(supply_fpregset): Likewise.
+	(fill_fpregset): Likewise.
+	* mips-linux-tdep.c (mips_supply_gregset): Likewise.
+	(mips_fill_gregset): Likewise.
+	(mips_supply_fpregset): Likewise.
+	(mips_fill_fpregset): Likewise.
+	(mips64_supply_gregset): Likewise.
+	(micromips_linux_sigframe_validate): Likewise.
+	* mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers): Likewise.
+	(mipsnbsd_fetch_inferior_registers): Likewise.
+	(mipsnbsd_store_inferior_registers): Likewise.
+	* mips-nbsd-tdep.c (mipsnbsd_supply_fpregset): Likewise.
+	(mipsnbsd_supply_gregset): Likewise.
+	(mipsnbsd_iterate_over_regset_sections): Likewise.
+	(mipsnbsd_supply_reg): Likewise.
+	(mipsnbsd_supply_fpreg): Likewise.
+	* mips-tdep.c (mips_in_frame_stub): Likewise.
+	(mips_dummy_id): Likewise.
+	(is_octeon_bbit_op): Likewise.
+	(micromips_bc1_pc): Likewise.
+	(extended_mips16_next_pc): Likewise.
+	(mips16_next_pc): Likewise.
+	(deal_with_atomic_sequence): Likewise.
+	* moxie-tdep.c (moxie_process_readu): Likewise.
+	* nios2-tdep.c (nios2_get_next_pc): Likewise.
+	* nto-procfs.c (procfs_store_registers): Likewise.
+	* ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers): Likewise.
+	(ppcfbsd_store_inferior_registers): Likewise.
+	* ppc-linux-nat.c (fetch_vsx_register): Likewise.
+	(fetch_altivec_register): Likewise.
+	(get_spe_registers): Likewise.
+	(fetch_spe_register): Likewise.
+	(fetch_altivec_registers): Likewise.
+	(fetch_all_gp_regs): Likewise.
+	(fetch_all_fp_regs): Likewise.
+	(store_vsx_register): Likewise.
+	(store_altivec_register): Likewise.
+	(set_spe_registers): Likewise.
+	(store_spe_register): Likewise.
+	(store_altivec_registers): Likewise.
+	(store_all_gp_regs): Likewise.
+	(store_all_fp_regs): Likewise.
+	* ppc-linux-tdep.c (ppc_linux_supply_gregset): Likewise.
+	(ppc_linux_collect_gregset): Likewise.
+	(ppc_canonicalize_syscall): Likewise.
+	(ppc_linux_record_signal): Likewise.
+	(ppu2spu_prev_register): Likewise.
+	* ppc-nbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
+	* ppc-obsd-nat.c (ppcobsd_fetch_registers): Likewise.
+	(ppcobsd_store_registers): Likewise.
+	* ppc-ravenscar-thread.c (ppc_ravenscar_generic_fetch_registers):
+	Likewise.
+	(ppc_ravenscar_generic_store_registers): Likewise.
+	* procfs.c (procfs_fetch_registers): Likewise.
+	(procfs_store_registers): Likewise.
+	* ravenscar-thread.c (ravenscar_fetch_registers): Likewise.
+	(ravenscar_store_registers): Likewise.
+	(ravenscar_prepare_to_store): Likewise.
+	* record-btrace.c (record_btrace_fetch_registers): Likewise.
+	* record-full.c (record_full_wait_1): Likewise.
+	(record_full_registers_change): Likewise.
+	(record_full_store_registers): Likewise.
+	(record_full_core_fetch_registers): Likewise.
+	(record_full_save): Likewise.
+	(record_full_goto_insn): Likewise.
+	* regcache.c (regcache_register_size): Likewise.
+	(get_regcache_arch): Remove.
+	(regcache_read_pc): Likewise.
+	* regcache.h (get_regcache_arch): Remove.
+	* remote-sim.c (gdbsim_fetch_register): Likewise.
+	(gdbsim_store_register): Likewise.
+	* remote.c (fetch_register_using_p): Likewise.
+	(send_g_packet): Likewise.
+	(remote_prepare_to_store): Likewise.
+	(store_registers_using_G): Likewise.
+	* reverse.c (save_bookmark_command): Likewise.
+	(goto_bookmark_command): Likewise.
+	* rs6000-aix-tdep.c (branch_dest): Likewise.
+	* rs6000-nat.c (rs6000_ptrace64): Likewise.
+	(fetch_register): Likewise.
+	* rs6000-tdep.c (ppc_supply_reg): Likewise.
+	(ppc_collect_reg): Likewise.
+	(ppc_collect_gregset): Likewise.
+	(ppc_collect_fpregset): Likewise.
+	(ppc_collect_vsxregset): Likewise.
+	(ppc_collect_vrregset): Likewise.
+	(ppc_displaced_step_hw_singlestep): Likewise.
+	(rs6000_pseudo_register_read): Likewise.
+	(rs6000_pseudo_register_write): Likewise.
+	* s390-linux-nat.c (supply_gregset): Likewise.
+	(fill_gregset): Likewise.
+	(s390_linux_fetch_inferior_registers): Likewise.
+	* s390-linux-tdep.c (s390_write_pc): Likewise.
+	(s390_software_single_step): Likewise.
+	(s390_all_but_pc_registers_record): Likewise.
+	(s390_linux_syscall_record): Likewise.
+	* sentinel-frame.c (sentinel_frame_prev_arch): Likewise.
+	* sh-nbsd-nat.c (shnbsd_fetch_inferior_registers): Likewise.
+	(shnbsd_store_inferior_registers): Likewise.
+	* sh-tdep.c (sh_extract_return_value_nofpu): Likewise.
+	(sh_extract_return_value_fpu): Likewise.
+	(sh_store_return_value_nofpu): Likewise.
+	(sh_corefile_supply_regset): Likewise.
+	(sh_corefile_collect_regset): Likewise.
+	* sh64-tdep.c (sh64_extract_return_value): Likewise.
+	(sh64_store_return_value): Likewise.
+	* sparc-linux-tdep.c (sparc32_linux_collect_core_fpregset): Likewise.
+	* sparc-nat.c (sparc_fetch_inferior_registers): Likewise.
+	(sparc_store_inferior_registers): Likewise.
+	* sparc-ravenscar-thread.c (register_in_thread_descriptor_p): Likewise.
+	(sparc_ravenscar_prepare_to_store): Likewise.
+	* sparc-tdep.c (sparc32_store_arguments): Likewise.
+	(sparc_analyze_control_transfer): Likewise.
+	(sparc_step_trap): Likewise.
+	(sparc_software_single_step): Likewise.
+	(sparc32_gdbarch_init): Likewise.
+	(sparc_supply_rwindow): Likewise.
+	(sparc_collect_rwindow): Likewise.
+	* sparc64-linux-tdep.c (sparc64_linux_collect_core_fpregset): Likewise.
+	* sparc64-nbsd-nat.c (sparc64nbsd_supply_gregset): Likewise.
+	(sparc64nbsd_collect_gregset): Likewise.
+	(sparc64nbsd_supply_fpregset): Likewise.
+	(sparc64nbsd_collect_fpregset): Likewise.
+	* sparc64-tdep.c (sparc64_store_arguments): Likewise.
+	(sparc64_supply_gregset): Likewise.
+	(sparc64_collect_gregset): Likewise.
+	(sparc64_supply_fpregset): Likewise.
+	(sparc64_collect_fpregset): Likewise.
+	* spu-linux-nat.c (spu_fetch_inferior_registers): Likewise.
+	* spu-tdep.c (spu_unwind_sp): Likewise.
+	(spu2ppu_prev_register): Likewise.
+	(spu_memory_remove_breakpoint): Likewise.
+	* stack.c (return_command): Likewise.
+	* tic6x-tdep.c (tic6x_extract_signed_field): Likewise.
+	* tracefile-tfile.c (tfile_fetch_registers): Likewise.
+	* tracefile.c (trace_save_ctf): Likewise.
+	* windows-nat.c (do_windows_fetch_inferior_registers): Likewise.
+	(do_windows_store_inferior_registers): Likewise.
+	(windows_resume): Likewise.
+	* xtensa-linux-nat.c (fill_gregset): Likewise.
+	(supply_gregset_reg): Likewise.
+	* xtensa-tdep.c (xtensa_register_write_masked): Likewise.
+	(xtensa_register_read_masked): Likewise.
+	(xtensa_supply_gregset): Likewise.
+	(xtensa_extract_return_value): Likewise.
+	(xtensa_store_return_value): Likewise.
+
 2017-10-25  Ulrich Weigand  <uweigand@de.ibm.com>
 
 	* doublest.c (floatformat_from_string): New function.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index 94e348f..48e3a97 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -46,7 +46,7 @@ aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs,
     regcache_raw_supply (regcache, ARM_PS_REGNUM, &regs[ARM_PC_REGNUM]);
 
   regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove
-			  (get_regcache_arch (regcache), regs[ARM_PC_REGNUM]);
+			  (regcache->arch (), regs[ARM_PC_REGNUM]);
   regcache_raw_supply (regcache, ARM_PC_REGNUM, &regs[ARM_PC_REGNUM]);
 }
 
diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c
index ffe7d5b..73aff9c 100644
--- a/gdb/aarch64-fbsd-nat.c
+++ b/gdb/aarch64-fbsd-nat.c
@@ -54,7 +54,7 @@ aarch64_fbsd_fetch_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
@@ -87,7 +87,7 @@ aarch64_fbsd_store_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 4feaec3..de18edd 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -155,7 +155,7 @@ static void
 fetch_gregs_from_thread (struct regcache *regcache)
 {
   int ret, tid;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   elf_gregset_t regs;
   struct iovec iovec;
 
@@ -195,7 +195,7 @@ store_gregs_to_thread (const struct regcache *regcache)
   int ret, tid;
   elf_gregset_t regs;
   struct iovec iovec;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   /* Make sure REGS can hold all registers contents on both aarch64
      and arm.  */
@@ -238,7 +238,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
   int ret, tid;
   elf_fpregset_t regs;
   struct iovec iovec;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   /* Make sure REGS can hold all VFP registers contents on both aarch64
      and arm.  */
@@ -286,7 +286,7 @@ store_fpregs_to_thread (const struct regcache *regcache)
   int ret, tid;
   elf_fpregset_t regs;
   struct iovec iovec;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   /* Make sure REGS can hold all VFP registers contents on both aarch64
      and arm.  */
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index cbab1a5..85cabfd 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1785,7 +1785,7 @@ static void
 aarch64_extract_return_value (struct type *type, struct regcache *regs,
 			      gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regs);
+  struct gdbarch *gdbarch = regs->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -1923,7 +1923,7 @@ static void
 aarch64_store_return_value (struct type *type, struct regcache *regs,
 			    const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regs);
+  struct gdbarch *gdbarch = regs->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -2410,7 +2410,7 @@ value_of_aarch64_user_reg (struct frame_info *frame, const void *baton)
 static std::vector<CORE_ADDR>
 aarch64_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
   const int insn_size = 4;
   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index f9ec864..b5c9f3b 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1040,7 +1040,7 @@ aix_thread_wait (struct target_ops *ops,
       && status->value.sig == GDB_SIGNAL_TRAP)
     {
       struct regcache *regcache = get_thread_regcache (ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
 
       if (regcache_read_pc (regcache)
 	  - gdbarch_decr_pc_after_break (gdbarch) == pd_brk_addr)
@@ -1055,7 +1055,7 @@ aix_thread_wait (struct target_ops *ops,
 static void
 supply_gprs64 (struct regcache *regcache, uint64_t *vals)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   int regno;
 
   for (regno = 0; regno < ppc_num_gprs; regno++)
@@ -1076,7 +1076,7 @@ supply_reg32 (struct regcache *regcache, int regno, uint32_t val)
 static void
 supply_fprs (struct regcache *regcache, double *vals)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int regno;
 
@@ -1117,7 +1117,7 @@ supply_sprs64 (struct regcache *regcache,
 	       uint64_t lr, uint64_t ctr, uint32_t xer,
 	       uint32_t fpscr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
@@ -1141,7 +1141,7 @@ supply_sprs32 (struct regcache *regcache,
 	       uint32_t lr, uint32_t ctr, uint32_t xer,
 	       uint32_t fpscr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
@@ -1166,7 +1166,7 @@ supply_sprs32 (struct regcache *regcache,
 static void
 fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int status, i;
   pthdb_context_t ctx;
@@ -1221,7 +1221,7 @@ static void
 fetch_regs_kernel_thread (struct regcache *regcache, int regno,
 			  pthdb_tid_t tid)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   uint64_t gprs64[ppc_num_gprs];
   uint32_t gprs32[ppc_num_gprs];
@@ -1328,7 +1328,7 @@ aix_thread_fetch_registers (struct target_ops *ops,
 static void
 fill_gprs64 (const struct regcache *regcache, uint64_t *vals)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   int regno;
 
   for (regno = 0; regno < ppc_num_gprs; regno++)
@@ -1341,7 +1341,7 @@ fill_gprs64 (const struct regcache *regcache, uint64_t *vals)
 static void 
 fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   int regno;
 
   for (regno = 0; regno < ppc_num_gprs; regno++)
@@ -1355,7 +1355,7 @@ fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
 static void
 fill_fprs (const struct regcache *regcache, double *vals)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int regno;
 
@@ -1380,7 +1380,7 @@ fill_sprs64 (const struct regcache *regcache,
 	     uint64_t *lr, uint64_t *ctr, uint32_t *xer,
 	     uint32_t *fpscr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   /* Verify that the size of the size of the IAR buffer is the
@@ -1416,7 +1416,7 @@ fill_sprs32 (const struct regcache *regcache,
 	     uint32_t *lr, uint32_t *ctr, uint32_t *xer,
 	     uint32_t *fpscr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   /* Verify that the size of the size of the IAR buffer is the
@@ -1454,7 +1454,7 @@ fill_sprs32 (const struct regcache *regcache,
 static void
 store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int status, i;
   pthdb_context_t ctx;
@@ -1551,7 +1551,7 @@ static void
 store_regs_kernel_thread (const struct regcache *regcache, int regno,
 			  pthdb_tid_t tid)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   uint64_t gprs64[ppc_num_gprs];
   uint32_t gprs32[ppc_num_gprs];
diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c
index 8a67bb0..7e8c40d 100644
--- a/gdb/alpha-bsd-nat.c
+++ b/gdb/alpha-bsd-nat.c
@@ -101,7 +101,7 @@ alphabsd_fetch_inferior_registers (struct target_ops *ops,
     }
 
   if (regno == -1
-      || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
+      || regno >= gdbarch_fp0_regnum (regcache->arch ()))
     {
       struct fpreg fpregs;
 
@@ -138,7 +138,7 @@ alphabsd_store_inferior_registers (struct target_ops *ops,
     }
 
   if (regno == -1
-      || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
+      || regno >= gdbarch_fp0_regnum (regcache->arch ()))
     {
       struct fpreg fpregs;
 
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 8955695..4331422 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -474,7 +474,7 @@ static void
 alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
 			    gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
   ULONGEST l;
@@ -543,7 +543,7 @@ static void
 alpha_store_return_value (struct type *valtype, struct regcache *regcache,
 			  const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
   ULONGEST l;
 
@@ -769,7 +769,7 @@ static const int stq_c_opcode = 0x2f;
 static std::vector<CORE_ADDR>
 alpha_deal_with_atomic_sequence (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR pc = regcache_read_pc (regcache);
   CORE_ADDR breaks[2] = {-1, -1};
   CORE_ADDR loc = pc;
@@ -1601,7 +1601,7 @@ fp_register_sign_bit (LONGEST reg)
 static CORE_ADDR
 alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   unsigned int insn;
   unsigned int op;
   int regno;
@@ -1722,7 +1722,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
 std::vector<CORE_ADDR>
 alpha_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR pc;
 
   pc = alpha_next_pc (regcache, regcache_read_pc (regcache));
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 41dee84..81cb59d 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -42,7 +42,7 @@ static void
 amd64bsd_fetch_inferior_registers (struct target_ops *ops,
 				   struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
@@ -116,7 +116,7 @@ static void
 amd64bsd_store_inferior_registers (struct target_ops *ops,
 				   struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index a83ad8b..035ce25 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -134,7 +134,7 @@ static void
 amd64_linux_fetch_inferior_registers (struct target_ops *ops,
 				      struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int tid;
 
   /* GNU/Linux LWP ID's are process ID's.  */
@@ -213,7 +213,7 @@ static void
 amd64_linux_store_inferior_registers (struct target_ops *ops,
 				      struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int tid;
 
   /* GNU/Linux LWP ID's are process ID's.  */
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index ff04339..b046052 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -96,7 +96,7 @@ amd64_supply_native_gregset (struct regcache *regcache,
 			     const void *gregs, int regnum)
 {
   const char *regs = (const char *) gregs;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int num_regs = amd64_native_gregset64_num_regs;
   int i;
 
@@ -127,7 +127,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
 			      void *gregs, int regnum)
 {
   char *regs = (char *) gregs;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int num_regs = amd64_native_gregset64_num_regs;
   int i;
 
diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c
index 729342e..d51bc14 100644
--- a/gdb/amd64-obsd-tdep.c
+++ b/gdb/amd64-obsd-tdep.c
@@ -221,7 +221,7 @@ static void
 amd64obsd_supply_uthread (struct regcache *regcache,
 			  int regnum, CORE_ADDR addr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR sp_addr = addr + AMD64OBSD_UTHREAD_RSP_OFFSET;
   CORE_ADDR sp = 0;
@@ -265,7 +265,7 @@ static void
 amd64obsd_collect_uthread (const struct regcache *regcache,
 			   int regnum, CORE_ADDR addr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR sp_addr = addr + AMD64OBSD_UTHREAD_RSP_OFFSET;
   CORE_ADDR sp = 0;
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 08a9cae..bcd37ef 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2922,7 +2922,7 @@ static void
 amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
 		       int regnum, const void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   gdb_assert (len >= tdep->sizeof_fpregset);
@@ -2939,7 +2939,7 @@ amd64_collect_fpregset (const struct regset *regset,
 			const struct regcache *regcache,
 			int regnum, void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   gdb_assert (len >= tdep->sizeof_fpregset);
@@ -3264,7 +3264,7 @@ void
 amd64_supply_fxsave (struct regcache *regcache, int regnum,
 		     const void *fxsave)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   i387_supply_fxsave (regcache, regnum, fxsave);
@@ -3287,7 +3287,7 @@ void
 amd64_supply_xsave (struct regcache *regcache, int regnum,
 		    const void *xsave)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   i387_supply_xsave (regcache, regnum, xsave);
@@ -3315,7 +3315,7 @@ void
 amd64_collect_fxsave (const struct regcache *regcache, int regnum,
 		      void *fxsave)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte *regs = (gdb_byte *) fxsave;
 
@@ -3336,7 +3336,7 @@ void
 amd64_collect_xsave (const struct regcache *regcache, int regnum,
 		     void *xsave, int gcore)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte *regs = (gdb_byte *) xsave;
 
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 9927910..09572ac 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -447,7 +447,7 @@ arc_insn_get_linear_next_pc (const struct arc_instruction &insn)
 static void
 arc_write_pc (struct regcache *regcache, CORE_ADDR new_pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   if (arc_debug)
     debug_printf ("arc: Writing PC, new value=%s\n",
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 6bdcc01..a25dcd1 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -874,7 +874,7 @@ int default_insn_is_jump (struct gdbarch *gdbarch, CORE_ADDR addr)
 void
 default_skip_permanent_breakpoint (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR current_pc = regcache_read_pc (regcache);
   int bp_len;
 
diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c
index b1c5c36..993743e 100644
--- a/gdb/arm-fbsd-nat.c
+++ b/gdb/arm-fbsd-nat.c
@@ -58,7 +58,7 @@ arm_fbsd_fetch_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
@@ -93,7 +93,7 @@ arm_fbsd_store_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 8b25ff7..cc7a67a 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -303,7 +303,7 @@ fetch_vfp_regs (struct regcache *regcache)
 {
   gdb_byte regbuf[VFP_REGS_SIZE];
   int ret, regno, tid;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   /* Get the thread id for the ptrace call.  */
@@ -332,7 +332,7 @@ store_vfp_regs (const struct regcache *regcache)
 {
   gdb_byte regbuf[VFP_REGS_SIZE];
   int ret, regno, tid;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   /* Get the thread id for the ptrace call.  */
@@ -378,7 +378,7 @@ static void
 arm_linux_fetch_inferior_registers (struct target_ops *ops,
 				    struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (-1 == regno)
@@ -416,7 +416,7 @@ static void
 arm_linux_store_inferior_registers (struct target_ops *ops,
 				    struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (-1 == regno)
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 4d1d890..525474c 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -478,7 +478,7 @@ arm_linux_supply_gregset (const struct regset *regset,
 			  struct regcache *regcache,
 			  int regnum, const void *gregs_buf, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   const gdb_byte *gregs = (const gdb_byte *) gregs_buf;
   int regno;
@@ -790,7 +790,7 @@ arm_linux_sigreturn_next_pc (struct regcache *regcache,
   ULONGEST sp;
   unsigned long sp_data;
   CORE_ADDR next_pc = 0;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int pc_offset = 0;
   int is_sigreturn = 0;
@@ -882,7 +882,7 @@ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
     }
   else
     {
-      struct gdbarch *gdbarch = get_regcache_arch (self->regcache);
+      struct gdbarch *gdbarch = self->regcache->arch ();
       enum bfd_endian byte_order_for_code = 
 	gdbarch_byte_order_for_code (gdbarch);
       unsigned long this_instr = 
@@ -922,7 +922,7 @@ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
 static std::vector<CORE_ADDR>
 arm_linux_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct arm_get_next_pcs next_pcs_ctx;
 
   /* If the target does have hardware single step, GDB doesn't have
diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c
index f066528..0f29ebf 100644
--- a/gdb/arm-nbsd-nat.c
+++ b/gdb/arm-nbsd-nat.c
@@ -47,7 +47,7 @@ arm_supply_gregset (struct regcache *regcache, struct reg *gregset)
   regcache_raw_supply (regcache, ARM_LR_REGNUM,
 		       (char *) &gregset->r_lr);
   /* This is ok: we're running native...  */
-  r_pc = gdbarch_addr_bits_remove (get_regcache_arch (regcache), gregset->r_pc);
+  r_pc = gdbarch_addr_bits_remove (regcache->arch (), gregset->r_pc);
   regcache_raw_supply (regcache, ARM_PC_REGNUM, (char *) &r_pc);
 
   if (arm_apcs_32)
@@ -101,7 +101,7 @@ fetch_register (struct regcache *regcache, int regno)
     case ARM_PC_REGNUM:
       /* This is ok: we're running native...  */
       inferior_registers.r_pc = gdbarch_addr_bits_remove
-				  (get_regcache_arch (regcache),
+				  (regcache->arch (),
 				   inferior_registers.r_pc);
       regcache_raw_supply (regcache, ARM_PC_REGNUM,
 			   (char *) &inferior_registers.r_pc);
@@ -212,7 +212,7 @@ armnbsd_fetch_registers (struct target_ops *ops,
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct reg inferior_registers;
   int ret;
 
@@ -289,7 +289,7 @@ store_register (const struct regcache *regcache, int regno)
 static void
 store_regs (const struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct reg inferior_registers;
   int ret;
   int regno;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index fc6197d..def3958 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -297,7 +297,7 @@ int
 arm_is_thumb (struct regcache *regcache)
 {
   ULONGEST cpsr;
-  ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regcache));
+  ULONGEST t_bit = arm_psr_thumb_bit (regcache->arch ());
 
   cpsr = regcache_raw_get_unsigned (regcache, ARM_PS_REGNUM);
 
@@ -4452,7 +4452,7 @@ static int
 displaced_in_arm_mode (struct regcache *regs)
 {
   ULONGEST ps;
-  ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regs));
+  ULONGEST t_bit = arm_psr_thumb_bit (regs->arch ());
 
   regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &ps);
 
@@ -4481,7 +4481,7 @@ static void
 bx_write_pc (struct regcache *regs, ULONGEST val)
 {
   ULONGEST ps;
-  ULONGEST t_bit = arm_psr_thumb_bit (get_regcache_arch (regs));
+  ULONGEST t_bit = arm_psr_thumb_bit (regs->arch ());
 
   regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &ps);
 
@@ -6223,7 +6223,7 @@ CORE_ADDR
 arm_get_next_pcs_addr_bits_remove (struct arm_get_next_pcs *self,
 				   CORE_ADDR val)
 {
-  return gdbarch_addr_bits_remove (get_regcache_arch (self->regcache), val);
+  return gdbarch_addr_bits_remove (self->regcache->arch (), val);
 }
 
 /* Wrapper over syscall_next_pc for use in get_next_pcs.  */
@@ -6250,7 +6250,7 @@ arm_get_next_pcs_is_thumb (struct arm_get_next_pcs *self)
 std::vector<CORE_ADDR>
 arm_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct arm_get_next_pcs next_pcs_ctx;
 
   arm_get_next_pcs_ctor (&next_pcs_ctx,
@@ -7887,7 +7887,7 @@ static void
 arm_extract_return_value (struct type *type, struct regcache *regs,
 			  gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regs);
+  struct gdbarch *gdbarch = regs->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   if (TYPE_CODE_FLT == TYPE_CODE (type))
@@ -8096,7 +8096,7 @@ static void
 arm_store_return_value (struct type *type, struct regcache *regs,
 			const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regs);
+  struct gdbarch *gdbarch = regs->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -8652,7 +8652,7 @@ arm_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile,
 static void
 arm_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   regcache_cooked_write_unsigned (regcache, ARM_PC_REGNUM, pc);
 
   /* If necessary, set the T bit.  */
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 2e99418..f9594d7 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -608,7 +608,7 @@ bfin_extract_return_value (struct type *type,
 			   struct regcache *regs,
 			   gdb_byte *dst)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regs);
+  struct gdbarch *gdbarch = regs->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   bfd_byte *valbuf = dst;
   int len = TYPE_LENGTH (type);
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index c97dd34..8018f5a 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -287,7 +287,7 @@ static void
 bsd_uthread_fetch_registers (struct target_ops *ops,
 			     struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct bsd_uthread_ops *uthread_ops
     = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
   ptid_t ptid = regcache_get_ptid (regcache);
@@ -321,7 +321,7 @@ static void
 bsd_uthread_store_registers (struct target_ops *ops,
 			     struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct bsd_uthread_ops *uthread_ops
     = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
   struct target_ops *beneath = find_target_beneath (ops);
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
index 9d2b914..77ae85b 100644
--- a/gdb/core-regset.c
+++ b/gdb/core-regset.c
@@ -84,7 +84,7 @@ fetch_core_registers (struct regcache *regcache,
       else
 	{
 	  memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
-	  if (gdbarch_fp0_regnum (get_regcache_arch (regcache)) >= 0)
+	  if (gdbarch_fp0_regnum (regcache->arch ()) >= 0)
 	    supply_fpregset (regcache,
 			     (const gdb_fpregset_t *) fpregset_p);
 	}
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 594db1d..6800905 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -603,7 +603,7 @@ get_core_registers (struct target_ops *ops,
       return;
     }
 
-  gdbarch = get_regcache_arch (regcache);
+  gdbarch = regcache->arch ();
   if (gdbarch_iterate_over_regset_sections_p (gdbarch))
     gdbarch_iterate_over_regset_sections (gdbarch,
 					  get_core_registers_cb,
@@ -617,7 +617,7 @@ get_core_registers (struct target_ops *ops,
     }
 
   /* Mark all registers not found in the core as unavailable.  */
-  for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
+  for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
     if (regcache_register_status (regcache, i) == REG_UNKNOWN)
       regcache_raw_supply (regcache, i, NULL);
 }
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index d64c99a..d623eb6 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1643,7 +1643,7 @@ static void
 cris_store_return_value (struct type *type, struct regcache *regcache,
 			 const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
   int len = TYPE_LENGTH (type);
@@ -1811,7 +1811,7 @@ static void
 cris_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
   int len = TYPE_LENGTH (type);
@@ -1994,7 +1994,7 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env)
   int i;
   int offset;
   unsigned short insn;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   /* Create a local register image and set the initial state.  */
@@ -2063,7 +2063,7 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env)
 static std::vector<CORE_ADDR>
 cris_software_single_step (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   inst_env_type inst_env;
   std::vector<CORE_ADDR> next_pcs;
 
@@ -3800,7 +3800,7 @@ typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
 static void 
 cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int i;
   cris_elf_greg_t *regp = *gregsetp;
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 21ed113..35cf78c 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1186,7 +1186,7 @@ static void
 ctf_fetch_registers (struct target_ops *ops,
 		     struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct bt_ctf_event *event = NULL;
   struct bt_iter_pos *pos;
 
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index e96f24d..dc47c73 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1191,7 +1191,7 @@ cancel_breakpoint (ptid_t ptid)
      tripped on it.  */
 
   struct regcache *regcache = get_thread_regcache (ptid);
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR pc;
 
   pc = regcache_read_pc (regcache) - gdbarch_decr_pc_after_break (gdbarch);
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index fa70f7c..f89b520 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -246,7 +246,7 @@ fbsd_collect_thread_registers (const struct regcache *regcache,
 			       char *note_data, int *note_size,
 			       enum gdb_signal stop_signal)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct fbsd_collect_regset_section_cb_data data;
 
   data.regcache = regcache;
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 8a3a893..bae0e18 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1110,7 +1110,7 @@ static void
 frv_extract_return_value (struct type *type, struct regcache *regcache,
                           gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
 
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index 0e61a4b..757301a 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -123,7 +123,7 @@ static void
 ft32_store_return_value (struct type *type, struct regcache *regcache,
 			 const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR regval;
   int len = TYPE_LENGTH (type);
@@ -400,7 +400,7 @@ static void
 ft32_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *dst)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   bfd_byte *valbuf = dst;
   int len = TYPE_LENGTH (type);
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 582b007..6abd734 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -493,7 +493,7 @@ go32_wait (struct target_ops *ops,
 static void
 fetch_register (struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regno < gdbarch_fp0_regnum (gdbarch))
     regcache_raw_supply (regcache, regno,
 			 (char *) &a_tss + regno_mapping[regno].tss_ofs);
@@ -514,7 +514,7 @@ go32_fetch_registers (struct target_ops *ops,
   else
     {
       for (regno = 0;
-	   regno < gdbarch_fp0_regnum (get_regcache_arch (regcache));
+	   regno < gdbarch_fp0_regnum (regcache->arch ());
 	   regno++)
 	fetch_register (regcache, regno);
       i387_supply_fsave (regcache, -1, &npx);
@@ -524,7 +524,7 @@ go32_fetch_registers (struct target_ops *ops,
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regno < gdbarch_fp0_regnum (gdbarch))
     regcache_raw_collect (regcache, regno,
 			  (char *) &a_tss + regno_mapping[regno].tss_ofs);
@@ -546,7 +546,7 @@ go32_store_registers (struct target_ops *ops,
     store_register (regcache, regno);
   else
     {
-      for (r = 0; r < gdbarch_fp0_regnum (get_regcache_arch (regcache)); r++)
+      for (r = 0; r < gdbarch_fp0_regnum (regcache->arch ()); r++)
 	store_register (regcache, r);
       i387_collect_fsave (regcache, -1, &npx);
     }
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 7edc3cc..011afca 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -742,7 +742,7 @@ static void
 h8300_extract_return_value (struct type *type, struct regcache *regcache,
 			    gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
   ULONGEST c, addr;
@@ -779,7 +779,7 @@ static void
 h8300h_extract_return_value (struct type *type, struct regcache *regcache,
 			     gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST c;
 
@@ -844,7 +844,7 @@ static void
 h8300_store_return_value (struct type *type, struct regcache *regcache,
 			  const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
 
@@ -873,7 +873,7 @@ static void
 h8300h_store_return_value (struct type *type, struct regcache *regcache,
 			   const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
 
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index c190a4b..67f51e7 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -213,7 +213,7 @@ static const int greg_map[] =
 static void
 fetch_register (struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   pid_t tid;
   int val;
 
@@ -240,7 +240,7 @@ fetch_register (struct regcache *regcache, int regno)
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   pid_t tid;
   int val;
 
@@ -269,7 +269,7 @@ hppa_linux_fetch_inferior_registers (struct target_ops *ops,
   if (-1 == regno)
     {
       for (regno = 0;
-	   regno < gdbarch_num_regs (get_regcache_arch (regcache));
+	   regno < gdbarch_num_regs (regcache->arch ());
 	   regno++)
         fetch_register (regcache, regno);
     }
@@ -290,7 +290,7 @@ hppa_linux_store_inferior_registers (struct target_ops *ops,
   if (-1 == regno)
     {
       for (regno = 0;
-	   regno < gdbarch_num_regs (get_regcache_arch (regcache));
+	   regno < gdbarch_num_regs (regcache->arch ());
 	   regno++)
 	store_register (regcache, regno);
     }
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index dc7ce32..08a706b 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -52,7 +52,7 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops,
 {
   thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
   int fetched = 0;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
 #ifdef BFD64
   if (gdbarch_ptr_bit (gdbarch) == 64)
@@ -168,7 +168,7 @@ i386_darwin_store_inferior_registers (struct target_ops *ops,
 				      struct regcache *regcache, int regno)
 {
   thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
 #ifdef BFD64
   if (gdbarch_ptr_bit (gdbarch) == 64)
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index 07e3a83..68e6293 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -127,7 +127,7 @@ gnu_fetch_registers (struct target_ops *ops,
       else
 	{
 	  proc_debug (thread, "fetching register %s",
-		      gdbarch_register_name (get_regcache_arch (regcache),
+		      gdbarch_register_name (regcache->arch (),
 					     regno));
 
 	  regcache_raw_supply (regcache, regno,
@@ -183,7 +183,7 @@ gnu_store_registers (struct target_ops *ops,
 		     struct regcache *regcache, int regno)
 {
   struct proc *thread;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   ptid_t ptid = regcache_get_ptid (regcache);
 
   /* Make sure we know about new threads.  */
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index dd86c2f..a4c1c4a 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -112,7 +112,7 @@ fetch_register (struct regcache *regcache, int regno)
 		i386_linux_gregset_reg_offset[regno], 0);
   if (errno != 0)
     error (_("Couldn't read register %s (#%d): %s."), 
-	   gdbarch_register_name (get_regcache_arch (regcache), regno),
+	   gdbarch_register_name (regcache->arch (), regno),
 	   regno, safe_strerror (errno));
 
   regcache_raw_supply (regcache, regno, &val);
@@ -138,7 +138,7 @@ store_register (const struct regcache *regcache, int regno)
 	  i386_linux_gregset_reg_offset[regno], val);
   if (errno != 0)
     error (_("Couldn't write register %s (#%d): %s."),
-	   gdbarch_register_name (get_regcache_arch (regcache), regno),
+	   gdbarch_register_name (regcache->arch (), regno),
 	   regno, safe_strerror (errno));
 }
 
@@ -160,7 +160,7 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 			 regp + i386_linux_gregset_reg_offset[i]);
 
   if (I386_LINUX_ORIG_EAX_REGNUM
-	< gdbarch_num_regs (get_regcache_arch (regcache)))
+	< gdbarch_num_regs (regcache->arch ()))
     regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
 			 + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
@@ -183,7 +183,7 @@ fill_gregset (const struct regcache *regcache,
 
   if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
       && I386_LINUX_ORIG_EAX_REGNUM
-	   < gdbarch_num_regs (get_regcache_arch (regcache)))
+	   < gdbarch_num_regs (regcache->arch ()))
     regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
 			  + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
@@ -458,7 +458,7 @@ i386_linux_fetch_inferior_registers (struct target_ops *ops,
     {
       int i;
 
-      for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
+      for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
 	if (regno == -1 || regno == i)
 	  fetch_register (regcache, i);
 
@@ -536,7 +536,7 @@ i386_linux_store_inferior_registers (struct target_ops *ops,
     {
       int i;
 
-      for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
+      for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
 	if (regno == -1 || regno == i)
 	  store_register (regcache, i);
 
@@ -650,7 +650,7 @@ i386_linux_resume (struct target_ops *ops,
   if (step)
     {
       struct regcache *regcache = get_thread_regcache (ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       ULONGEST pc;
       gdb_byte buf[LINUX_SYSCALL_LEN];
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 84d4435..2485a13 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -537,7 +537,7 @@ i386_linux_record_signal (struct gdbarch *gdbarch,
 static LONGEST
 i386_linux_get_syscall_number_from_regcache (struct regcache *regcache)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   /* The content of a register.  */
   gdb_byte buf[4];
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index 5f0b886..f9cab3f 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -76,7 +76,7 @@ nto_reg_offset (int regnum)
 static void
 i386nto_supply_gregset (struct regcache *regcache, char *gpregs)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   gdb_assert (tdep->gregset_reg_offset == i386nto_gregset_reg_offset);
diff --git a/gdb/i386-obsd-nat.c b/gdb/i386-obsd-nat.c
index 76079af..f3a68de 100644
--- a/gdb/i386-obsd-nat.c
+++ b/gdb/i386-obsd-nat.c
@@ -34,7 +34,7 @@
 static int
 i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct switchframe sf;
 
diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c
index 5dfda15..b9c5738 100644
--- a/gdb/i386-obsd-tdep.c
+++ b/gdb/i386-obsd-tdep.c
@@ -190,7 +190,7 @@ static void
 i386obsd_supply_uthread (struct regcache *regcache,
 			 int regnum, CORE_ADDR addr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR sp_addr = addr + I386OBSD_UTHREAD_ESP_OFFSET;
   CORE_ADDR sp = 0;
@@ -234,7 +234,7 @@ static void
 i386obsd_collect_uthread (const struct regcache *regcache,
 			  int regnum, CORE_ADDR addr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR sp_addr = addr + I386OBSD_UTHREAD_ESP_OFFSET;
   CORE_ADDR sp = 0;
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 26628ee..e412150 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3250,7 +3250,7 @@ i386_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
 static int
 i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   int mmxreg, fpreg;
   ULONGEST fstat;
   int tos;
@@ -3839,7 +3839,7 @@ void
 i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
 		     int regnum, const void *gregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const gdb_byte *regs = (const gdb_byte *) gregs;
   int i;
@@ -3864,7 +3864,7 @@ i386_collect_gregset (const struct regset *regset,
 		      const struct regcache *regcache,
 		      int regnum, void *gregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte *regs = (gdb_byte *) gregs;
   int i;
@@ -3887,7 +3887,7 @@ static void
 i386_supply_fpregset (const struct regset *regset, struct regcache *regcache,
 		      int regnum, const void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (len == I387_SIZEOF_FXSAVE)
@@ -3910,7 +3910,7 @@ i386_collect_fpregset (const struct regset *regset,
 		       const struct regcache *regcache,
 		       int regnum, void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (len == I387_SIZEOF_FXSAVE)
@@ -8742,7 +8742,7 @@ i386_mpx_bd_base (void)
   enum register_status regstatus;
 
   rcache = get_current_regcache ();
-  tdep = gdbarch_tdep (get_regcache_arch (rcache));
+  tdep = gdbarch_tdep (rcache->arch ());
 
   regstatus = regcache_raw_read_unsigned (rcache, tdep->bndcfgu_regnum, &ret);
 
diff --git a/gdb/i386-v4-nat.c b/gdb/i386-v4-nat.c
index ac2d9cd..de9d241 100644
--- a/gdb/i386-v4-nat.c
+++ b/gdb/i386-v4-nat.c
@@ -136,7 +136,7 @@ fill_gregset (const struct regcache *regcache,
 void
 supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
-  if (gdbarch_fp0_regnum (get_regcache_arch (regcache)) == 0)
+  if (gdbarch_fp0_regnum (regcache->arch ()) == 0)
     return;
 
   i387_supply_fsave (regcache, -1, fpregsetp);
@@ -150,7 +150,7 @@ void
 fill_fpregset (const struct regcache *regcache,
 	       fpregset_t *fpregsetp, int regno)
 {
-  if (gdbarch_fp0_regnum (get_regcache_arch (regcache)) == 0)
+  if (gdbarch_fp0_regnum (regcache->arch ()) == 0)
     return;
 
   i387_collect_fsave (regcache, regno, fpregsetp);
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 85c969a..cfacced 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -438,7 +438,7 @@ static int fsave_offset[] =
 void
 i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   const gdb_byte *regs = (const gdb_byte *) fsave;
@@ -493,7 +493,7 @@ i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
 void
 i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   gdb_byte *regs = (gdb_byte *) fsave;
   int i;
 
@@ -586,7 +586,7 @@ static int i387_tag (const gdb_byte *raw);
 void
 i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   const gdb_byte *regs = (const gdb_byte *) fxsave;
   int i;
 
@@ -669,7 +669,7 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
 void
 i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   gdb_byte *regs = (gdb_byte *) fxsave;
   int i;
 
@@ -899,7 +899,7 @@ void
 i387_supply_xsave (struct regcache *regcache, int regnum,
 		   const void *xsave)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const gdb_byte *regs = (const gdb_byte *) xsave;
   int i;
@@ -1307,7 +1307,7 @@ void
 i387_collect_xsave (const struct regcache *regcache, int regnum,
 		    void *xsave, int gcore)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte *regs = (gdb_byte *) xsave;
   int i;
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 14b6843..277e7cb 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -694,7 +694,7 @@ ia64_linux_can_use_hw_breakpoint (struct target_ops *self,
 static void
 ia64_linux_fetch_register (struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
@@ -771,7 +771,7 @@ ia64_linux_fetch_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-	 regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+	 regnum < gdbarch_num_regs (regcache->arch ());
 	 regnum++)
       ia64_linux_fetch_register (regcache, regnum);
   else
@@ -783,7 +783,7 @@ ia64_linux_fetch_registers (struct target_ops *ops,
 static void
 ia64_linux_store_register (const struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
@@ -826,7 +826,7 @@ ia64_linux_store_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-	 regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+	 regnum < gdbarch_num_regs (regcache->arch ());
 	 regnum++)
       ia64_linux_store_register (regcache, regnum);
   else
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 222bb33..7007560 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -2553,7 +2553,7 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum,
   int regnum = ia64_uw2gdb_regnum (uw_regnum);
   unw_word_t bsp, sof, cfm, psr, ip;
   struct regcache *regcache = (struct regcache *) arg;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   long new_sof, old_sof;
   
@@ -3195,7 +3195,7 @@ static void
 ia64_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct type *float_elt_type;
 
   float_elt_type = is_float_or_hfa_type (type);
@@ -3260,7 +3260,7 @@ static void
 ia64_store_return_value (struct type *type, struct regcache *regcache, 
 			 const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct type *float_elt_type;
 
   float_elt_type = is_float_or_hfa_type (type);
@@ -3560,7 +3560,7 @@ find_extant_func_descr (struct gdbarch *gdbarch, CORE_ADDR faddr)
 static CORE_ADDR
 find_func_descr (struct regcache *regcache, CORE_ADDR faddr, CORE_ADDR *fdaptr)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR fdesc;
 
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index b04b52e..a712613 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -77,7 +77,7 @@ inf_child_fetch_inferior_registers (struct target_ops *ops,
   if (regnum == -1)
     {
       for (regnum = 0;
-	   regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+	   regnum < gdbarch_num_regs (regcache->arch ());
 	   regnum++)
 	regcache_raw_supply (regcache, regnum, NULL);
     }
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index af181f0..e127741 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -713,7 +713,7 @@ static CORE_ADDR (*inf_ptrace_register_u_offset)(struct gdbarch *, int, int);
 static void
 inf_ptrace_fetch_register (struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
@@ -759,7 +759,7 @@ inf_ptrace_fetch_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-	 regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+	 regnum < gdbarch_num_regs (regcache->arch ());
 	 regnum++)
       inf_ptrace_fetch_register (regcache, regnum);
   else
@@ -771,7 +771,7 @@ inf_ptrace_fetch_registers (struct target_ops *ops,
 static void
 inf_ptrace_store_register (const struct regcache *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
@@ -814,7 +814,7 @@ inf_ptrace_store_registers (struct target_ops *ops,
 {
   if (regnum == -1)
     for (regnum = 0;
-	 regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+	 regnum < gdbarch_num_regs (regcache->arch ());
 	 regnum++)
       inf_ptrace_store_register (regcache, regnum);
   else
diff --git a/gdb/infrun.c b/gdb/infrun.c
index c58ceb6..858ffa1 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1690,7 +1690,7 @@ static int
 use_displaced_stepping (struct thread_info *tp)
 {
   struct regcache *regcache = get_thread_regcache (tp->ptid);
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct displaced_step_inferior_state *displaced_state;
 
   displaced_state = get_displaced_stepping_state (ptid_get_pid (tp->ptid));
@@ -1759,7 +1759,7 @@ displaced_step_prepare_throw (ptid_t ptid)
   struct cleanup *ignore_cleanups;
   struct thread_info *tp = find_thread_ptid (ptid);
   struct regcache *regcache = get_thread_regcache (ptid);
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct address_space *aspace = get_regcache_aspace (regcache);
   CORE_ADDR original, copy;
   ULONGEST len;
@@ -2385,7 +2385,7 @@ resume (enum gdb_signal sig)
 {
   struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
   struct regcache *regcache = get_current_regcache ();
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct thread_info *tp = inferior_thread ();
   CORE_ADDR pc = regcache_read_pc (regcache);
   struct address_space *aspace = get_regcache_aspace (regcache);
@@ -2736,7 +2736,7 @@ resume (enum gdb_signal sig)
       && !step_over_info_valid_p ())
     {
       struct regcache *resume_regcache = get_thread_regcache (tp->ptid);
-      struct gdbarch *resume_gdbarch = get_regcache_arch (resume_regcache);
+      struct gdbarch *resume_gdbarch = resume_regcache->arch ();
       CORE_ADDR actual_pc = regcache_read_pc (resume_regcache);
       gdb_byte buf[4];
 
@@ -3006,7 +3006,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
   previous_inferior_ptid = inferior_ptid;
 
   regcache = get_current_regcache ();
-  gdbarch = get_regcache_arch (regcache);
+  gdbarch = regcache->arch ();
   aspace = get_regcache_aspace (regcache);
   pc = regcache_read_pc (regcache);
   tp = inferior_thread ();
@@ -3519,7 +3519,7 @@ do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 	  || tp->suspend.stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT))
     {
       struct regcache *regcache = get_thread_regcache (tp->ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
       CORE_ADDR pc;
       int discard = 0;
 
@@ -3582,7 +3582,7 @@ do_target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 	  int decr_pc;
 
 	  regcache = get_thread_regcache (tp->ptid);
-	  gdbarch = get_regcache_arch (regcache);
+	  gdbarch = regcache->arch ();
 
 	  decr_pc = gdbarch_decr_pc_after_break (gdbarch);
 	  if (decr_pc != 0)
@@ -4144,7 +4144,7 @@ adjust_pc_after_break (struct thread_info *thread,
   /* If this target does not decrement the PC after breakpoints, then
      we have nothing to do.  */
   regcache = get_thread_regcache (thread->ptid);
-  gdbarch = get_regcache_arch (regcache);
+  gdbarch = regcache->arch ();
 
   decr_pc = gdbarch_decr_pc_after_break (gdbarch);
   if (decr_pc == 0)
@@ -5077,7 +5077,7 @@ handle_inferior_event_1 (struct execution_control_state *ecs)
       else
 	{
 	  struct regcache *regcache = get_thread_regcache (ecs->ptid);
-	  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+	  struct gdbarch *gdbarch = regcache->arch ();
 
 	  if (gdbarch_gdb_signal_to_target_p (gdbarch))
 	    {
@@ -5125,7 +5125,7 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
       /* Check whether the inferior is displaced stepping.  */
       {
 	struct regcache *regcache = get_thread_regcache (ecs->ptid);
-	struct gdbarch *gdbarch = get_regcache_arch (regcache);
+	struct gdbarch *gdbarch = regcache->arch ();
 
 	/* If checking displaced stepping is supported, and thread
 	   ecs->ptid is displaced stepping.  */
@@ -5687,7 +5687,7 @@ handle_signal_stop (struct execution_control_state *ecs)
   if (debug_infrun)
     {
       struct regcache *regcache = get_thread_regcache (ecs->ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
       scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
 
       inferior_ptid = ecs->ptid;
@@ -7922,7 +7922,7 @@ static void
 handle_segmentation_fault (struct ui_out *uiout)
 {
   struct regcache *regcache = get_current_regcache ();
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   if (gdbarch_handle_segmentation_fault_p (gdbarch))
     gdbarch_handle_segmentation_fault (gdbarch, uiout);
@@ -8831,7 +8831,7 @@ save_infcall_suspend_state (void)
   struct infcall_suspend_state *inf_state;
   struct thread_info *tp = inferior_thread ();
   struct regcache *regcache = get_current_regcache ();
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   gdb_byte *siginfo_data = NULL;
 
   if (gdbarch_get_siginfo_type_p (gdbarch))
@@ -8882,7 +8882,7 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state)
 {
   struct thread_info *tp = inferior_thread ();
   struct regcache *regcache = get_current_regcache ();
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
 
   tp->suspend = inf_state->thread_suspend;
 
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index deafaaa..e47cc06 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -539,7 +539,7 @@ static void
 iq2000_extract_return_value (struct type *type, struct regcache *regcache,
 			     gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   /* If the function's return value is 8 bytes or less, it is
diff --git a/gdb/jit.c b/gdb/jit.c
index 556bcb6..a2d1f6d 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1270,7 +1270,7 @@ jit_frame_prev_register (struct frame_info *this_frame, void **cache, int reg)
   if (priv == NULL)
     return frame_unwind_got_optimized (this_frame, reg);
 
-  gdbarch = get_regcache_arch (priv->regcache);
+  gdbarch = priv->regcache->arch ();
   if (reg < gdbarch_num_regs (gdbarch))
     {
       gdb_byte *buf = (gdb_byte *) alloca (register_size (gdbarch, reg));
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index c89303c..5d8f9f3 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2750,7 +2750,7 @@ save_stop_reason (struct lwp_info *lp)
     return;
 
   regcache = get_thread_regcache (lp->ptid);
-  gdbarch = get_regcache_arch (regcache);
+  gdbarch = regcache->arch ();
 
   pc = regcache_read_pc (regcache);
   sw_bp_pc = pc - gdbarch_decr_pc_after_break (gdbarch);
@@ -3460,7 +3460,7 @@ linux_nat_wait_1 (struct target_ops *ops,
       && !USE_SIGTRAP_SIGINFO)
     {
       struct regcache *regcache = get_thread_regcache (lp->ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
       int decr_pc = gdbarch_decr_pc_after_break (gdbarch);
 
       if (decr_pc != 0)
@@ -3563,7 +3563,7 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
   else
     {
       struct regcache *regcache = get_thread_regcache (lp->ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
+      struct gdbarch *gdbarch = regcache->arch ();
 
       TRY
 	{
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 59fb337..15a0d9f 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -83,7 +83,7 @@
 #define RECORD_Q_XGETQUOTA	(('3' << 8) + 3)
 
 #define OUTPUT_REG(val, num)      phex_nz ((val), \
-    TYPE_LENGTH (gdbarch_register_type (get_regcache_arch (regcache), (num))))
+    TYPE_LENGTH (gdbarch_register_type (regcache->arch (), (num))))
 
 /* Record a memory area of length LEN pointed to by register
    REGNUM.  */
@@ -104,7 +104,7 @@ record_linux_sockaddr (struct regcache *regcache,
 {
   gdb_byte *a;
   int addrlen;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
   if (!addr)
@@ -141,7 +141,7 @@ record_linux_msghdr (struct regcache *regcache,
 		     struct linux_record_tdep *tdep, ULONGEST addr)
 {
   gdb_byte *a;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR tmpaddr;
   int tmpint;
@@ -242,7 +242,7 @@ record_linux_system_call (enum gdb_syscall syscall,
 			  struct regcache *regcache,
 			  struct linux_record_tdep *tdep)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST tmpulongest;
   CORE_ADDR tmpaddr;
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 459386f..83ff59f 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1618,7 +1618,7 @@ linux_collect_thread_registers (const struct regcache *regcache,
 				char *note_data, int *note_size,
 				enum gdb_signal stop_signal)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct linux_collect_regset_section_cb_data data;
 
   data.gdbarch = gdbarch;
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 24bc5c2..42dbb92 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -303,7 +303,7 @@ static void
 lm32_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST l;
   CORE_ADDR return_buffer;
@@ -340,7 +340,7 @@ static void
 lm32_store_return_value (struct type *type, struct regcache *regcache,
 			 const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST val;
   int len = TYPE_LENGTH (type);
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 39f9ec0..8f40777 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -331,7 +331,7 @@ m32c_raw_write (struct m32c_reg *reg, struct regcache *cache,
 static int
 m32c_read_flg (struct regcache *cache)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (cache));
+  struct gdbarch_tdep *tdep = gdbarch_tdep (cache->arch ());
   ULONGEST flg;
   regcache_raw_read_unsigned (cache, tdep->flg->num, &flg);
   return flg & 0xffff;
@@ -598,7 +598,7 @@ m32c_pseudo_register_read (struct gdbarch *arch,
   struct m32c_reg *reg;
 
   gdb_assert (0 <= cookednum && cookednum < tdep->num_regs);
-  gdb_assert (arch == get_regcache_arch (cache));
+  gdb_assert (arch == cache->arch ());
   gdb_assert (arch == tdep->regs[cookednum].arch);
   reg = &tdep->regs[cookednum];
 
@@ -616,7 +616,7 @@ m32c_pseudo_register_write (struct gdbarch *arch,
   struct m32c_reg *reg;
 
   gdb_assert (0 <= cookednum && cookednum < tdep->num_regs);
-  gdb_assert (arch == get_regcache_arch (cache));
+  gdb_assert (arch == cache->arch ());
   gdb_assert (arch == tdep->regs[cookednum].arch);
   reg = &tdep->regs[cookednum];
 
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index c61f2e3..af0f863 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -353,7 +353,7 @@ m32r_linux_supply_gregset (const struct regset *regset,
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
   enum bfd_endian byte_order =
-    gdbarch_byte_order (get_regcache_arch (regcache));
+    gdbarch_byte_order (regcache->arch ());
   ULONGEST psw, bbpsw;
   gdb_byte buf[4];
   const gdb_byte *p;
@@ -397,7 +397,7 @@ m32r_linux_collect_gregset (const struct regset *regset,
   gdb_byte *regs = (gdb_byte *) gregs;
   int i;
   enum bfd_endian byte_order =
-    gdbarch_byte_order (get_regcache_arch (regcache));
+    gdbarch_byte_order (regcache->arch ());
   ULONGEST psw;
   gdb_byte buf[4];
 
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index d40c390..c00455b 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -245,7 +245,7 @@ static void
 m32r_store_return_value (struct type *type, struct regcache *regcache,
 			 const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR regval;
   int len = TYPE_LENGTH (type);
@@ -770,7 +770,7 @@ static void
 m32r_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *dst)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
   ULONGEST tmp;
diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c
index bdd00b9..c890970 100644
--- a/gdb/m68k-bsd-nat.c
+++ b/gdb/m68k-bsd-nat.c
@@ -58,7 +58,7 @@ m68kbsd_supply_gregset (struct regcache *regcache, const void *gregs)
 static void
 m68kbsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const char *regs = fpregs;
   int regnum;
 
@@ -91,7 +91,7 @@ static void
 m68kbsd_collect_fpregset (struct regcache *regcache,
 			  void *fpregs, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   char *regs = fpregs;
   int i;
 
diff --git a/gdb/m68k-bsd-tdep.c b/gdb/m68k-bsd-tdep.c
index 6b7cb3c..665d33c 100644
--- a/gdb/m68k-bsd-tdep.c
+++ b/gdb/m68k-bsd-tdep.c
@@ -58,7 +58,7 @@ m68kbsd_supply_fpregset (const struct regset *regset,
 			 struct regcache *regcache,
 			 int regnum, const void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const gdb_byte *regs = (const gdb_byte *) fpregs;
   int i;
 
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 0915cbe..4a05bf1 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -104,7 +104,7 @@ static int have_ptrace_getregs =
 static void
 fetch_register (struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   long regaddr, val;
   int i;
   gdb_byte buf[M68K_MAX_REGISTER_SIZE];
@@ -139,7 +139,7 @@ old_fetch_inferior_registers (struct regcache *regcache, int regno)
   else
     {
       for (regno = 0;
-	   regno < gdbarch_num_regs (get_regcache_arch (regcache));
+	   regno < gdbarch_num_regs (regcache->arch ());
 	   regno++)
 	{
 	  fetch_register (regcache, regno);
@@ -152,7 +152,7 @@ old_fetch_inferior_registers (struct regcache *regcache, int regno)
 static void
 store_register (const struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   long regaddr, val;
   int i;
   gdb_byte buf[M68K_MAX_REGISTER_SIZE];
@@ -191,7 +191,7 @@ old_store_inferior_registers (const struct regcache *regcache, int regno)
   else
     {
       for (regno = 0;
-	   regno < gdbarch_num_regs (get_regcache_arch (regcache));
+	   regno < gdbarch_num_regs (regcache->arch ());
 	   regno++)
 	{
 	  store_register (regcache, regno);
@@ -206,7 +206,7 @@ old_store_inferior_registers (const struct regcache *regcache, int regno)
 void
 supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
   int regi;
 
@@ -302,7 +302,7 @@ static void store_regs (const struct regcache *regcache, int tid, int regno)
 void
 supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int regi;
 
   for (regi = gdbarch_fp0_regnum (gdbarch);
@@ -323,7 +323,7 @@ void
 fill_fpregset (const struct regcache *regcache,
 	       elf_fpregset_t *fpregsetp, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int i;
 
   /* Fill in the floating-point registers.  */
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 37df9d5..274ba61 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -304,7 +304,7 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
 				gdb_byte *valbuf)
 {
   gdb_byte buf[M68K_MAX_REGISTER_SIZE];
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -344,7 +344,7 @@ static void
 m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
 			      const gdb_byte *valbuf)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index 9f1688a..6be27a9 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -252,7 +252,7 @@ static CORE_ADDR
 m88k_store_arguments (struct regcache *regcache, int nargs,
 		      struct value **args, CORE_ADDR sp)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int num_register_words = 0;
   int num_stack_words = 0;
   int i;
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 3caf904..480d2fd 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1006,7 +1006,7 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc)
      will change depending upon the particular processor being
      debugged.  */
 
-  gdbarch = get_regcache_arch (this_regs.get ());
+  gdbarch = this_regs->arch ();
   numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 
   ui_out_emit_list list_emitter (uiout, "changed-registers");
@@ -1058,13 +1058,13 @@ static int
 register_changed_p (int regnum, struct regcache *prev_regs,
 		    struct regcache *this_regs)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (this_regs);
+  struct gdbarch *gdbarch = this_regs->arch ();
   struct value *prev_value, *this_value;
   int ret;
 
   /* First time through or after gdbarch change consider all registers
      as changed.  */
-  if (!prev_regs || get_regcache_arch (prev_regs) != gdbarch)
+  if (!prev_regs || prev_regs->arch () != gdbarch)
     return 1;
 
   /* Get register contents and compare.  */
@@ -1231,7 +1231,7 @@ mi_cmd_data_write_register_values (const char *command, char **argv, int argc)
      debugged.  */
 
   regcache = get_current_regcache ();
-  gdbarch = get_regcache_arch (regcache);
+  gdbarch = regcache->arch ();
   numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 
   if (argc == 0)
diff --git a/gdb/mips-fbsd-nat.c b/gdb/mips-fbsd-nat.c
index f86d447..c296f05 100644
--- a/gdb/mips-fbsd-nat.c
+++ b/gdb/mips-fbsd-nat.c
@@ -58,7 +58,7 @@ mips_fbsd_fetch_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
@@ -90,7 +90,7 @@ mips_fbsd_store_inferior_registers (struct target_ops *ops,
 {
   pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
     {
       struct reg regs;
diff --git a/gdb/mips-fbsd-tdep.c b/gdb/mips-fbsd-tdep.c
index b1578d0..b6b47ee 100644
--- a/gdb/mips-fbsd-tdep.c
+++ b/gdb/mips-fbsd-tdep.c
@@ -71,7 +71,7 @@ void
 mips_fbsd_supply_fpregs (struct regcache *regcache, int regnum,
 			 const void *fpregs, size_t regsize)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const gdb_byte *regs = (const gdb_byte *) fpregs;
   int i, fp0num;
 
@@ -100,7 +100,7 @@ void
 mips_fbsd_supply_gregs (struct regcache *regcache, int regnum,
 			const void *gregs, size_t regsize)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   const gdb_byte *regs = (const gdb_byte *) gregs;
   int i;
 
@@ -117,7 +117,7 @@ void
 mips_fbsd_collect_fpregs (const struct regcache *regcache, int regnum,
 			  void *fpregs, size_t regsize)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   gdb_byte *regs = (gdb_byte *) fpregs;
   int i, fp0num;
 
@@ -144,7 +144,7 @@ void
 mips_fbsd_collect_gregs (const struct regcache *regcache, int regnum,
 			 void *gregs, size_t regsize)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   gdb_byte *regs = (gdb_byte *) gregs;
   int i;
 
@@ -162,7 +162,7 @@ mips_fbsd_supply_fpregset (const struct regset *regset,
 			   struct regcache *regcache,
 			   int regnum, const void *fpregs, size_t len)
 {
-  size_t regsize = mips_abi_regsize (get_regcache_arch (regcache));
+  size_t regsize = mips_abi_regsize (regcache->arch ());
 
   gdb_assert (len >= MIPS_FBSD_NUM_FPREGS * regsize);
 
@@ -179,7 +179,7 @@ mips_fbsd_collect_fpregset (const struct regset *regset,
 			    const struct regcache *regcache,
 			    int regnum, void *fpregs, size_t len)
 {
-  size_t regsize = mips_abi_regsize (get_regcache_arch (regcache));
+  size_t regsize = mips_abi_regsize (regcache->arch ());
 
   gdb_assert (len >= MIPS_FBSD_NUM_FPREGS * regsize);
 
@@ -195,7 +195,7 @@ mips_fbsd_supply_gregset (const struct regset *regset,
 			  struct regcache *regcache, int regnum,
 			  const void *gregs, size_t len)
 {
-  size_t regsize = mips_abi_regsize (get_regcache_arch (regcache));
+  size_t regsize = mips_abi_regsize (regcache->arch ());
 
   gdb_assert (len >= MIPS_FBSD_NUM_GREGS * regsize);
 
@@ -212,7 +212,7 @@ mips_fbsd_collect_gregset (const struct regset *regset,
 			   const struct regcache *regcache,
 			   int regnum, void *gregs, size_t len)
 {
-  size_t regsize = mips_abi_regsize (get_regcache_arch (regcache));
+  size_t regsize = mips_abi_regsize (regcache->arch ());
 
   gdb_assert (len >= MIPS_FBSD_NUM_GREGS * regsize);
 
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index a86963d..e6ef5a6 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -167,7 +167,7 @@ ps_get_thread_area (struct ps_prochandle *ph,
 void
 supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
-  if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
+  if (mips_isa_regsize (regcache->arch ()) == 4)
     mips_supply_gregset (regcache, (const mips_elf_gregset_t *) gregsetp);
   else
     mips64_supply_gregset (regcache, (const mips64_elf_gregset_t *) gregsetp);
@@ -177,7 +177,7 @@ void
 fill_gregset (const struct regcache *regcache,
 	      gdb_gregset_t *gregsetp, int regno)
 {
-  if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
+  if (mips_isa_regsize (regcache->arch ()) == 4)
     mips_fill_gregset (regcache, (mips_elf_gregset_t *) gregsetp, regno);
   else
     mips64_fill_gregset (regcache, (mips64_elf_gregset_t *) gregsetp, regno);
@@ -186,7 +186,7 @@ fill_gregset (const struct regcache *regcache,
 void
 supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
-  if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
+  if (mips_isa_regsize (regcache->arch ()) == 4)
     mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *) fpregsetp);
   else
     mips64_supply_fpregset (regcache,
@@ -197,7 +197,7 @@ void
 fill_fpregset (const struct regcache *regcache,
 	       gdb_fpregset_t *fpregsetp, int regno)
 {
-  if (mips_isa_regsize (get_regcache_arch (regcache)) == 4)
+  if (mips_isa_regsize (regcache->arch ()) == 4)
     mips_fill_fpregset (regcache, (mips_elf_fpregset_t *) fpregsetp, regno);
   else
     mips64_fill_fpregset (regcache,
@@ -212,7 +212,7 @@ static void
 mips64_linux_regsets_fetch_registers (struct target_ops *ops,
 				      struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int is_fp, is_dsp;
   int have_dsp;
   int regi;
@@ -298,7 +298,7 @@ static void
 mips64_linux_regsets_store_registers (struct target_ops *ops,
 				      struct regcache *regcache, int regno)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   int is_fp, is_ds[...]

[diff truncated at 100000 bytes]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]