Esempio n. 1
0
BreakAction CBreakPoints::ExecMemCheck(u32 address, bool write, int size, u32 pc)
{
	auto check = GetMemCheck(address, size);
	if (check)
		return check->Action(address, write, size, pc);
	return BREAK_ACTION_IGNORE;
}
Esempio n. 2
0
BreakAction 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)) {
				return check->Action(address, write, size, pc);
			}
		} else {
			return check->Action(address, write, size, pc);
		}
	}
	return BREAK_ACTION_IGNORE;
}
Esempio n. 3
0
void CBreakPoints::ExecMemCheckJitBefore(u32 address, bool write, int size, u32 pc)
{
	auto check = GetMemCheck(address, size);
	if (check) {
		check->JitBefore(address, write, size, pc);
		cleanupMemChecks_.push_back(check);
	}
}
Esempio n. 4
0
void Free(void *x)
{
    if (((x) == (void *)NULL) || ((x) == (void *) 0xffffffff)) {
	printf("!!!!!Whoa!!!!!!  Free() got a 0x%x\n", (x));
        if( ! GetMemCheck() ) 
	    free((x));
    } 
    else {
        free(x);
        x = (void *) 0xffffffff;
    }
}
Esempio n. 5
0
void CBreakPoints::ExecMemCheck(u32 address, bool write, int size, u32 pc)
{
	auto check = GetMemCheck(address, size);
	if (check)
		check->Action(address, write, size, pc);
}