Home
last modified time | relevance | path

Searched refs:ptrace (Results 1 – 25 of 58) sorted by relevance

123

/freebsd/tests/sys/kern/
H A Dptrace_test.c126 CHILD_REQUIRE(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in trace_me()
138 REQUIRE_EQ(ptrace(PT_ATTACH, pid, NULL, 0), 0); in attach_child()
205 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); in ATF_TC_BODY()
249 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); in ATF_TC_BODY()
299 CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); in ATF_TC_BODY()
306 CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); in ATF_TC_BODY()
405 CHILD_REQUIRE(ptrace(PT_ATTACH, child, NULL, 0) != -1); in ATF_TC_BODY()
412 CHILD_REQUIRE(ptrace(PT_CONTINUE, child, (caddr_t)1, 0) != -1); in ATF_TC_BODY()
512 REQUIRE_EQ(ptrace(PT_ATTACH, gchild, NULL, 0), 0); in ATF_TC_BODY()
526 REQUIRE_EQ(ptrace(PT_DETACH, gchild, (caddr_t)1, 0), 0); in ATF_TC_BODY()
[all …]
H A Dpdeathsig.c290 rc = ptrace(PT_ATTACH, c_pid, 0, 0); in ATF_TC_BODY()
297 rc = ptrace(PT_CONTINUE, c_pid, (caddr_t) 1, 0); in ATF_TC_BODY()
311 rc = ptrace(PT_CONTINUE, c_pid, (caddr_t) 1, in ATF_TC_BODY()
317 ptrace(PT_DETACH, c_pid, 0, 0); in ATF_TC_BODY()
/freebsd/contrib/netbsd-tests/kernel/
H A Dt_ptrace_wait.c91 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
108 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
150 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
175 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigsent) != -1); in ATF_TC_BODY()
205 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
223 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, sigsent) != -1); in ATF_TC_BODY()
254 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
274 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
283 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
327 FORKEE_ASSERT(ptrace(PT_ATTACH, tracee, NULL, 0) != -1); in ATF_TC_BODY()
[all …]
H A Dt_ptrace.c79 ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 0, NULL, 0) == -1); in ATF_TC_BODY()
93 ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 1, NULL, 0) == -1); in ATF_TC_BODY()
118 ATF_REQUIRE_ERRNO(EPERM, ptrace(PT_ATTACH, 1, NULL, 0) == -1); in ATF_TC_BODY()
130 ATF_REQUIRE_ERRNO(EINVAL, ptrace(PT_ATTACH, getpid(), NULL, 0) == -1); in ATF_TC_BODY()
172 ptrace(PT_ATTACH, getppid(), NULL, 0) == -1); in ATF_TC_BODY()
/freebsd/tools/test/ptrace/
H A Dscescx.c193 error = ptrace(PT_GET_SC_ARGS, lwpinfo->pl_lwpid, in wait_info()
224 if (ptrace(PT_TO_SCE, pid, (caddr_t)1, 0) < 0) { in trace_sc()
226 ptrace(PT_KILL, pid, NULL, 0); in trace_sc()
241 if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { in trace_sc()
243 ptrace(PT_KILL, pid, NULL, 0); in trace_sc()
249 if (ptrace(PT_TO_SCX, pid, (caddr_t)1, 0) < 0) { in trace_sc()
251 ptrace(PT_KILL, pid, NULL, 0); in trace_sc()
266 if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { in trace_sc()
268 ptrace(PT_KILL, pid, NULL, 0); in trace_sc()
278 if (ptrace(PT_SC_REMOTE, pid, (caddr_t)&pscr, in trace_sc()
[all …]
/freebsd/contrib/netbsd-tests/kernel/arch/amd64/
H A Dt_ptrace_wait.c80 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
96 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1); in ATF_TC_BODY()
129 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
163 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
179 ATF_REQUIRE((N = ptrace(PT_COUNT_WATCHPOINTS, child, NULL, 0)) != -1); in ATF_TC_BODY()
186 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
222 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
238 ATF_REQUIRE((N = ptrace(PT_COUNT_WATCHPOINTS, child, NULL, 0)) != -1); in ATF_TC_BODY()
245 ATF_REQUIRE(ptrace(PT_READ_WATCHPOINT, child, &pw, len) != -1); in ATF_TC_BODY()
259 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
[all …]
/freebsd/tools/test/stress2/misc/
H A Dptrace.sh35 sed '1,/^EOF/d' < $here/$0 > ptrace.c
36 mycc -o ptrace -Wall -Wextra -g ptrace.c || exit 1
37 rm -f ptrace.c
40 /tmp/ptrace
42 rm -f /tmp/ptrace
71 if (ptrace(PT_ATTACH, pid, NULL, 0) == -1)
85 if (ptrace(PT_DETACH, pid, NULL, 0) == -1)
H A Dptrace2.sh67 ptrace(PT_ATTACH, pid, (caddr_t) 0, 0);
75 ptrace(PT_DETACH, pid, (caddr_t) 1, 0);
112 ptrace(PT_ATTACH, pid, (caddr_t) 0, 0);
118 ptrace(PT_CONTINUE, pid, (caddr_t) 1, 0);
H A Dptrace9.sh96 if (ptrace(PT_ATTACH, pid, NULL, 0) != 0)
103 if (ptrace(PT_DETACH, pid, NULL, 0) != 0)
106 /* if ptrace works as expected, we'll block here */
H A Dptrace8.sh92 if (ptrace(PT_ATTACH, pid, 0, 0) == -1)
104 r = ptrace(PT_VM_ENTRY, pid, (caddr_t)&ent, 0);
115 if (ptrace(PT_DETACH, pid, 0, 0) == -1)
H A Dvfork.sh50 if (ptrace(PT_TRACE_ME, 0, 0, 0) == -1)
92 if (ptrace(PT_ATTACH, pid, NULL, 0) == -1)
103 if (ptrace(PT_DETACH, pid, NULL, 0) == -1)
H A Dptrace11.sh90 if (ptrace(PT_ATTACH, pida, NULL, 0) != 0)
95 if (ptrace(PT_DETACH, pida, NULL, 0) != 0)
H A Dptrace10.sh116 if (ptrace(PT_ATTACH, pid, NULL, 0) != 0)
123 if (ptrace(PT_DETACH, pid, NULL, 0) != 0)
H A Dptrace5.sh95 if (ptrace(PT_ATTACH, pid, 0, 0) == -1)
102 if (ptrace(PT_DETACH, pid, 0, 0) == -1)
H A Dptrace6.sh95 if (ptrace(PT_ATTACH, pid, 0, 0) == -1)
104 if (ptrace(PT_DETACH, pid, 0, 0) == -1)
/freebsd/tools/test/popss/
H A Dpopss.c38 #include <sys/ptrace.h>
62 error = ptrace(PT_GETREGS, child, (caddr_t)&r, 0); in setup()
64 err(1, "ptrace PT_GETREGS"); in setup()
67 error = ptrace(PT_GETDBREGS, child, (caddr_t)&dbr, 0); in setup()
69 err(1, "ptrace PT_GETDBREGS"); in setup()
74 error = ptrace(PT_SETDBREGS, child, (caddr_t)&dbr, 0); in setup()
76 err(1, "ptrace PT_SETDBREGS"); in setup()
77 error = ptrace(PT_CONTINUE, child, (caddr_t)1, 0); in setup()
79 err(1, "ptrace PT_CONTINUE fire"); in setup()
87 error = ptrace(PT_GETREG in setup()
[all...]
/freebsd/lib/libproc/
H A Dproc_util.c72 if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1, in proc_continue()
96 if (ptrace(request, pid, 0, 0) != 0 && errno == EBUSY) { in proc_detach()
99 ptrace(request, pid, 0, 0); in proc_detach()
201 if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) in proc_read()
215 if (ptrace(PT_LWPINFO, proc_getpid(phdl), (caddr_t)&lwpinfo, in proc_getlwpstatus()
/freebsd/usr.bin/truss/
H A Dsetup.c156 ptrace(PT_TRACE_ME, 0, 0, 0); in setup_and_wait()
178 ret = ptrace(PT_ATTACH, pid, NULL, 0); in start_tracing()
221 if (ptrace(PT_CONTINUE, pid, (caddr_t)1, sig) < 0) in detach_proc()
225 if (ptrace(PT_DETACH, pid, (caddr_t)1, 0) < 0) in detach_proc()
300 nlwps = ptrace(PT_GETNUMLWPS, p->pid, NULL, 0); in add_threads()
305 nlwps = ptrace(PT_GETLWPLIST, p->pid, (caddr_t)lwps, nlwps); in add_threads()
310 if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) in add_threads()
335 if (ptrace(PT_FOLLOW_FORK, pid, NULL, 1) == -1) in new_proc()
337 if (ptrace(PT_LWP_EVENTS, pid, NULL, 1) == -1) in new_proc()
461 if (narg != 0 && ptrace(PT_GET_SC_ARGS, t->tid, (caddr_t)t->cs.args, in enter_syscall()
[all …]
H A Dmain.c185 ptrace(PT_DETACH, LIST_FIRST(&trussinfo->proclist)->pid, NULL, in main()
189 ptrace(PT_SYSCALL, LIST_FIRST(&trussinfo->proclist)->pid, (caddr_t)1, in main()
/freebsd/contrib/netbsd-tests/kernel/arch/i386/
H A Dt_ptrace_wait.c79 FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); in ATF_TC_BODY()
95 ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1); in ATF_TC_BODY()
121 ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); in ATF_TC_BODY()
/freebsd/usr.bin/gcore/
H A Delfcore.c168 ptrace(PT_DETACH, g_pid, (caddr_t)1, sig); in elf_detach()
192 ptrace(PT_ATTACH, pid, NULL, 0); in elf_coredump()
255 ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); in elf_coredump()
343 threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); in elf_putnotes()
350 ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); in elf_putnotes()
412 if (ptrace(PT_GETREGSET, tid, (void *)&iov, type) != 0) in elf_putregnote()
417 if (ptrace(PT_GETREGSET, tid, (void *)&iov, type) != 0) in elf_putregnote()
687 if (ptrace(PT_GETXSTATE_INFO, tid, (void *)&info, in elf_note_x86_xstate()
697 ptrace(PT_GETXSTATE, tid, xstate, 0); in elf_note_x86_xstate()
715 if (ptrace(PT_GETVRREGS, tid, (void *)&info, in elf_note_powerpc_vmx()
[all …]
H A Dgcore.c93 error = ptrace(PT_ATTACH, pid, NULL, 0); in kcoredump()
105 error = ptrace(PT_COREDUMP, pid, (void *)&pc, sizeof(pc)); in kcoredump()
117 error = ptrace(PT_DETACH, pid, NULL, 0); in kcoredump()
/freebsd/tests/sys/vm/
H A Dmlock_test.c57 if (ptrace(PT_TRACE_ME, 0, NULL, 0) != 0) in test_wired_copy_on_write()
73 val = ptrace(PT_READ_D, pid, addr, 0); in test_wired_copy_on_write()
75 ATF_REQUIRE(ptrace(PT_WRITE_D, pid, addr, val) == 0); in test_wired_copy_on_write()
76 ATF_REQUIRE(ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) == 0); in test_wired_copy_on_write()
/freebsd/contrib/llvm-project/compiler-rt/lib/tsan/rtl/
H A Dtsan_rtl_report.cpp841 auto *ptrace = New<BufferedStackTrace>(); in PrintCurrentStackSlow() local
842 ptrace->Unwind(pc, bp, nullptr, false); in PrintCurrentStackSlow()
844 for (uptr i = 0; i < ptrace->size / 2; i++) { in PrintCurrentStackSlow()
845 uptr tmp = ptrace->trace_buffer[i]; in PrintCurrentStackSlow()
846 ptrace->trace_buffer[i] = ptrace->trace_buffer[ptrace->size - i - 1]; in PrintCurrentStackSlow()
847 ptrace->trace_buffer[ptrace->size - i - 1] = tmp; in PrintCurrentStackSlow()
849 PrintStack(SymbolizeStack(*ptrace)); in PrintCurrentStackSlow()
/freebsd/tools/test/
H A DREADME21 ptrace Verify that ptrace works with syscalls, vfork etc.

123