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

Simon Marchi simark@simark.ca
Thu Dec 21 21:26:55 GMT 2023


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



More information about the Gdb-patches mailing list