Remove regcache_descr::nr_raw_registers
authorYao Qi <yao.qi@linaro.org>
Thu, 2 Nov 2017 15:15:41 +0000 (15:15 +0000)
committerYao Qi <yao.qi@linaro.org>
Thu, 2 Nov 2017 15:15:41 +0000 (15:15 +0000)
commitd999647bc427ce2e083c4449b683705449d0bb58
treeee37ea0b2296eae7da25fa8d127e88978dc544fd
parent4e888c281cd19f019248bd165d7055af88641c80
Remove regcache_descr::nr_raw_registers

struct regcache_descr has fields nr_raw_registers and gdbarch, and
nr_raw_registers can be got via gdbarch_num_regs (gdbarch), so it looks
nr_raw_registers is redundant.  This patch removes it and adds a protected
method num_raw_registers.

gdb:

2017-11-02  Yao Qi  <yao.qi@linaro.org>

* regcache.c (struct regcache_descr) <nr_raw_registers>: Remove.
(init_regcache_descr): Use gdbarch_num_regs.
(regcache::regcache): Likewise.
(regcache::get_register_status): Likewise.
(regcache::assert_raw_regnum): Likewise.
(regcache::cooked_read): Likewise.
(regcache::cooked_read_value): Likewise.
(regcache::cooked_write): Likewise.
(regcache::dump): Likewise.
(regcache::num_raw_registers): New method.
* regcache.h (class regcache) <num_raw_registers>: New.
gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h