Re: [PATCH 13/26] gdbserver: convert register_data into regcache::register_data

Simon Marchi
2023-12-21T21:27:10Z

On 2/28/23 06:28, Tankut Baris Aktemur via Gdb-patches wrote:
> Convert the register_data function to a method of the regcache struct.
> ---
> gdbserver/regcache.cc | 20 ++++++++++----------
> gdbserver/regcache.h | 3 +++
> 2 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
> index 31f1e7bb3dc..79835ef4ff1 100644
> --- a/gdbserver/regcache.cc
> +++ b/gdbserver/regcache.cc
> @@ -314,11 +314,11 @@ regcache_register_size (const struct regcache *regcache, int n)
> return register_size (regcache->tdesc, n);
> }
>
> -static unsigned char *
> -register_data (const struct regcache *regcache, int n)
> +unsigned char *
> +regcache::register_data (int regnum) const

Just a note: post-rebasing, this would return a gdb::array_view<gdb_byte>.

Simon