[PATCH 23/26] gdbserver: set register statuses in registers_from_string

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

The registers_from_string function uses hex2bin to set the values of
all registers. Set the register statuses to REG_VALID to reflect this
change.
---
gdbserver/regcache.cc | 2 ++
1 file changed, 2 insertions(+)

diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
index 644f436c681..32f0e1109e6 100644
--- a/gdbserver/regcache.cc
+++ b/gdbserver/regcache.cc
@@ -259,6 +259,8 @@ regcache::registers_from_string (const char *buf)
len = tdesc->registers_size * 2;
}
hex2bin (buf, registers, len / 2);
+ /* All register data have been re-written. Update the statuses. */
+ memset (register_status, REG_VALID, tdesc->reg_defs.size ());
}

/* See regcache.h */
--
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