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

Tankut Baris Aktemur via Gdb-patches
2023-02-28T11:31:53Z

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
--
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva