mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 22:05:07 +00:00
Kernel: Update stored registers in a thread's tracer on SIGSTOP
This is needed so we can retrieve the registers of a traced thread that was attached to while it was running. Attaching with ptrace to a running thread sends SIGSTOP to it.
This commit is contained in:
parent
7544b35694
commit
ddec9cb1f0
1 changed files with 2 additions and 0 deletions
|
@ -958,6 +958,8 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
|||
auto* tracer = process.tracer();
|
||||
if (signal == SIGSTOP || (tracer && default_signal_action(signal) == DefaultSignalAction::DumpCore)) {
|
||||
dbgln_if(SIGNAL_DEBUG, "Signal {} stopping this thread", signal);
|
||||
if (tracer)
|
||||
tracer->set_regs(get_register_dump_from_stack());
|
||||
set_state(Thread::State::Stopped, signal);
|
||||
return DispatchSignalResult::Yield;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue