Debugger: Implement SPU breakpoints

This commit is contained in:
Eladash 2021-10-15 02:26:51 +03:00 committed by Ivan
parent ec6d6adebc
commit ccb2724fc4
10 changed files with 136 additions and 32 deletions

View file

@ -23,7 +23,7 @@ constexpr auto qstr = QString::fromStdString;
debugger_list::debugger_list(QWidget* parent, std::shared_ptr<gui_settings> gui_settings, breakpoint_handler* handler)
: QListWidget(parent)
, m_gui_settings(std::move(gui_settings))
, m_breakpoint_handler(handler)
, m_ppu_breakpoint_handler(handler)
{
setWindowTitle(tr("ASM"));
@ -54,9 +54,21 @@ u32 debugger_list::GetCenteredAddress(u32 address) const
void debugger_list::ShowAddress(u32 addr, bool select_addr, bool force)
{
auto IsBreakpoint = [this](u32 pc)
const decltype(spu_thread::local_breakpoints)* spu_bps_list;
if (m_cpu && m_cpu->id_type() == 2)
{
return m_cpu && m_cpu->id_type() == 1 && m_breakpoint_handler->HasBreakpoint(pc);
spu_bps_list = &static_cast<spu_thread*>(m_cpu)->local_breakpoints;
}
auto IsBreakpoint = [&](u32 pc)
{
switch (m_cpu ? m_cpu->id_type() : 0)
{
case 1: return m_ppu_breakpoint_handler->HasBreakpoint(pc);
case 2: return (*spu_bps_list)[pc / 4].load();
default: return false;
}
};
bool center_pc = m_gui_settings->GetValue(gui::d_centerPC).toBool();