mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
Kernel: Emit systrace events for exit, thread_exit and sigreturn.
Since these syscalls don't return to caller, we have to emit the trace events manually.
This commit is contained in:
parent
4508287cb2
commit
25ddcd1022
1 changed files with 6 additions and 0 deletions
|
@ -115,11 +115,15 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
|
||||||
return current->process().sys$gethostname((char*)arg1, (size_t)arg2);
|
return current->process().sys$gethostname((char*)arg1, (size_t)arg2);
|
||||||
case Syscall::SC_exit:
|
case Syscall::SC_exit:
|
||||||
cli();
|
cli();
|
||||||
|
if (auto* tracer = current->process().tracer())
|
||||||
|
tracer->did_syscall(function, arg1, arg2, arg3, 0);
|
||||||
current->process().sys$exit((int)arg1);
|
current->process().sys$exit((int)arg1);
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
return 0;
|
return 0;
|
||||||
case Syscall::SC_exit_thread:
|
case Syscall::SC_exit_thread:
|
||||||
cli();
|
cli();
|
||||||
|
if (auto* tracer = current->process().tracer())
|
||||||
|
tracer->did_syscall(function, arg1, arg2, arg3, 0);
|
||||||
current->process().sys$exit_thread((int)arg1);
|
current->process().sys$exit_thread((int)arg1);
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
break;
|
break;
|
||||||
|
@ -170,6 +174,8 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
|
||||||
case Syscall::SC_setgroups:
|
case Syscall::SC_setgroups:
|
||||||
return current->process().sys$setgroups((ssize_t)arg1, (const gid_t*)arg2);
|
return current->process().sys$setgroups((ssize_t)arg1, (const gid_t*)arg2);
|
||||||
case Syscall::SC_sigreturn:
|
case Syscall::SC_sigreturn:
|
||||||
|
if (auto* tracer = current->process().tracer())
|
||||||
|
tracer->did_syscall(function, arg1, arg2, arg3, 0);
|
||||||
current->process().sys$sigreturn();
|
current->process().sys$sigreturn();
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue