Re: [PATCH 24/26] gdbserver: return tracked register status in regcache_raw_read_unsigned

Simon Marchi
2023-12-22T04:42:24Z

On 2023-02-28 06:28, Tankut Baris Aktemur via Gdb-patches wrote:
> In regcache_raw_read_unsigned, we unconditionally return REG_VALID as
> the register status. This does not seem right, since the register may
> in fact be in another state, such as REG_UNAVAILABLE. Return the
> tracked status.
> ---
> gdbserver/regcache.cc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
> index 32f0e1109e6..4533e9e9b12 100644
> --- a/gdbserver/regcache.cc
> +++ b/gdbserver/regcache.cc
> @@ -451,7 +451,7 @@ regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
> *val = 0;
> collect_register (regcache, regnum, val);
>
> - return REG_VALID;
> + return regcache->get_register_status (regnum);
> }
>
> #ifndef IN_PROCESS_AGENT

LGTM. You can push it right away, if you think it makes sense.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon