mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Correctly break at branch points in x86 jit.
This commit is contained in:
parent
beac991a9e
commit
40ae3dfe45
2 changed files with 23 additions and 10 deletions
|
@ -31,7 +31,7 @@
|
|||
namespace MIPSComp
|
||||
{
|
||||
|
||||
static void JitBreakpoint()
|
||||
void JitBreakpoint()
|
||||
{
|
||||
Core_EnableStepping(true);
|
||||
host->SetDebugMode(true);
|
||||
|
@ -123,16 +123,10 @@ const u8 *Jit::DoJit(u32 em_address, JitBlock *b)
|
|||
u32 inst = Memory::Read_Instruction(js.compilerPC);
|
||||
js.downcountAmount += MIPSGetInstructionCycleEstimate(inst);
|
||||
|
||||
MIPSCompileOp(inst);
|
||||
|
||||
// Jit breakpoints are quite fast, so let's do them in release too.
|
||||
if (CBreakPoints::IsAddressBreakPoint(js.compilerPC))
|
||||
{
|
||||
FlushAll();
|
||||
MOV(32, M(&mips_->pc), Imm32(js.compilerPC));
|
||||
CALL(&JitBreakpoint);
|
||||
WriteSyscallExit();
|
||||
}
|
||||
CheckJitBreakpoint(js.compilerPC);
|
||||
|
||||
MIPSCompileOp(inst);
|
||||
|
||||
js.compilerPC += 4;
|
||||
numInstructions++;
|
||||
|
@ -198,4 +192,19 @@ void Jit::WriteSyscallExit()
|
|||
JMP(asm_.dispatcherCheckCoreState, true);
|
||||
}
|
||||
|
||||
bool Jit::CheckJitBreakpoint(u32 addr)
|
||||
{
|
||||
if (CBreakPoints::IsAddressBreakPoint(addr))
|
||||
{
|
||||
FlushAll();
|
||||
MOV(32, M(&mips_->pc), Imm32(js.compilerPC));
|
||||
CALL(&JitBreakpoint);
|
||||
WriteSyscallExit();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
namespace MIPSComp
|
||||
{
|
||||
|
||||
// This is called when Jit hits a breakpoint.
|
||||
void JitBreakpoint();
|
||||
|
||||
struct JitOptions
|
||||
{
|
||||
JitOptions()
|
||||
|
@ -103,6 +106,7 @@ private:
|
|||
void WriteExitDestInEAX();
|
||||
// void WriteRfiExitDestInEAX();
|
||||
void WriteSyscallExit();
|
||||
bool CheckJitBreakpoint(u32 addr);
|
||||
|
||||
// Utility compilation functions
|
||||
void BranchFPFlag(u32 op, Gen::CCFlags cc, bool likely);
|
||||
|
|
Loading…
Add table
Reference in a new issue