mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Kernel: Update registers in tracer when attaching to a stopped thread
This commit is contained in:
parent
0f3e1668bb
commit
7544b35694
Notes:
sideshowbarker
2024-07-17 03:35:24 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/7544b35694 Pull-request: https://github.com/SerenityOS/serenity/pull/17362
|
@ -56,7 +56,9 @@ static ErrorOr<FlatPtr> handle_ptrace(Kernel::Syscall::SC_ptrace_params const& p
|
|||
}
|
||||
TRY(peer_process.start_tracing_from(caller.pid()));
|
||||
SpinlockLocker lock(peer->get_lock());
|
||||
if (peer->state() != Thread::State::Stopped) {
|
||||
if (peer->state() == Thread::State::Stopped) {
|
||||
peer_process.tracer()->set_regs(peer->get_register_dump_from_stack());
|
||||
} else {
|
||||
peer->send_signal(SIGSTOP, &caller);
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue