diff --git a/FEXCore/Source/Interface/Core/Core.cpp b/FEXCore/Source/Interface/Core/Core.cpp index 8f067ace6..a925813bb 100644 --- a/FEXCore/Source/Interface/Core/Core.cpp +++ b/FEXCore/Source/Interface/Core/Core.cpp @@ -937,7 +937,7 @@ void ContextImpl::ExecutionThread(FEXCore::Core::InternalThreadState* Thread) { Thread->ExitReason = FEXCore::Context::ExitReason::EXIT_SHUTDOWN; if (CustomExitHandler) { - CustomExitHandler(Thread->ThreadManager.TID, Thread->ExitReason); + CustomExitHandler(Thread, Thread->ExitReason); } } diff --git a/FEXCore/include/FEXCore/Core/Context.h b/FEXCore/include/FEXCore/Core/Context.h index a345ab6fc..288638a5b 100644 --- a/FEXCore/include/FEXCore/Core/Context.h +++ b/FEXCore/include/FEXCore/Core/Context.h @@ -102,7 +102,7 @@ using CodeRangeInvalidationFn = std::function(Context*, Core::InternalThreadState* Thread)>; using CustomIREntrypointHandler = std::function; -using ExitHandler = std::function; +using ExitHandler = std::function; using AOTIRCodeFileWriterFn = std::function; using AOTIRLoaderCBFn = std::function; diff --git a/Source/Tools/FEXLoader/FEXLoader.cpp b/Source/Tools/FEXLoader/FEXLoader.cpp index 764d8af49..8e620df50 100644 --- a/Source/Tools/FEXLoader/FEXLoader.cpp +++ b/Source/Tools/FEXLoader/FEXLoader.cpp @@ -515,7 +515,7 @@ int main(int argc, char** argv, char** const envp) { // There might already be an exit handler, leave it installed if (!CTX->GetExitHandler()) { - CTX->SetExitHandler([&](uint64_t thread, FEXCore::Context::ExitReason reason) { + CTX->SetExitHandler([&](FEXCore::Core::InternalThreadState* Thread, FEXCore::Context::ExitReason reason) { if (reason != FEXCore::Context::ExitReason::EXIT_DEBUG) { ShutdownReason = reason; SyscallHandler->TM.Stop(); diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp index 1d9972f25..fd5cfd6b4 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp @@ -121,7 +121,7 @@ GdbServer::GdbServer(FEXCore::Context::Context* ctx, FEX::HLE::SignalDelegator* // Pass all signals by default std::fill(PassSignals.begin(), PassSignals.end(), true); - ctx->SetExitHandler([this](uint64_t ThreadId, FEXCore::Context::ExitReason ExitReason) { + ctx->SetExitHandler([this](FEXCore::Core::InternalThreadState* Thread, FEXCore::Context::ExitReason ExitReason) { if (ExitReason == FEXCore::Context::ExitReason::EXIT_DEBUG) { this->Break(SIGTRAP); }