Simplify regcache_dup
authorYao Qi <yao.qi@linaro.org>
Fri, 28 Apr 2017 21:48:42 +0000 (22:48 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 28 Apr 2017 21:48:42 +0000 (22:48 +0100)
commitb421c83cb866120ab347d60fda20fb0e2011be8c
tree858d03ddacad0b9a203a7a3de4f01bb450fad271
parentef79d9a3c6ed1e3ccd466bae76956019a7c5d376
Simplify regcache_dup

regcache_dup, in fact, is to create a readonly regcache from a
non-readonly regcache.  This patch adds an assert that src is not
readonly.

gdb:

2017-04-28  Yao Qi  <yao.qi@linaro.org>

* regcache.c (regcache_dup): Assert !src->m_readonly_p and
call method save instead of regcache_cpy.
* regcache.h (struct regcache): Make regcache_dup a friend.
gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h