mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 18:46:18 +00:00
Kernel: Update registers in tracer when attaching to a stopped thread
This commit is contained in:
parent
0f3e1668bb
commit
7544b35694
|
@ -56,7 +56,9 @@ static ErrorOr<FlatPtr> handle_ptrace(Kernel::Syscall::SC_ptrace_params const& p
|
||||||
}
|
}
|
||||||
TRY(peer_process.start_tracing_from(caller.pid()));
|
TRY(peer_process.start_tracing_from(caller.pid()));
|
||||||
SpinlockLocker lock(peer->get_lock());
|
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);
|
peer->send_signal(SIGSTOP, &caller);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue