A system call responsible for a process attaching itself to another process: ptrace.
sudo dtrace -ln 'syscall:::entry'
sudo dtrace -qn 'syscall::ptrace:entry { printf("%s(%d, %d, %d, %d) from %s\n", probefunc, arg0, arg1, arg2, arg3, execname); }
lldb -n Finder
pgrep debugserver
ps -fp `pgrep -x debugserver`
ps -o ppid= $(pgrep -x debugserver)
ps -a 856
sudo lldb -n "<program name>" -w
rb ptrace -s libsystem_kernel.dylib
continue
thread return 0