Add reg_buffer_common
authorAlan Hayward <alan.hayward@arm.com>
Mon, 11 Jun 2018 09:09:16 +0000 (10:09 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Mon, 11 Jun 2018 09:09:16 +0000 (10:09 +0100)
commit9c861883169cb9eec4581ab6db3a1b711e79ee10
tree24530802092757d9aaf0e0f93e0e7cae3507aa8d
parent953edf2b6cfe765ca7176c414e9f63aa62bdb09c
Add reg_buffer_common

A purely virtual class containing functions from gdb/regcache.h

Both the gdb regcache structures and gdbserver regcache inherit
directly from reg_buffer_common. This will allow for common
functions which require the use of a regcache.

gdb/
* common/common-regcache.h (reg_buffer_common): New structure.
* regcache.c (reg_buffer::invalidate): Move from detached_regcache.
(reg_buffer::raw_supply): Likewise.
(reg_buffer::raw_supply_integer): Likewise.
(reg_buffer::raw_supply_zeroed): Likewise.
(reg_buffer::raw_collect): Likewise.
(reg_buffer::raw_collect_integer): Likewise.
* regcache.h (reg_buffer::invalidate): Move from detached_regcache.
(reg_buffer::raw_supply): Likewise.
(reg_buffer::raw_supply_integer): Likewise.
(reg_buffer::raw_supply_zeroed): Likewise.
(reg_buffer::raw_collect): Likewise.
(reg_buffer::raw_collect_integer): Likewise.

gdbserver/
* regcache.c (new_register_cache): Use new.
(free_register_cache): Use delete.
(register_data): Use const.
(supply_register): Move body inside regcache.
(regcache::raw_supply): New override function.
(collect_register): Move body inside regcache.
(regcache::raw_collect): New override function.
(regcache::get_register_status): New override function.
* regcache.h (struct regcache): Inherit from reg_buffer_common.
gdb/ChangeLog
gdb/common/common-regcache.h
gdb/gdbserver/ChangeLog
gdb/gdbserver/regcache.c
gdb/gdbserver/regcache.h
gdb/regcache.c
gdb/regcache.h