mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-05 22:17:09 +02:00
[core/debugger] Protocol-compliant vCont support (#3896)
(gdb) set scheduler-locking on (gdb) continue As discussed in #3848, follow-up to implement vCont support according to spec. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3896 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
89199f4d27
commit
aadcc24aac
4 changed files with 169 additions and 35 deletions
|
|
@ -247,17 +247,19 @@ private:
|
|||
case DebuggerAction::Continue:
|
||||
MarkResumed([&] { ResumeEmulation(); });
|
||||
break;
|
||||
case DebuggerAction::StepThreadUnlocked:
|
||||
MarkResumed([&] {
|
||||
state->active_thread->SetStepState(Kernel::StepState::StepPending);
|
||||
state->active_thread->Resume(Kernel::SuspendType::Debug);
|
||||
ResumeEmulation(state->active_thread.GetPointerUnsafe());
|
||||
case DebuggerAction::ContinueThreads: {
|
||||
auto* gdb = static_cast<GDBStub*>(frontend.get());
|
||||
MarkResumed([this, threads = std::move(gdb->resume_threads)] {
|
||||
ResumeThreads(threads);
|
||||
});
|
||||
break;
|
||||
case DebuggerAction::StepThreadLocked: {
|
||||
MarkResumed([&] {
|
||||
}
|
||||
case DebuggerAction::StepThread: {
|
||||
auto* gdb = static_cast<GDBStub*>(frontend.get());
|
||||
MarkResumed([this, threads = std::move(gdb->resume_threads)] {
|
||||
state->active_thread->SetStepState(Kernel::StepState::StepPending);
|
||||
state->active_thread->Resume(Kernel::SuspendType::Debug);
|
||||
ResumeThreads(threads, state->active_thread.GetPointerUnsafe());
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
@ -298,6 +300,22 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void ResumeThreads(const std::vector<Kernel::KThread*>& threads,
|
||||
Kernel::KThread* except = nullptr) {
|
||||
Kernel::KScopedLightLock ll{debug_process->GetListLock()};
|
||||
Kernel::KScopedSchedulerLock sl{system.Kernel()};
|
||||
|
||||
// Wake up only the specified threads.
|
||||
for (auto* thread : threads) {
|
||||
if (!thread || thread == except) {
|
||||
continue;
|
||||
}
|
||||
|
||||
thread->SetStepState(Kernel::StepState::NotStepping);
|
||||
thread->Resume(Kernel::SuspendType::Debug);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Callback>
|
||||
void MarkResumed(Callback&& cb) {
|
||||
stopped = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue