Lines Matching refs:ptrace
8 use nix::sys::ptrace;
10 use nix::sys::ptrace::Options;
20 // Just make sure ptrace can be called at all, for now.
21 // FIXME: qemu-user doesn't implement ptrace on all arches, so permit ENOSYS
23 let err = ptrace::attach(getpid()).unwrap_err();
34 let err = ptrace::setoptions(getpid(), Options::PTRACE_O_TRACESYSGOOD)
44 let err = ptrace::getevent(getpid()).unwrap_err();
53 if let Err(Errno::EOPNOTSUPP) = ptrace::getsiginfo(getpid()) {
64 if let Err(Errno::EOPNOTSUPP) = ptrace::setsiginfo(getpid(), &siginfo) {
71 use nix::sys::ptrace;
81 // FIXME: qemu-user doesn't implement ptrace on all architectures
85 // On valid platforms the ptrace call should return Errno::EPERM, this
87 let err = ptrace::attach(getpid()).unwrap_err();
94 ptrace::traceme().unwrap();
95 // As recommended by ptrace(2), raise SIGTRAP to pause the child
106 ptrace::cont(child, None).unwrap();
111 ptrace::cont(child, Some(Signal::SIGKILL)).unwrap();
121 while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() {
134 use nix::sys::ptrace;
151 ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD)
153 ptrace::interrupt(child).unwrap();
158 ptrace::syscall(child, None).unwrap();
163 ptrace::detach(child, Some(Signal::SIGKILL)).unwrap();
169 while ptrace::cont(child, Some(Signal::SIGKILL)).is_ok() {
179 // ptrace::{setoptions, getregs} are only available in these platforms
187 use nix::sys::ptrace;
201 ptrace::traceme().unwrap();
218 ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD)
223 || ptrace::getregs(child).unwrap().orig_rax as libc::c_long;
227 || ptrace::getregs(child).unwrap().orig_eax as libc::c_long;
229 // this duplicates `get_syscall_id` for the purpose of testing `ptrace::read_user`.
238 ptrace::read_user(child, rax_offset as _).unwrap()
243 ptrace::syscall(child, None).unwrap();
252 ptrace::syscall(child, None).unwrap();
261 ptrace::syscall(child, None).unwrap();
268 ptrace::syscall(child, Signal::SIGTERM).unwrap();