2015-06-24 19:26:19 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
#include "Breakpoint.h"
|
|
|
|
|
2016-01-09 13:15:43 -05:00
|
|
|
Breakpoint::Breakpoint()
|
2015-06-24 19:26:19 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Breakpoint::~Breakpoint()
|
|
|
|
{
|
|
|
|
}
|
2016-01-09 13:15:43 -05:00
|
|
|
|
|
|
|
bool Breakpoint::Matches(uint32_t memoryAddr, uint32_t absoluteAddr)
|
|
|
|
{
|
2016-06-02 23:56:11 -04:00
|
|
|
return _addr == -1 || ((int32_t)memoryAddr == _addr && !_isAbsoluteAddr) || ((int32_t)absoluteAddr == _addr && _isAbsoluteAddr);
|
2016-01-09 13:15:43 -05:00
|
|
|
}
|
|
|
|
|
2016-11-18 21:32:07 -05:00
|
|
|
bool Breakpoint::HasBreakpointType(BreakpointType type)
|
2016-01-09 13:15:43 -05:00
|
|
|
{
|
2016-11-18 21:32:07 -05:00
|
|
|
switch(type) {
|
|
|
|
case BreakpointType::Global: return (_type == BreakpointTypeFlags::Global);
|
|
|
|
case BreakpointType::Execute: return (_type & BreakpointTypeFlags::Execute) == BreakpointTypeFlags::Execute;
|
|
|
|
case BreakpointType::ReadRam: return (_type & BreakpointTypeFlags::ReadRam) == BreakpointTypeFlags::ReadRam;
|
|
|
|
case BreakpointType::WriteRam: return (_type & BreakpointTypeFlags::WriteRam) == BreakpointTypeFlags::WriteRam;
|
|
|
|
case BreakpointType::ReadVram: return (_type & BreakpointTypeFlags::ReadVram) == BreakpointTypeFlags::ReadVram;
|
|
|
|
case BreakpointType::WriteVram: return (_type & BreakpointTypeFlags::WriteVram) == BreakpointTypeFlags::WriteVram;
|
|
|
|
}
|
|
|
|
return false;
|
2016-01-09 13:15:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
string Breakpoint::GetCondition()
|
|
|
|
{
|
|
|
|
return _condition;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Breakpoint::ClearCondition()
|
|
|
|
{
|
|
|
|
memset(_condition, 0, sizeof(_condition));
|
|
|
|
}
|