GDBStub: move the stalling logic to CPU::Run

This commit is contained in:
aldelaro5 2021-09-30 23:35:11 -04:00
parent e3b978cf20
commit 994847f09c
2 changed files with 13 additions and 10 deletions

View File

@ -15,6 +15,10 @@
#include "Core/PowerPC/PowerPC.h"
#include "VideoCommon/Fifo.h"
#ifdef USE_GDBSTUB
#include "Core/PowerPC/GDBStub.h"
#endif
namespace CPU
{
// CPU Thread execution state.
@ -131,6 +135,15 @@ void Run()
// Wait for step command.
s_state_cpu_cvar.wait(state_lock, [&state_lock] {
ExecutePendingJobs(state_lock);
#ifdef USE_GDBSTUB
state_lock.unlock();
if (gdb_active() && gdb_hasControl())
{
gdb_signal(GDB_SIGTRAP);
gdb_handle_exception(true);
}
state_lock.lock();
#endif
return s_state_cpu_step_instruction || !IsStepping();
});
if (!IsStepping())

View File

@ -152,16 +152,6 @@ int Interpreter::SingleStepInner()
return PPCTables::GetOpInfo(m_prev_inst)->numCycles;
}
#ifdef USE_GDBSTUB
if (gdb_active() && gdb_bp_x(PC))
{
Host_UpdateDisasmDialog();
gdb_signal(GDB_SIGTRAP);
gdb_handle_exception(true);
}
#endif
NPC = PC + sizeof(UGeckoInstruction);
m_prev_inst.hex = PowerPC::Read_Opcode(PC);