diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -798,6 +798,11 @@ if (!reg_info) return; + // When vg is written it is automatically made invalid. Writing vg will also + // change svg if we're in streaming mode, so we must fetch the latest value + // from the remote. + SetRegisterIsValid(reg_info, false); + uint64_t fail_value = LLDB_INVALID_ADDRESS; uint32_t svg_reg_num = reg_info->kinds[eRegisterKindLLDB]; uint64_t svg_reg_value = ReadRegisterAsUnsigned(svg_reg_num, fail_value); diff --git a/lldb/test/API/commands/register/register/aarch64_za_reg/za_dynamic_resize/TestZAThreadedDynamic.py b/lldb/test/API/commands/register/register/aarch64_za_reg/za_dynamic_resize/TestZAThreadedDynamic.py --- a/lldb/test/API/commands/register/register/aarch64_za_reg/za_dynamic_resize/TestZAThreadedDynamic.py +++ b/lldb/test/API/commands/register/register/aarch64_za_reg/za_dynamic_resize/TestZAThreadedDynamic.py @@ -125,11 +125,13 @@ self.runCmd("thread select %d" % (idx + 1)) self.check_za_register(4, 2) self.runCmd("register write vg 2") + self.check_disabled_za_register(2) elif stopped_at_line_number == thY_break_line1: self.runCmd("thread select %d" % (idx + 1)) self.check_za_register(2, 3) self.runCmd("register write vg 4") + self.check_disabled_za_register(4) self.runCmd("thread continue 2") self.runCmd("thread continue 3")