[PUSHED 8/8] gdbserver: return tracked register status in regcache_raw_read_unsigned

Tankut Baris Aktemur
2024-12-17T08:24:22Z

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.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
gdbserver/regcache.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
index dad0907291b..5b064ae04d1 100644
--- a/gdbserver/regcache.cc
+++ b/gdbserver/regcache.cc
@@ -474,7 +474,7 @@ regcache_raw_read_unsigned (reg_buffer_common *reg_buf, int regnum,
*val = 0;
collect_register (regcache, regnum, val);

- return REG_VALID;
+ return regcache->get_register_status (regnum);
}

#ifndef IN_PROCESS_AGENT
--
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva