Lines Matching refs:tracee
1319 pid_t tracee, int status, void *args);
1321 void start_tracer(struct __test_metadata *_metadata, int fd, pid_t tracee, in start_tracer() argument
1335 ret = ptrace(PTRACE_ATTACH, tracee, NULL, 0); in start_tracer()
1337 kill(tracee, SIGKILL); in start_tracer()
1342 ret = ptrace(PTRACE_SETOPTIONS, tracee, NULL, ptrace_syscall ? in start_tracer()
1347 kill(tracee, SIGKILL); in start_tracer()
1350 tracee, NULL, 0); in start_tracer()
1361 if (wait(&status) != tracee) in start_tracer()
1370 tracer_func(_metadata, tracee, status, args); in start_tracer()
1373 tracee, NULL, 0); in start_tracer()
1389 pid_t tracee = getpid(); in setup_trace_fixture() local
1400 start_tracer(_metadata, pipefd[1], tracee, func, args, in setup_trace_fixture()
1432 void tracer_poke(struct __test_metadata *_metadata, pid_t tracee, int status, in tracer_poke() argument
1439 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_poke()
1443 kill(tracee, SIGKILL); in tracer_poke()
1450 ret = ptrace(PTRACE_POKEDATA, tracee, info->poke_addr, 0x1001); in tracer_poke()
1577 int get_syscall(struct __test_metadata *_metadata, pid_t tracee) in get_syscall() argument
1581 EXPECT_EQ(0, ptrace(PTRACE_GETREGS, tracee, 0, ®s)) { in get_syscall()
1590 EXPECT_EQ(0, ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov)) { in get_syscall()
1605 pid_t tracee, int syscall) in change_syscall() argument
1610 ret = ptrace(PTRACE_GETREGS, tracee, 0, ®s); in change_syscall()
1615 ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov); in change_syscall()
1637 ret = ptrace(PTRACE_SET_SYSCALL, tracee, NULL, syscall); in change_syscall()
1648 ret = ptrace(PTRACE_SETREGSET, tracee, NT_ARM_SYSTEM_CALL, in change_syscall()
1668 ret = ptrace(PTRACE_SETREGS, tracee, 0, ®s); in change_syscall()
1672 ret = ptrace(PTRACE_SETREGSET, tracee, NT_PRSTATUS, &iov); in change_syscall()
1677 void tracer_syscall(struct __test_metadata *_metadata, pid_t tracee, in tracer_syscall() argument
1684 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_syscall()
1691 EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee)); in tracer_syscall()
1692 change_syscall(_metadata, tracee, __NR_getppid); in tracer_syscall()
1696 EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee)); in tracer_syscall()
1697 change_syscall(_metadata, tracee, -1); in tracer_syscall()
1701 EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee)); in tracer_syscall()
1706 kill(tracee, SIGKILL); in tracer_syscall()
1712 void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee, in tracer_ptrace() argument
1720 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_ptrace()
1729 nr = get_syscall(_metadata, tracee); in tracer_ptrace()
1732 change_syscall(_metadata, tracee, __NR_getppid); in tracer_ptrace()
1734 change_syscall(_metadata, tracee, -1); in tracer_ptrace()