Skip to content

Commit

Permalink
GdbServer: Have Break consume the ThreadObject directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonicadvance1 committed Dec 10, 2024
1 parent 121af75 commit a0f4beb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/LinuxEmulation/LinuxSyscalls/GdbServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a0f4beb

Please sign in to comment.