debugger: Fix single stepping (#9793)

This commit is contained in:
Eladash 2021-02-19 13:53:09 +02:00 committed by GitHub
parent e76d8eb046
commit 20eb4352fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 11 deletions

View file

@ -825,7 +825,7 @@ void debugger_frame::DoStep(bool stepOver)
{
bool should_step_over = stepOver && cpu->id_type() == 1;
if (cpu->state & s_pause_flags)
if (auto _state = +cpu->state; _state & s_pause_flags && _state & cpu_flag::wait && !(_state & cpu_flag::dbg_step))
{
if (should_step_over)
{
@ -849,7 +849,14 @@ void debugger_frame::DoStep(bool stepOver)
{
state -= s_pause_flags;
if (!should_step_over) state += cpu_flag::dbg_step;
if (!should_step_over)
{
if (u32* ptr = cpu->get_pc2())
{
state += cpu_flag::dbg_step;
*ptr = cpu->get_pc();
}
}
});
cpu->state.notify_one(s_pause_flags);