Debugger: Don't jump to PC if the breakpoint code paused the core

This commit is contained in:
chaoticgd 2025-03-18 00:11:17 +00:00 committed by Ty
parent 08edc8dfab
commit f6e2185c9c
3 changed files with 16 additions and 2 deletions

View File

@ -323,6 +323,13 @@ void DebuggerWindow::onVMPaused()
CBreakPoints::SetSkipFirst(BREAKPOINT_IOP, r3000Debug.getPC());
});
}
// Stops us from telling the disassembly widget to jump somwhere because
// breakpoint code paused the core.
if (!CBreakPoints::GetCorePaused())
emit onVMActuallyPaused();
else
CBreakPoints::SetCorePaused(false);
}
void DebuggerWindow::onVMResumed()

View File

@ -51,6 +51,11 @@ public slots:
void onStepOver();
void onStepOut();
Q_SIGNALS:
// Only emitted if the pause wasn't a temporary one triggered by the
// breakpoint code.
void onVMActuallyPaused();
protected:
void closeEvent(QCloseEvent* event);

View File

@ -3,8 +3,9 @@
#include "DisassemblyWidget.h"
#include "Debugger/Breakpoints/BreakpointModel.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/JsonValueWrapper.h"
#include "Debugger/Breakpoints/BreakpointModel.h"
#include "DebugTools/DebugInterface.h"
#include "DebugTools/DisassemblyManager.h"
@ -35,7 +36,8 @@ DisassemblyWidget::DisassemblyWidget(const DebuggerWidgetParameters& parameters)
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &DisassemblyWidget::customContextMenuRequested, this, &DisassemblyWidget::openContextMenu);
connect(g_emu_thread, &EmuThread::onVMPaused, this, &DisassemblyWidget::gotoProgramCounterOnPause);
connect(g_debugger_window, &DebuggerWindow::onVMActuallyPaused,
this, &DisassemblyWidget::gotoProgramCounterOnPause);
receiveEvent<DebuggerEvents::Refresh>([this](const DebuggerEvents::Refresh& event) -> bool {
update();