Class-fy regcache
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)
commitef79d9a3c6ed1e3ccd466bae76956019a7c5d376
treeec81a8a4cd56450f3797bd60cd36303fe8cd291f
parentf8fdb78eafb3f70661f6e4a43beb004dde9e0921
Class-fy regcache

This patch moves regcache declaration to regcache.h, and converts
regcache apis to member functions, for example, regcache_invalidate
is changed to regcache::invalidate.

This patch also add "m_" prefix to these private fields.

gdb:

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

* regcache.c (struct regcache): Move to regcache.h
(regcache::arch): New method.
(regcache_get_ptid): Update.
(get_regcache_arch): Call arch method.
(get_regcache_aspace): Call method aspace.
(register_buffer): Change it to method.
(regcache_save): Change it to regcache::save.
(regcache_restore): Likewise.
(regcache_cpy_no_passthrough): Remove the declaration.
(regcache_cpy): Call methods restore and cpy_no_passthrough.
(regcache_cpy_no_passthrough): Change it to method
cpy_no_passthrough.
(regcache_register_status): Change it to method
get_register_status.
(regcache_invalidate): Change it to method invalidate.
(regcache_thread_ptid_changed): Use methods ptid and set_ptid.
(regcache_raw_update): Change it to method raw_update.
(regcache_raw_read): Likewise.
(regcache_raw_read_signed): Likewise.
(regcache_raw_read_unsigned): Likewise.
(regcache_raw_write_signed): Likewise.
(regcache_raw_write_unsigned): Likewise.
(regcache_cooked_read): Likewise.
(regcache_cooked_read_value): Likewise.
(regcache_cooked_read_signed): Likewise.
(regcache_cooked_read_unsigned): Likewise.
(regcache_cooked_write_signed): Likewise.
(regcache_cooked_write_unsigned): Likewise.
(regcache_raw_set_cached_value): Likewise.
(regcache_raw_write): Likewise.
(regcache_cooked_write): Likewise.
(regcache_xfer_part): Likewise.
(regcache_raw_read_part): Likewise.
(regcache_raw_write_part): Likewise.
(regcache_cooked_read_part): Likewise.
(regcache_cooked_write_part): Likewise.
(regcache_raw_supply): Likewise.
(regcache_raw_collect): Likewise.
(regcache_transfer_regset): Likewise.
(regcache_supply_regset): Likewise.
(regcache_collect_regset): Likewise.
(regcache_debug_print_register): Likewise.
(enum regcache_dump_what): Move it to regcache.h.
(regcache_dump): Change it to method dump.
* regcache.h (enum regcache_dump_what): New.
(class regcache): New.
* target.c (target_fetch_registers): Call method
debug_print_register.
(target_store_registers): Likewise.
gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h
gdb/target.c