From a0f4beb45321e2527b575eb23fbb0425df08a1ff Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 10 Dec 2024 13:57:00 -0800 Subject: [PATCH] GdbServer: Have Break consume the ThreadObject directly --- Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp | 5 ++--- Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp index 15e00f14f7..23218e3eea 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp @@ -62,13 +62,12 @@ desc: Provides a gdb interface to the guest state namespace FEX { #ifndef _WIN32 -void GdbServer::Break(FEXCore::Core::InternalThreadState* Thread, int signal) { +void GdbServer::Break(FEX::HLE::ThreadStateObject* ThreadObject, int signal) { std::lock_guard lk(sendMutex); if (!CommsStream) { return; } - auto ThreadObject = FEX::HLE::ThreadManager::GetStateObjectFromFEXCoreThread(Thread); // Current debugging thread switches to the thread that is breaking. CurrentDebuggingThread = ThreadObject->ThreadInfo.TID.load(); @@ -119,7 +118,7 @@ GdbServer::GdbServer(FEXCore::Context::Context* ctx, FEX::HLE::SignalDelegator* ThreadObject->GdbInfo.PState = ArchHelpers::Context::GetArmPState(ucontext); // Let GDB know that we have a signal - this->Break(Thread, Signal); + this->Break(ThreadObject, Signal); WaitForThreadWakeup(); diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h index a6c8b8ca55..eb7ac11ac6 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h @@ -36,7 +36,7 @@ class GdbServer { } private: - void Break(FEXCore::Core::InternalThreadState* Thread, int signal); + void Break(FEX::HLE::ThreadStateObject* ThreadObject, int signal); void OpenListenSocket(); void CloseListenSocket();