diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index b2e893e2c0..05574b303d 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -446,6 +446,10 @@ void Jit64::JustWriteExit(u32 destination, bool bl, u32 after) MOV(32, PPCSTATE(pc), Imm32(destination)); + // Do not skip breakpoint check if debugging. + const u8* dispatcher = SConfig::GetInstance().bEnableDebugging ? asm_routines.dispatcher : + asm_routines.dispatcher_no_check; + // Perform downcount flag check, followed by the requested exit if (bl) { @@ -457,7 +461,7 @@ void Jit64::JustWriteExit(u32 destination, bool bl, u32 after) SwitchToNearCode(); linkData.exitPtrs = GetWritableCodePtr(); - CALL(asm_routines.dispatcher_no_check); + CALL(dispatcher); SetJumpTarget(after_fixup); POP(RSCRATCH); @@ -468,7 +472,7 @@ void Jit64::JustWriteExit(u32 destination, bool bl, u32 after) J_CC(CC_LE, asm_routines.do_timing); linkData.exitPtrs = GetWritableCodePtr(); - JMP(asm_routines.dispatcher_no_check, true); + JMP(dispatcher, true); } b->linkData.push_back(linkData); diff --git a/Source/Core/Core/PowerPC/Jit64Common/BlockCache.cpp b/Source/Core/Core/PowerPC/Jit64Common/BlockCache.cpp index e857226265..85c423f4e8 100644 --- a/Source/Core/Core/PowerPC/Jit64Common/BlockCache.cpp +++ b/Source/Core/Core/PowerPC/Jit64Common/BlockCache.cpp @@ -14,8 +14,13 @@ JitBlockCache::JitBlockCache(JitBase& jit) : JitBaseBlockCache{jit} void JitBlockCache::WriteLinkBlock(const JitBlock::LinkData& source, const JitBlock* dest) { + // Do not skip breakpoint check if debugging. + const u8* dispatcher = SConfig::GetInstance().bEnableDebugging ? + m_jit.GetAsmRoutines()->dispatcher : + m_jit.GetAsmRoutines()->dispatcher_no_check; + u8* location = source.exitPtrs; - const u8* address = dest ? dest->checkedEntry : m_jit.GetAsmRoutines()->dispatcher_no_check; + const u8* address = dest ? dest->checkedEntry : dispatcher; Gen::XEmitter emit(location); if (source.call) {