Use flag rather than instruction count to handle step mode.

This commit is contained in:
Jarek Syrylak
2018-07-27 10:12:40 +01:00
parent 035e893c5b
commit 0017aff7fb
2 changed files with 2 additions and 2 deletions

View File

@@ -237,7 +237,7 @@ void ARM_Unicorn::ExecuteInstructions(int num_instructions) {
//} //}
Kernel::Thread* thread = Kernel::GetCurrentThread(); Kernel::Thread* thread = Kernel::GetCurrentThread();
SaveContext(thread->context); SaveContext(thread->context);
if (last_bkpt_hit || (num_instructions == 1)) { if (last_bkpt_hit || GDBStub::GetCpuStepFlag()) {
last_bkpt_hit = false; last_bkpt_hit = false;
GDBStub::Break(); GDBStub::Break();
GDBStub::SendTrap(thread, 5); GDBStub::SendTrap(thread, 5);

View File

@@ -63,7 +63,6 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
// execute. Otherwise, get out of the loop function. // execute. Otherwise, get out of the loop function.
if (GDBStub::GetCpuHaltFlag()) { if (GDBStub::GetCpuHaltFlag()) {
if (GDBStub::GetCpuStepFlag()) { if (GDBStub::GetCpuStepFlag()) {
GDBStub::SetCpuStepFlag(false);
tight_loop = false; tight_loop = false;
} else { } else {
return ResultStatus::Success; return ResultStatus::Success;
@@ -81,6 +80,7 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
if(GDBStub::IsServerEnabled()) if(GDBStub::IsServerEnabled())
{ {
GDBStub::SetCpuStepFlag(false);
GDBStub::SetInstCacheValidity(true); GDBStub::SetInstCacheValidity(true);
} }