2018-03-02 22:40:29 +01:00
|
|
|
#include "breakpoint_handler.h"
|
|
|
|
|
|
2021-07-30 20:30:29 +02:00
|
|
|
extern bool ppu_breakpoint(u32 loc, bool is_adding);
|
2018-03-02 22:40:29 +01:00
|
|
|
|
|
|
|
|
bool breakpoint_handler::HasBreakpoint(u32 loc) const
|
|
|
|
|
{
|
2021-03-23 20:39:39 +01:00
|
|
|
return m_breakpoints.contains(loc);
|
2018-03-02 22:40:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool breakpoint_handler::AddBreakpoint(u32 loc)
|
|
|
|
|
{
|
2021-07-30 20:30:29 +02:00
|
|
|
if (!ppu_breakpoint(loc, true))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ensure(m_breakpoints.insert(loc).second);
|
2018-03-02 22:40:29 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool breakpoint_handler::RemoveBreakpoint(u32 loc)
|
|
|
|
|
{
|
2021-07-30 20:30:29 +02:00
|
|
|
if (m_breakpoints.erase(loc) == 0)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ensure(ppu_breakpoint(loc, false));
|
2018-03-02 22:40:29 +01:00
|
|
|
return true;
|
|
|
|
|
}
|