| 463 | } |
| 464 | |
| 465 | bool BreakpointModel::removeRows(int row, int count, const QModelIndex& index) |
| 466 | { |
| 467 | const size_t begin_index = static_cast<size_t>(row); |
| 468 | const size_t end_index = static_cast<size_t>(row + count); |
| 469 | if (end_index > m_breakpoints.size()) |
| 470 | return false; |
| 471 | |
| 472 | beginRemoveRows(index, row, row + count - 1); |
| 473 | |
| 474 | for (size_t i = begin_index; i < end_index; i++) |
| 475 | { |
| 476 | auto bp_mc = m_breakpoints.at(i); |
| 477 | |
| 478 | if (const auto* bp = std::get_if<BreakPoint>(&bp_mc)) |
| 479 | { |
| 480 | Host::RunOnCPUThread([cpu = m_cpu.getCpuType(), addr = bp->addr] { |
| 481 | CBreakPoints::RemoveBreakPoint(cpu, addr); |
| 482 | }); |
| 483 | } |
| 484 | else if (const auto* mc = std::get_if<MemCheck>(&bp_mc)) |
| 485 | { |
| 486 | Host::RunOnCPUThread([cpu = m_cpu.getCpuType(), start = mc->start, end = mc->end] { |
| 487 | CBreakPoints::RemoveMemCheck(cpu, start, end); |
| 488 | }); |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | const auto begin = m_breakpoints.begin() + row; |
| 493 | const auto end = begin + count; |
| 494 | m_breakpoints.erase(begin, end); |
| 495 | |
| 496 | endRemoveRows(); |
| 497 | return true; |
| 498 | } |
| 499 | |
| 500 | bool BreakpointModel::insertBreakpointRows(int row, int count, std::vector<BreakpointMemcheck> breakpoints, const QModelIndex& index) |
| 501 | { |
no test coverage detected