mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
Debugger: Allow to unpause a thread which has been paused by global pause
This commit is contained in:
parent
cf6606065d
commit
cfc7865f82
1 changed files with 27 additions and 11 deletions
|
@ -33,6 +33,8 @@
|
||||||
|
|
||||||
constexpr auto qstr = QString::fromStdString;
|
constexpr auto qstr = QString::fromStdString;
|
||||||
|
|
||||||
|
constexpr auto s_pause_flags = cpu_flag::dbg_pause + cpu_flag::dbg_global_pause;
|
||||||
|
|
||||||
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent)
|
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent)
|
||||||
: custom_dock_widget(tr("Debugger"), parent), xgui_settings(settings)
|
: custom_dock_widget(tr("Debugger"), parent), xgui_settings(settings)
|
||||||
{
|
{
|
||||||
|
@ -140,11 +142,24 @@ debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *
|
||||||
{
|
{
|
||||||
if (const auto cpu = get_cpu())
|
if (const auto cpu = get_cpu())
|
||||||
{
|
{
|
||||||
// Alter dbg_pause bit state (disable->enable, enable->disable)
|
// If paused, unpause.
|
||||||
const auto old = cpu->state.xor_fetch(cpu_flag::dbg_pause);
|
// If not paused, add dbg_pause.
|
||||||
|
const auto old = cpu->state.atomic_op([](bs_t<cpu_flag>& state)
|
||||||
|
{
|
||||||
|
if (state & s_pause_flags)
|
||||||
|
{
|
||||||
|
state -= s_pause_flags;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
state += cpu_flag::dbg_pause;
|
||||||
|
}
|
||||||
|
|
||||||
|
return state;
|
||||||
|
});
|
||||||
|
|
||||||
// Notify only if no pause flags are set after this change
|
// Notify only if no pause flags are set after this change
|
||||||
if (!(old & (cpu_flag::dbg_pause + cpu_flag::dbg_global_pause)))
|
if (!(old & s_pause_flags))
|
||||||
{
|
{
|
||||||
cpu->notify();
|
cpu->notify();
|
||||||
}
|
}
|
||||||
|
@ -441,7 +456,7 @@ void debugger_frame::UpdateUI()
|
||||||
m_last_pc = cia;
|
m_last_pc = cia;
|
||||||
DoUpdate();
|
DoUpdate();
|
||||||
|
|
||||||
if (cpu->state & cpu_flag::dbg_pause)
|
if (cpu->state & s_pause_flags)
|
||||||
{
|
{
|
||||||
m_btn_run->setText(RunString);
|
m_btn_run->setText(RunString);
|
||||||
m_btn_step->setEnabled(true);
|
m_btn_step->setEnabled(true);
|
||||||
|
@ -725,13 +740,7 @@ void debugger_frame::DoStep(bool stepOver)
|
||||||
{
|
{
|
||||||
bool should_step_over = stepOver && cpu->id_type() == 1;
|
bool should_step_over = stepOver && cpu->id_type() == 1;
|
||||||
|
|
||||||
if (+cpu_flag::dbg_pause & +cpu->state.fetch_op([&](bs_t<cpu_flag>& state)
|
if (cpu->state & s_pause_flags)
|
||||||
{
|
|
||||||
if (!should_step_over)
|
|
||||||
state += cpu_flag::dbg_step;
|
|
||||||
|
|
||||||
state -= cpu_flag::dbg_pause;
|
|
||||||
}))
|
|
||||||
{
|
{
|
||||||
if (should_step_over)
|
if (should_step_over)
|
||||||
{
|
{
|
||||||
|
@ -751,6 +760,13 @@ void debugger_frame::DoStep(bool stepOver)
|
||||||
m_last_step_over_breakpoint = next_instruction_pc;
|
m_last_step_over_breakpoint = next_instruction_pc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cpu->state.atomic_op([&](bs_t<cpu_flag>& state)
|
||||||
|
{
|
||||||
|
state -= s_pause_flags;
|
||||||
|
|
||||||
|
if (!should_step_over) state += cpu_flag::dbg_step;
|
||||||
|
});
|
||||||
|
|
||||||
cpu->notify();
|
cpu->notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue