Home
last modified time | relevance | path

Searched refs:ptrace (Results 1 - 25 of 67) sorted by relevance

123

/third_party/rust/crates/nix/test/sys/
H A Dtest_ptrace.rs8 use nix::sys::ptrace;
10 use nix::sys::ptrace::Options;
20 // Just make sure ptrace can be called at all, for now. in test_ptrace()
21 // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS in test_ptrace()
23 let err = ptrace::attach(getpid()).unwrap_err(); in test_ptrace()
34 let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD) in test_ptrace_setoptions()
44 let err = ptrace::getevent(getpid()).unwrap_err(); in test_ptrace_getevent()
53 if let Err(Errno::EOPNOTSUPP) = ptrace::getsiginfo(getpid()) { in test_ptrace_getsiginfo()
64 if let Err(Errno::EOPNOTSUPP) = ptrace::setsiginfo(getpid(), &siginfo) { in test_ptrace_setsiginfo()
71 use nix::sys::ptrace; in test_ptrace_cont()
[all...]
H A Dtest_wait.rs144 // FIXME: qemu-user doesn't implement ptrace on most arches
146 mod ptrace { modules
149 use nix::sys::ptrace::{self, Event, Options};
156 ptrace::traceme().unwrap(); in ptrace_child()
157 // As recommended by ptrace(2), raise SIGTRAP to pause the child in ptrace_child()
170 ptrace::setoptions( in ptrace_wait_parent()
177 ptrace::syscall(child, None).expect("syscall failed"); in ptrace_wait_parent()
179 // Then get the ptrace event for the process exiting in ptrace_wait_parent()
180 ptrace::cont(child, None).expect("cont failed"); in ptrace_wait_parent()
190 ptrace in ptrace_wait_parent()
[all...]
/third_party/libunwind/libunwind/src/ptrace/
H A D_UPT_access_reg.c66 if (ptrace (PTRACE_GETREGSET, pid, NT_PRSTATUS, &loc) == -1) in _UPT_access_reg()
70 if (ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS, &loc) == -1) in _UPT_access_reg()
100 /* The Linux ptrace represents the statc NaT bits as a single word. */ in _UPT_access_reg()
106 nat_bits = ptrace (PTRACE_PEEKUSER, pid, PT_NAT_BITS, 0); in _UPT_access_reg()
121 ptrace (PTRACE_POKEUSER, pid, PT_NAT_BITS, nat_bits); in _UPT_access_reg()
146 psr = ptrace (PTRACE_PEEKUSER, pid, PT_CR_IPSR, 0); in _UPT_access_reg()
158 ptrace (PTRACE_POKEUSER, pid, PT_CR_IIP, ip); in _UPT_access_reg()
159 ptrace (PTRACE_POKEUSER, pid, PT_CR_IPSR, psr); in _UPT_access_reg()
170 ip = ptrace (PTRACE_PEEKUSER, pid, PT_CR_IIP, 0); in _UPT_access_reg()
191 /* Account for the fact that ptrace() expect in _UPT_access_reg()
[all...]
H A D_UPT_access_fpreg.c49 ptrace (PTRACE_POKEUSER, pid, _UPT_reg_offset[reg] + i * sizeof(wp[i]), in _UPT_access_fpreg()
61 wp[i] = ptrace (PTRACE_PEEKUSER, pid, in _UPT_access_fpreg()
99 if (ptrace(PT_GETFPREGS, pid, (caddr_t)&fpreg, 0) == -1) in _UPT_access_fpreg()
115 if (ptrace(PT_SETFPREGS, pid, (caddr_t)&fpreg, 0) == -1) in _UPT_access_fpreg()
H A D_UPT_access_mem.c45 // return value, but ptrace only returns a 32-bit value in _UPT_access_mem()
69 ptrace (PTRACE_POKEDATA, pid, tmp_addr, tmp_val); in _UPT_access_mem()
79 tmp_val = (unsigned long) ptrace (PTRACE_PEEKDATA, pid, tmp_addr, 0); in _UPT_access_mem()
115 if (ptrace(PT_IO, pid, (caddr_t)&iod, 0) == -1) in _UPT_access_mem()
H A D_UPT_resume.c36 return ptrace (PTRACE_CONT, ui->pid, 0, 0); in _UPT_resume()
38 return ptrace(PT_CONTINUE, ui->pid, (caddr_t)1, 0); in _UPT_resume()
H A D_UPT_internal.h37 #include <sys/ptrace.h>
44 #include <libunwind-ptrace.h>
/third_party/libunwind/libunwind/tests/
H A Dtest-ptrace.c41 #include <libunwind-ptrace.h>
48 #include <sys/ptrace.h>
225 ptrace (PTRACE_TRACEME, 0, 0, 0); in main()
227 ptrace (PT_TRACE_ME, 0, 0, 0); in main()
305 ptrace (PTRACE_CONT, target_pid, 0, 0); in main()
307 ptrace (PT_CONTINUE, target_pid, (caddr_t)1, 0); in main()
315 if (ptrace (PTRACE_SINGLESTEP, target_pid, 0, pending_sig) < 0) in main()
317 panic ("ptrace(PTRACE_SINGLESTEP) failed (errno=%d)\n", errno); in main()
321 if (ptrace (PT_STEP, target_pid, (caddr_t)1, pending_sig) < 0) in main()
323 panic ("ptrace(PT_STE in main()
[all...]
/third_party/elfutils/backends/
H A Dsparc_initreg.c36 # include <asm/ptrace.h>
37 # include <sys/ptrace.h>
60 if (ptrace (PTRACE_GETREGS, tid, &regs, 0) == -1) in set_initial_registers_tid()
94 locals_outs[i] = ptrace (PTRACE_PEEKDATA, tid, in set_initial_registers_tid()
107 Dwarf_Word tuple = ptrace (PTRACE_PEEKDATA, tid, in set_initial_registers_tid()
H A Darm_initreg.c37 # include <sys/ptrace.h>
43 # include <sys/ptrace.h>
64 if (ptrace (PTRACE_GETREGS, tid, NULL, &user_regs) != 0) in arm_set_initial_registers_tid()
80 if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0) in arm_set_initial_registers_tid()
H A Dppc_initreg.c36 # include <sys/ptrace.h>
37 # include <asm/ptrace.h>
39 # include <linux/ptrace.h>
109 if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0) in ppc_set_initial_registers_tid()
H A Daarch64_initreg.c38 # include <sys/ptrace.h>
63 if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0) in aarch64_set_initial_registers_tid()
80 if (ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec) != 0) in aarch64_set_initial_registers_tid()
H A Ds390_initreg.c37 # include <sys/ptrace.h>
38 # include <asm/ptrace.h>
57 if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea, NULL) != 0) in s390_set_initial_registers_tid()
H A Driscv_initreg.c37 # include <sys/ptrace.h>
57 if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec) != 0) in riscv_set_initial_registers_tid()
/third_party/libunwind/libunwind/doc/
H A Dlibunwind-ptrace.tex8 \begin{Name}{3}{libunwind-ptrace}{David Mosberger-Tang}{Programming Library}{ptrace() support in libunwind}libunwind-ptrace -- ptrace() support in libunwind
13 \File{\#include $<$libunwind-ptrace.h$>$}\\
41 The \Func{ptrace}(2) system-call makes it possible for a process to
45 \Func{ptrace}(2). While it's not very difficult to do so directly,
49 stands for ``unwind-via-ptrace''.
68 Next, the application can turn on ptrace-mode on the target process,
80 the target process. It simply invokes \Func{ptrace}(
[all...]
/third_party/ltp/testcases/kernel/controllers/freezer/
H A Dvfork.c27 * so we use ptrace vfork'd processes in order to pause then during each
44 #include "../../syscalls/ptrace/ptrace.h"
82 if (ptrace(PTRACE_KILL, child, NULL, NULL) < 0) { in kill_child()
84 "ptrace(PTRACE_KILL, %d, ..) failed", child); in kill_child()
207 if (ptrace(PTRACE_GETSIGINFO, gchild, NULL, &info) == -1) { in trace_grandchild()
208 debug("ptrace(): "); in trace_grandchild()
222 if (ptrace(PTRACE_DETACH, gchild, NULL, NULL) == -1) in trace_grandchild()
223 debug("ptrace(): "); in trace_grandchild()
254 if (ptrace(PTRACE_CON in do_trace()
[all...]
/third_party/ltp/testcases/kernel/syscalls/ptrace/
H A Dptrace.h2 * ptrace is a fickle beast and each arch sucks in a different way
9 # include <sys/ptrace.h>
19 # include <asm/ptrace.h>
23 # include <linux/ptrace.h>
H A Dptrace08.c8 * Test error handling when ptrace(POKEUSER) modified x86 debug registers even
40 #include <sys/ptrace.h>
87 TEST(ptrace(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
92 addr = ptrace(PTRACE_PEEKUSER, child_pid, in ptrace_try_kern_addr()
95 TEST(ptrace(PTRACE_POKEUSER, child_pid, in ptrace_try_kern_addr()
101 tst_res(TFAIL, "ptrace() breakpoint with kernel addr succeeded"); in ptrace_try_kern_addr()
105 "ptrace() breakpoint with kernel addr failed"); in ptrace_try_kern_addr()
108 "ptrace() breakpoint on kernel addr should return EINVAL, got"); in ptrace_try_kern_addr()
139 * When running in compat mode we can't pass 64 address to ptrace so we
H A Dptrace07.c8 * bogus xcomp_bv"), or CVE-2017-15537. This bug allowed ptrace(pid,
40 #include "ptrace.h"
120 TEST(ptrace(PTRACE_ATTACH, pid, 0, 0)); in do_test()
127 TEST(ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov)); in do_test()
153 TEST(ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov)); in do_test()
174 TEST(ptrace(PTRACE_DETACH, pid, 0, 0)); in do_test()
H A Dptrace04.c18 #include "ptrace.h"
60 ret = ptrace(PTRACE_GETREGS, pid, NULL, &_pt_regs); in compare_registers()
67 ret = ptrace(PTRACE_PEEKUSER, pid, in compare_registers()
117 if (ptrace(PTRACE_SYSCALL, pid, NULL, NULL) && errno) { in main()
125 ptrace(PTRACE_KILL, pid, NULL, NULL); in main()
H A Dspawn_ptrace_child.h2 * Spawn a child and set it up for ptrace()-ing
23 #include <sys/ptrace.h> /* ptrace() */
50 __ret = ptrace(request, pid, __addr, __data); \
52 perror("ptrace(" #request ", " #pid ", " #addr ", " #data ")"); \
92 long ret = ptrace(PTRACE_TRACEME, 0, NULL, NULL); in make_a_baby()
/third_party/libevdev/test/
H A Dtest-main.c12 #include <sys/ptrace.h>
38 if (ptrace(PTRACE_ATTACH, ppid, NULL, NULL) == 0) { in is_debugger_attached()
40 ptrace(PTRACE_CONT, NULL, NULL); in is_debugger_attached()
41 ptrace(PTRACE_DETACH, ppid, NULL, NULL); in is_debugger_attached()
/third_party/elfutils/libdwfl/
H A Dlinux-pid-attach.c45 #include <sys/ptrace.h>
77 if (ptrace (PTRACE_ATTACH, tid, NULL, NULL) != 0) in __libdwfl_ptrace_attach()
92 ptrace (PTRACE_CONT, tid, NULL, NULL); in __libdwfl_ptrace_attach()
100 ptrace (PTRACE_DETACH, tid, NULL, NULL); in __libdwfl_ptrace_attach()
107 if (ptrace (PTRACE_CONT, tid, NULL, in __libdwfl_ptrace_attach()
111 ptrace (PTRACE_DETACH, tid, NULL, NULL); in __libdwfl_ptrace_attach()
127 /* Let the ptrace fallback deal with the corner case of the address in read_cached_memory()
217 *result = ptrace (PTRACE_PEEKDATA, tid, (void *) (uintptr_t) addr, NULL); in pid_memory_read()
232 *result = ptrace (PTRACE_PEEKDATA, tid, (void *) (uintptr_t) addr, NULL); in pid_memory_read()
359 ptrace (PTRACE_DETAC in __libdwfl_ptrace_detach()
[all...]
/third_party/musl/src/linux/
H A Dptrace.c1 #include <sys/ptrace.h>
6 long ptrace(int req, ...) in ptrace() function
/third_party/elfutils/tests/
H A Dbacktrace-child.c19 --ptraceme will call ptrace (PTRACE_TRACEME) in the two threads.
101 #include <sys/ptrace.h>
116 /* Execution will arrive here from jmp by an artificial ptrace-spawn signal. */
125 /* Do not return as stack may be invalid due to ptrace-patched PC to the in sigusr2()
147 /* Not reached, signal will get ptrace-spawn to jump into sigusr2. */ in jmp()
166 long l = ptrace (PTRACE_TRACEME, 0, NULL, NULL); in stdarg()
237 long l = ptrace (PTRACE_TRACEME, 0, NULL, NULL); in main()

Completed in 7 milliseconds

123