@@ -1642,9 +1642,20 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
1642
1642
}
1643
1643
1644
1644
ThreadGDBRemote *gdb_thread = static_cast <ThreadGDBRemote *>(thread_sp.get ());
1645
- RegisterContextSP gdb_reg_ctx_sp (gdb_thread->GetRegisterContext ());
1645
+ RegisterContextSP reg_ctx_sp (gdb_thread->GetRegisterContext ());
1646
1646
1647
- gdb_reg_ctx_sp->InvalidateIfNeeded (true );
1647
+ reg_ctx_sp->InvalidateIfNeeded (true );
1648
+
1649
+ // AArch64 SVE/SME specific code below updates SVE and ZA register sizes and
1650
+ // offsets if value of VG or SVG registers has changed since last stop.
1651
+ const ArchSpec &arch = GetTarget ().GetArchitecture ();
1652
+ if (arch.IsValid () && arch.GetTriple ().isAArch64 ()) {
1653
+ GDBRemoteRegisterContext *gdb_remote_reg_ctx =
1654
+ static_cast <GDBRemoteRegisterContext *>(reg_ctx_sp.get ());
1655
+
1656
+ if (gdb_remote_reg_ctx)
1657
+ gdb_remote_reg_ctx->AArch64SVEReconfigure ();
1658
+ }
1648
1659
1649
1660
auto iter = std::find (m_thread_ids.begin (), m_thread_ids.end (), tid);
1650
1661
if (iter != m_thread_ids.end ())
@@ -1655,24 +1666,10 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
1655
1666
WritableDataBufferSP buffer_sp (
1656
1667
new DataBufferHeap (reg_value_extractor.GetStringRef ().size () / 2 , 0 ));
1657
1668
reg_value_extractor.GetHexBytes (buffer_sp->GetData (), ' \xcc ' );
1658
- uint32_t lldb_regnum = gdb_reg_ctx_sp ->ConvertRegisterKindToRegisterNumber (
1669
+ uint32_t lldb_regnum = reg_ctx_sp ->ConvertRegisterKindToRegisterNumber (
1659
1670
eRegisterKindProcessPlugin, pair.first );
1660
1671
gdb_thread->PrivateSetRegisterValue (lldb_regnum, buffer_sp->GetData ());
1661
1672
}
1662
-
1663
- // AArch64 SVE specific code below calls AArch64SVEReconfigure to update
1664
- // SVE register sizes and offsets if value of VG register has changed
1665
- // since last stop.
1666
- const ArchSpec &arch = GetTarget ().GetArchitecture ();
1667
- if (arch.IsValid () && arch.GetTriple ().isAArch64 ()) {
1668
- GDBRemoteRegisterContext *reg_ctx_sp =
1669
- static_cast <GDBRemoteRegisterContext *>(
1670
- gdb_thread->GetRegisterContext ().get ());
1671
-
1672
- if (reg_ctx_sp)
1673
- reg_ctx_sp->AArch64SVEReconfigure ();
1674
- }
1675
-
1676
1673
thread_sp->SetName (thread_name.empty () ? nullptr : thread_name.c_str ());
1677
1674
1678
1675
gdb_thread->SetThreadDispatchQAddr (thread_dispatch_qaddr);
0 commit comments