Debugger Breakpoints: Allow toggling from list / dialog.

This commit is contained in:
Ty Lamontagne 2022-12-31 23:19:30 -05:00 committed by lightningterror
parent a9a3342519
commit ec5a91b89a
2 changed files with 22 additions and 1 deletions

View File

@ -197,8 +197,10 @@ void BreakpointDialog::accept()
} }
else else
{ {
Host::RunOnCPUThread([this, address] { CBreakPoints::ChangeBreakPointRemoveCond(m_cpu->getCpuType(), address); }, true); Host::RunOnCPUThread([this, address] { CBreakPoints::ChangeBreakPointRemoveCond(m_cpu->getCpuType(), address); });
} }
Host::RunOnCPUThread([this, address] { CBreakPoints::ChangeBreakPoint(m_cpu->getCpuType(), address, m_ui.chkEnable->isChecked()); });
m_bp->addr = address; m_bp->addr = address;
} }

View File

@ -234,6 +234,8 @@ void CpuWidget::onVMPaused()
void CpuWidget::updateBreakpoints() void CpuWidget::updateBreakpoints()
{ {
m_ui.breakpointList->blockSignals(true);
m_ui.breakpointList->setRowCount(0); m_ui.breakpointList->setRowCount(0);
m_bplistObjects.clear(); m_bplistObjects.clear();
@ -355,6 +357,8 @@ void CpuWidget::updateBreakpoints()
iter++; iter++;
} }
m_ui.breakpointList->blockSignals(false);
} }
void CpuWidget::fixBPListColumnSize() void CpuWidget::fixBPListColumnSize()
@ -468,6 +472,21 @@ void CpuWidget::onBPListItemChange(QTableWidgetItem* item)
updateBreakpoints(); updateBreakpoints();
} }
} }
else if (item->column() == 6)
{
auto bpmc = m_bplistObjects.at(item->row());
Host::RunOnCPUThread([this, bpmc, checked = item->checkState()] {
if (bpmc.bp)
{
CBreakPoints::ChangeBreakPoint(m_cpu.getCpuType(), bpmc.bp->addr, checked);
}
else
{
CBreakPoints::ChangeMemCheck(m_cpu.getCpuType(), bpmc.mc->start, bpmc.mc->end, bpmc.mc->cond, MemCheckResult(bpmc.mc->result ^ MEMCHECK_BREAK));
}
});
}
} }
void CpuWidget::contextBPListCopy() void CpuWidget::contextBPListCopy()