]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add methods to gdbserver regcache and raw_compare
authorAlan Hayward <alan.hayward@arm.com>
Fri, 11 May 2018 10:52:55 +0000 (11:52 +0100)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 1 Jun 2018 04:34:18 +0000 (00:34 -0400)
commitd56bdeb9c2e434b91d5e6d605b92bb1cd21177e5
tree4db3b8434c7fdb2bfdfa6dd72fe06f45d5e7edff
parent6a229058a5443befdb7b614f164b997525d25c2d
Add methods to gdbserver regcache and raw_compare

Add additional functions to gdbserver regcache to make it more like gdb
regcache. This will allow the next patch to add a common function which
uses regcache.
The alternatives for the next patch would be to either duplicate the
common code in both gdb and gdbserver, or alternatively pass function
pointers for read register, write register, get status to the common code.

In addition, add a register compare function. This will be used in the
next patch. Alternatively instead of adding a new function, I could read
into a buffer and then compare.

2018-05-11  Alan Hayward  <alan.hayward@arm.com>

gdb/
* regcache.c (regcache::raw_compare): New function.
* regcache.h (regcache::raw_compare): New declaration.

gdbserver/
* regcache.c (register_data): New function.
(supply_register): Call member function.
(regcache::raw_supply): Replacement for supply_register.
(collect_register): Call member function.
(regcache::raw_collect): Replacement for collect_register.
(regcache::get_register_status): New function.
(regcache::raw_compare): Likewise.
* regcache.h: (regcache::raw_supply): New declaration.
* (regcache::raw_collect): Likewise.
* (regcache::raw_compare): Likewise.
* (regcache::get_register_status): Likewise.
gdb/gdbserver/regcache.c
gdb/gdbserver/regcache.h
gdb/regcache.c
gdb/regcache.h