mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-19 06:45:39 +00:00
Qt: Fix opening debugger when system already paused
This commit is contained in:
parent
dc46d52029
commit
3cd3d1c09d
|
@ -560,6 +560,12 @@ bool Boot(const SystemBootParameters& params)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (params.start_paused)
|
||||
{
|
||||
DebugAssert(s_state == State::Running);
|
||||
s_state = State::Paused;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -699,7 +705,7 @@ bool Boot(const SystemBootParameters& params)
|
|||
}
|
||||
|
||||
// Good to go.
|
||||
s_state = State::Running;
|
||||
s_state = params.start_paused ? State::Paused : State::Running;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ struct SystemBootParameters
|
|||
u32 media_playlist_index = 0;
|
||||
bool load_image_to_ram = false;
|
||||
bool force_software_renderer = false;
|
||||
bool start_paused = false;
|
||||
};
|
||||
|
||||
namespace System {
|
||||
|
|
|
@ -19,7 +19,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent /* = nullptr */)
|
|||
setUIEnabled(false);
|
||||
}
|
||||
|
||||
DebuggerWindow::~DebuggerWindow() {}
|
||||
DebuggerWindow::~DebuggerWindow() = default;
|
||||
|
||||
void DebuggerWindow::onEmulationPaused(bool paused)
|
||||
{
|
||||
|
|
|
@ -24,11 +24,13 @@ public:
|
|||
Q_SIGNALS:
|
||||
void closed();
|
||||
|
||||
public Q_SLOTS:
|
||||
void onEmulationPaused(bool paused);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onEmulationPaused(bool paused);
|
||||
void onDebuggerMessageReported(const QString& message);
|
||||
|
||||
void refreshAll();
|
||||
|
|
|
@ -1359,8 +1359,11 @@ void MainWindow::onToolsCPUDebuggerTriggered()
|
|||
connect(m_debugger_window, &DebuggerWindow::closed, this, &MainWindow::onCPUDebuggerClosed);
|
||||
}
|
||||
|
||||
m_host_interface->pauseSystem(true, true);
|
||||
m_debugger_window->show();
|
||||
m_host_interface->pauseSystem(true);
|
||||
|
||||
// the debugger will miss the pause event above (or we were already paused), so fire it now
|
||||
m_debugger_window->onEmulationPaused(true);
|
||||
}
|
||||
|
||||
void MainWindow::onCPUDebuggerClosed()
|
||||
|
|
Loading…
Reference in a new issue