diff --git a/pcsx2-qt/Debugger/CpuWidget.cpp b/pcsx2-qt/Debugger/CpuWidget.cpp index 9cee5effe3..0928ecf076 100644 --- a/pcsx2-qt/Debugger/CpuWidget.cpp +++ b/pcsx2-qt/Debugger/CpuWidget.cpp @@ -373,6 +373,9 @@ void CpuWidget::fixBPListColumnSize() void CpuWidget::onBPListContextMenu(QPoint pos) { + if (!m_cpu.isAlive()) + return; + if (m_bplistContextMenu) delete m_bplistContextMenu; @@ -951,6 +954,9 @@ std::vector startWorker(DebugInterface* cpu, int type, u32 start, u32 end, void CpuWidget::onSearchButtonClicked() { + if (!m_cpu.isAlive()) + return; + const int searchType = m_ui.cmbSearchType->currentIndex(); const bool searchHex = m_ui.chkSearchHex->isChecked(); diff --git a/pcsx2-qt/Debugger/DisassemblyWidget.cpp b/pcsx2-qt/Debugger/DisassemblyWidget.cpp index 44365a95db..57afb9612e 100644 --- a/pcsx2-qt/Debugger/DisassemblyWidget.cpp +++ b/pcsx2-qt/Debugger/DisassemblyWidget.cpp @@ -151,6 +151,9 @@ void DisassemblyWidget::contextJumpToCursor() void DisassemblyWidget::contextToggleBreakpoint() { + if (!m_cpu->isAlive()) + return; + if (CBreakPoints::IsAddressBreakPoint(m_cpu->getCpuType(), m_selectedAddressStart)) { Host::RunOnCPUThread([&] { CBreakPoints::RemoveBreakPoint(m_cpu->getCpuType(), m_selectedAddressStart); }); @@ -504,6 +507,9 @@ void DisassemblyWidget::mousePressEvent(QMouseEvent* event) void DisassemblyWidget::mouseDoubleClickEvent(QMouseEvent* event) { + if (!m_cpu->isAlive()) + return; + const u32 selectedAddress = (event->y() / m_rowHeight * 4) + m_visibleStart; if (CBreakPoints::IsAddressBreakPoint(m_cpu->getCpuType(), selectedAddress)) { @@ -597,6 +603,9 @@ void DisassemblyWidget::keyPressEvent(QKeyEvent* event) void DisassemblyWidget::customMenuRequested(QPoint pos) { + if (!m_cpu->isAlive()) + return; + m_contextMenu->popup(this->mapToGlobal(pos)); } diff --git a/pcsx2-qt/Debugger/MemoryViewWidget.cpp b/pcsx2-qt/Debugger/MemoryViewWidget.cpp index bc0eff6125..926e9d9009 100644 --- a/pcsx2-qt/Debugger/MemoryViewWidget.cpp +++ b/pcsx2-qt/Debugger/MemoryViewWidget.cpp @@ -344,12 +344,18 @@ void MemoryViewWidget::paintEvent(QPaintEvent* event) void MemoryViewWidget::mousePressEvent(QMouseEvent* event) { + if (!m_cpu->isAlive()) + return; + m_table.SelectAt(event->pos()); repaint(); } void MemoryViewWidget::customMenuRequested(QPoint pos) { + if (!m_cpu->isAlive()) + return; + if (!m_contextMenu) { m_contextMenu = new QMenu(this); diff --git a/pcsx2-qt/Debugger/RegisterWidget.cpp b/pcsx2-qt/Debugger/RegisterWidget.cpp index f09d5c85f0..2325cee76e 100644 --- a/pcsx2-qt/Debugger/RegisterWidget.cpp +++ b/pcsx2-qt/Debugger/RegisterWidget.cpp @@ -219,6 +219,9 @@ void RegisterWidget::wheelEvent(QWheelEvent* event) void RegisterWidget::customMenuRequested(QPoint pos) { + if (!m_cpu->isAlive()) + return; + if (m_selectedRow > m_rowEnd) // Unsigned underflow; selectedRow will be > m_rowEnd (technically negative) return;