This revision was automatically updated to reflect the committed changes.
Closed by commit rG344bdeb797b3: [LLDB] Avoid using InitializeContext for
zero-initializing a CONTEXT. NFC. (authored by mstorsjo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70742/new/
https://reviews.llvm.org/D70742
Files:
lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
Index: lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
===================================================================
--- lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
+++ lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
@@ -154,15 +154,8 @@
return true;
TargetThreadWindows &wthread = static_cast<TargetThreadWindows &>(m_thread);
- uint8_t buffer[2048];
- memset(buffer, 0, sizeof(buffer));
- PCONTEXT tmpContext = NULL;
- DWORD contextLength = (DWORD)sizeof(buffer);
- if (!::InitializeContext(buffer, kWinContextFlags, &tmpContext,
- &contextLength)) {
- return false;
- }
- memcpy(&m_context, tmpContext, sizeof(m_context));
+ memset(&m_context, 0, sizeof(m_context));
+ m_context.ContextFlags = kWinContextFlags;
if (::SuspendThread(
wthread.GetHostThread().GetNativeThread().GetSystemHandle()) ==
(DWORD)-1) {
Index: lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
===================================================================
--- lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
+++ lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
@@ -154,15 +154,8 @@
return true;
TargetThreadWindows &wthread = static_cast<TargetThreadWindows &>(m_thread);
- uint8_t buffer[2048];
- memset(buffer, 0, sizeof(buffer));
- PCONTEXT tmpContext = NULL;
- DWORD contextLength = (DWORD)sizeof(buffer);
- if (!::InitializeContext(buffer, kWinContextFlags, &tmpContext,
- &contextLength)) {
- return false;
- }
- memcpy(&m_context, tmpContext, sizeof(m_context));
+ memset(&m_context, 0, sizeof(m_context));
+ m_context.ContextFlags = kWinContextFlags;
if (::SuspendThread(
wthread.GetHostThread().GetNativeThread().GetSystemHandle()) ==
(DWORD)-1) {
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits