Merge pull request #7654 from MerryMage/bkpt

Jit64: Fix instruction breakpoints
This commit is contained in:
Tilka 2018-12-27 22:25:40 +01:00 committed by GitHub
commit 7ec5a3df7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -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);

View File

@ -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)
{