Skip to content

Commit

Permalink
Debugger: Add Reset button
Browse files Browse the repository at this point in the history
Add a handy 'Reset' button next to the 'Run' button
  • Loading branch information
allkern committed Dec 13, 2024
1 parent 6574835 commit bf674d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pcsx2-qt/Debugger/DebuggerWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent)
#endif

connect(m_ui.actionRun, &QAction::triggered, this, &DebuggerWindow::onRunPause);
connect(m_ui.actionReset, &QAction::triggered, this, &DebuggerWindow::onReset);
connect(m_ui.actionStepInto, &QAction::triggered, this, &DebuggerWindow::onStepInto);
connect(m_ui.actionStepOver, &QAction::triggered, this, &DebuggerWindow::onStepOver);
connect(m_ui.actionStepOut, &QAction::triggered, this, &DebuggerWindow::onStepOut);
Expand Down Expand Up @@ -113,6 +114,11 @@ void DebuggerWindow::onRunPause()
g_emu_thread->setVMPaused(!QtHost::IsVMPaused());
}

void DebuggerWindow::onReset()
{
g_emu_thread->resetVM();
}

void DebuggerWindow::onStepInto()
{
CpuWidget* currentCpu = static_cast<CpuWidget*>(m_ui.cpuTabs->currentWidget());
Expand Down
2 changes: 2 additions & 0 deletions pcsx2-qt/Debugger/DebuggerWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DebuggerWindow : public QMainWindow
public slots:
void onVMStateChanged();
void onRunPause();
void onReset();
void onStepInto();
void onStepOver();
void onStepOut();
Expand All @@ -30,6 +31,7 @@ public slots:
private:
Ui::DebuggerWindow m_ui;
QAction* m_actionRunPause;
QAction* m_actionReset;
QAction* m_actionStepInto;
QAction* m_actionStepOver;
QAction* m_actionStepOut;
Expand Down
9 changes: 9 additions & 0 deletions pcsx2-qt/Debugger/DebuggerWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<bool>false</bool>
</attribute>
<addaction name="actionRun"/>
<addaction name="actionReset"/>
<addaction name="actionStepInto"/>
<addaction name="actionStepOver"/>
<addaction name="actionStepOut"/>
Expand All @@ -65,6 +66,14 @@
<string>Run</string>
</property>
</action>
<action name="actionReset">
<property name="icon">
<iconset theme="restart-line"/>
</property>
<property name="text">
<string>Reset</string>
</property>
</action>
<action name="actionStepInto">
<property name="icon">
<iconset theme="debug-step-into-line"/>
Expand Down

0 comments on commit bf674d3

Please sign in to comment.