Skip to content
Permalink
Browse files
Merge pull request #7654 from MerryMage/bkpt
Jit64: Fix instruction breakpoints
  • Loading branch information
Tilka committed Dec 27, 2018
2 parents 22f4e3a + 26bc38d commit 7ec5a3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
@@ -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);
@@ -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)
{

0 comments on commit 7ec5a3d

Please sign in to comment.