jit-ir: Implement memory breakpoints.

These generally work, but likely delay slots will make downcount slightly
off, and won't resume when you hit run again without manually stepping
through them.
This commit is contained in:
Unknown W. Brackets committed 2016-07-02 16:38:30 -07:00
1 parent 7cd666c351
commit 4578c3cb54
13 files changed
+142 -40

No files matched your search

+30
View File
@@ -364,6 +364,31 @@ void CBreakPoints::ExecMemCheck(u32 address, bool write, int size, u32 pc)
check->Action(address, write, size, pc);
}
void CBreakPoints::ExecOpMemCheck(u32 address, u32 pc)
{
// Note: currently, we don't check "on changed" for HLE (ExecMemCheck.)
// We'd need to more carefully specify memory changes in HLE for that.
int size = MIPSAnalyst::OpMemoryAccessSize(pc);
if (size == 0 && MIPSAnalyst::OpHasDelaySlot(pc)) {
// This means that the delay slot is what tripped us.
pc += 4;
size = MIPSAnalyst::OpMemoryAccessSize(pc);
}
bool write = MIPSAnalyst::IsOpMemoryWrite(pc);
auto check = GetMemCheck(address, size);
if (check) {
int mask = MEMCHECK_WRITE | MEMCHECK_WRITE_ONCHANGE;
if (write && (check->cond & mask) == mask) {
if (MIPSAnalyst::OpWouldChangeMemory(pc, address, size)) {
check->Action(address, write, size, pc);
}
} else {
check->Action(address, write, size, pc);
}
}
}
void CBreakPoints::ExecMemCheckJitBefore(u32 address, bool write, int size, u32 pc)
{
auto check = GetMemCheck(address, size);
@@ -421,6 +446,11 @@ const std::vector<BreakPoint> CBreakPoints::GetBreakpoints()
return breakPoints_;
}
bool CBreakPoints::HasMemChecks()
{
return !memChecks_.empty();
}
void CBreakPoints::Update(u32 addr)
{
if (MIPSComp::jit)