mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-23 18:19:21 +01:00
gdbstub: Fix some gdbstub jankiness
1. Ensure that register information available to gdbstub is most up-to-date. 2. There's no reason to check for current_thread == thread when emitting a trap. Doing this results in random hangs whenever a step happens upon a thread switch.
This commit is contained in:
parent
3b1b8b7e1f
commit
d17ab5cd91
@ -50,6 +50,10 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GDBStub::IsServerEnabled()) {
|
if (GDBStub::IsServerEnabled()) {
|
||||||
|
Kernel::Thread* thread = kernel->GetCurrentThreadManager().GetCurrentThread();
|
||||||
|
if (thread && running_core) {
|
||||||
|
running_core->SaveContext(thread->context);
|
||||||
|
}
|
||||||
GDBStub::HandlePacket();
|
GDBStub::HandlePacket();
|
||||||
|
|
||||||
// If the loop is halted and we want to step, use a tiny (1) number of instructions to
|
// If the loop is halted and we want to step, use a tiny (1) number of instructions to
|
||||||
|
@ -1264,10 +1264,9 @@ void SendTrap(Kernel::Thread* thread, int trap) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!halt_loop || current_thread == thread) {
|
current_thread = thread;
|
||||||
current_thread = thread;
|
SendSignal(thread, trap);
|
||||||
SendSignal(thread, trap);
|
|
||||||
}
|
|
||||||
halt_loop = true;
|
halt_loop = true;
|
||||||
send_trap = false;
|
send_trap = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user