diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index c5946611f1..8b6da233a2 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp @@ -237,7 +237,7 @@ void ARM_Unicorn::ExecuteInstructions(int num_instructions) { //} Kernel::Thread* thread = Kernel::GetCurrentThread(); SaveContext(thread->context); - if (last_bkpt_hit || (num_instructions == 1)) { + if (last_bkpt_hit || GDBStub::GetCpuStepFlag()) { last_bkpt_hit = false; GDBStub::Break(); GDBStub::SendTrap(thread, 5); diff --git a/src/core/core.cpp b/src/core/core.cpp index 595cf7fa24..4c6b81ed83 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -63,7 +63,6 @@ System::ResultStatus System::RunLoop(bool tight_loop) { // execute. Otherwise, get out of the loop function. if (GDBStub::GetCpuHaltFlag()) { if (GDBStub::GetCpuStepFlag()) { - GDBStub::SetCpuStepFlag(false); tight_loop = false; } else { return ResultStatus::Success; @@ -81,6 +80,7 @@ System::ResultStatus System::RunLoop(bool tight_loop) { if(GDBStub::IsServerEnabled()) { + GDBStub::SetCpuStepFlag(false); GDBStub::SetInstCacheValidity(true); }