Debugger: Add Reset button

Add a handy 'Reset' button next to the 'Run' button
This commit is contained in:
allkern 2024-12-12 23:27:49 -03:00
parent 65748351c7
commit bf674d301c
3 changed files with 17 additions and 0 deletions

View File

@ -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);
@ -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());

View File

@ -18,6 +18,7 @@ public:
public slots:
void onVMStateChanged();
void onRunPause();
void onReset();
void onStepInto();
void onStepOver();
void onStepOut();
@ -30,6 +31,7 @@ protected:
private:
Ui::DebuggerWindow m_ui;
QAction* m_actionRunPause;
QAction* m_actionReset;
QAction* m_actionStepInto;
QAction* m_actionStepOver;
QAction* m_actionStepOut;

View File

@ -51,6 +51,7 @@
<bool>false</bool>
</attribute>
<addaction name="actionRun"/>
<addaction name="actionReset"/>
<addaction name="actionStepInto"/>
<addaction name="actionStepOver"/>
<addaction name="actionStepOut"/>
@ -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"/>