From fc5b87361580d915e28ae5f3cc4794b75b671b5a Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 21 Feb 2018 11:20:03 +0000 Subject: Remove regcache_save and regcache_cpy ... instead we start to use regcache methods save and restore. It is quite straightforward to replace regcache_save with regcache->save. regcache_cpy has some asserts, some of them not necessary, like gdb_assert (src != dst); because we already assert !m_readonly_p and src->m_readonly_p, so src isn't dst. Some of the asserts are moved to ::restore. gdb: 2018-02-21 Yao Qi * frame.c (frame_save_as_regcache): Use regcache method save. (frame_pop): Use regcache method restore. * infrun.c (restore_infcall_suspend_state): Likewise. * linux-fork.c (fork_load_infrun_state): Likewise. * ppc-linux-tdep.c (ppu2spu_sniffer): User regcache method save. * regcache.c (regcache_save): Remove. (regcache::restore): More asserts. (regcache_cpy): Remove. * regcache.h (regcache_save): Remove the declaration. (regcache::restore): Move from private to public. Remove the friend declaration of regcache_cpy. (regcache_cpy): Remove declaration. --- gdb/linux-fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/linux-fork.c') diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 8561157d3d9..df7ea4e1710 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -261,7 +261,7 @@ fork_load_infrun_state (struct fork_info *fp) linux_nat_switch_fork (fp->ptid); if (fp->savedregs && fp->clobber_regs) - regcache_cpy (get_current_regcache (), fp->savedregs); + get_current_regcache ()->restore (fp->savedregs); registers_changed (); reinit_frame_cache (); -- cgit v1.2.1