[Lldb-commits] [lldb] [lldb][Windows] Cache thread context in NativeRegisterContextWindows_arm64 (PR #197385)

Ayush Sahay via lldb-commits lldb-commits at lists.llvm.org
Thu May 14 02:15:31 PDT 2026


================
@@ -267,11 +297,15 @@ Status NativeRegisterContextWindows_arm64::GPRRead(const uint32_t reg,
 Status
 NativeRegisterContextWindows_arm64::GPRWrite(const uint32_t reg,
                                              const RegisterValue &reg_value) {
-  ::CONTEXT tls_context;
-  DWORD context_flag = CONTEXT_CONTROL | CONTEXT_INTEGER;
+  auto cleanup = llvm::make_scope_exit([&]() { m_context = nullptr; });
----------------
ayushsahay1837 wrote:

That's the intention. We could have conservatively freed _m_context_buffer_ as well but like you mentioned, we don't anticipate the context length changing frequently, if at all. So, there might be value in just resizing and zeroing it out in _GetThreadContextHelper_ rather than resetting it.

https://github.com/llvm/llvm-project/pull/197385


More information about the lldb-commits mailing list