Use flag rather than instruction count to handle step mode.
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user