From 2dfa3ba36be4872c18010a99fc11328155133af0 Mon Sep 17 00:00:00 2001 From: xx <0x7fancyxx@gmail.com> Date: Thu, 28 Sep 2023 15:42:02 +0800 Subject: [PATCH] (windows) Fixing RestoreRegisters() save register status to lcContext --- Windows/debugger.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Windows/debugger.cpp b/Windows/debugger.cpp index 016670e..50ed703 100644 --- a/Windows/debugger.cpp +++ b/Windows/debugger.cpp @@ -97,6 +97,8 @@ void Debugger::SaveRegisters(SavedRegisters* registers) { void Debugger::RestoreRegisters(SavedRegisters* registers) { have_thread_context = false; + memcpy(&lcContext, ®isters->saved_context, sizeof(registers->saved_context)); + HANDLE thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id); if (!SetThreadContext(thread_handle, &lcContext)) { FATAL("Error restoring registers");