From 84f65dc961e12d58b8a9258682c934fe99c3fc1d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 29 Jun 2013 11:45:29 -0700 Subject: [PATCH] Save flags around conditional breakpoint check. --- Core/MIPS/x86/Jit.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/x86/Jit.cpp b/Core/MIPS/x86/Jit.cpp index 28396d0616..bb067097a4 100644 --- a/Core/MIPS/x86/Jit.cpp +++ b/Core/MIPS/x86/Jit.cpp @@ -179,7 +179,6 @@ void Jit::CompileDelaySlot(int flags) { const u32 addr = js.compilerPC + 4; - // TODO: If we ever support conditional breakpoints, we need to handle the flags more carefully. // Need to offset the downcount which was already incremented for the branch + delay slot. CheckJitBreakpoint(addr, -2); @@ -444,6 +443,7 @@ bool Jit::CheckJitBreakpoint(u32 addr, int downcountOffset) { if (CBreakPoints::IsAddressBreakPoint(addr)) { + SAVE_FLAGS; FlushAll(); MOV(32, M(&mips_->pc), Imm32(js.compilerPC)); ABI_CallFunction((void *)&JitBreakpoint); @@ -452,9 +452,13 @@ bool Jit::CheckJitBreakpoint(u32 addr, int downcountOffset) CMP(32, R(EAX), Imm32(0)); FixupBranch skip = J_CC(CC_Z); WriteDowncount(downcountOffset); + // Just to fix the stack. + LOAD_FLAGS; JMP(asm_.dispatcherCheckCoreState, true); SetJumpTarget(skip); + LOAD_FLAGS; + return true; }