Lines Matching +full:sr +full:- +full:iov
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
129 saved_retval = td->td_retval[0]; in linux_ptrace_status()
131 td->td_retval[0] = saved_retval; in linux_ptrace_status()
137 pem = pem_find(td->td_proc); in linux_ptrace_status()
141 if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && in linux_ptrace_status()
144 if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && in linux_ptrace_status()
151 if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACEEXIT) && in linux_ptrace_status()
166 error = copyout(td->td_retval, data, sizeof(l_int)); in linux_ptrace_peek()
169 td->td_retval[0] = error; in linux_ptrace_peek()
189 pem = pem_find(td->td_proc); in linux_ptrace_setoptions()
198 pem->ptrace_flags |= LINUX_PTRACE_O_TRACESYSGOOD; in linux_ptrace_setoptions()
200 pem->ptrace_flags &= ~LINUX_PTRACE_O_TRACESYSGOOD; in linux_ptrace_setoptions()
220 pem->ptrace_flags |= LINUX_PTRACE_O_TRACEEXIT; in linux_ptrace_setoptions()
222 pem->ptrace_flags &= ~LINUX_PTRACE_O_TRACEEXIT; in linux_ptrace_setoptions()
302 struct iovec iov; in linux_ptrace_getregset_prstatus() local
306 error = copyin((const void *)data, &iov, sizeof(iov)); in linux_ptrace_getregset_prstatus()
321 len = MIN(iov.iov_len, sizeof(l_regset)); in linux_ptrace_getregset_prstatus()
322 error = copyout(&l_regset, (void *)iov.iov_base, len); in linux_ptrace_getregset_prstatus()
328 iov.iov_len = len; in linux_ptrace_getregset_prstatus()
329 error = copyout(&iov, (void *)data, sizeof(iov)); in linux_ptrace_getregset_prstatus()
331 linux_msg(td, "iov copyout error %d", error); in linux_ptrace_getregset_prstatus()
373 struct ptrace_sc_ret sr; in linux_ptrace_get_syscall_info() local
391 * implementation of PT_GET_SC_ARGS for Linux-ABI in linux_ptrace_get_syscall_info()
394 * by calling close(2), or some other single-argument in linux_ptrace_get_syscall_info()
408 error = kern_ptrace(td, PT_GET_SC_RET, pid, &sr, sizeof(sr)); in linux_ptrace_get_syscall_info()
416 if (sr.sr_error == 0) { in linux_ptrace_get_syscall_info()
417 si.exit.rval = sr.sr_retval[0]; in linux_ptrace_get_syscall_info()
419 } else if (sr.sr_error == EJUSTRETURN) { in linux_ptrace_get_syscall_info()
428 } else if (sr.sr_error == ERESTART) { in linux_ptrace_get_syscall_info()
429 si.exit.rval = -LINUX_ERESTARTSYS; in linux_ptrace_get_syscall_info()
432 si.exit.rval = bsd_to_linux_errno(sr.sr_error); in linux_ptrace_get_syscall_info()
448 td->td_retval[0] = sizeof(si); in linux_ptrace_get_syscall_info()
463 pid = (pid_t)uap->pid; in linux_ptrace()
464 addr = (void *)uap->addr; in linux_ptrace()
466 switch (uap->req) { in linux_ptrace()
472 error = linux_ptrace_peek(td, pid, addr, (void *)uap->data); in linux_ptrace()
479 (void *)(uap->addr + 4), (void *)(uap->data + 4)); in linux_ptrace()
482 error = linux_ptrace_peekuser(td, pid, addr, (void *)uap->data); in linux_ptrace()
486 error = kern_ptrace(td, PT_WRITE_D, pid, addr, uap->data); in linux_ptrace()
493 (void *)(uap->addr + 4), uap->data >> 32); in linux_ptrace()
496 error = linux_ptrace_pokeuser(td, pid, addr, (void *)uap->data); in linux_ptrace()
499 error = map_signum(uap->data, &sig); in linux_ptrace()
505 error = kern_ptrace(td, PT_KILL, pid, addr, uap->data); in linux_ptrace()
508 error = map_signum(uap->data, &sig); in linux_ptrace()
514 error = linux_ptrace_getregs(td, pid, (void *)uap->data); in linux_ptrace()
517 error = linux_ptrace_setregs(td, pid, (void *)uap->data); in linux_ptrace()
520 error = kern_ptrace(td, PT_ATTACH, pid, addr, uap->data); in linux_ptrace()
523 error = map_signum(uap->data, &sig); in linux_ptrace()
529 error = map_signum(uap->data, &sig); in linux_ptrace()
535 error = linux_ptrace_setoptions(td, pid, uap->data); in linux_ptrace()
538 error = linux_ptrace_geteventmsg(td, pid, uap->data); in linux_ptrace()
541 error = linux_ptrace_getsiginfo(td, pid, uap->data); in linux_ptrace()
544 error = linux_ptrace_getregset(td, pid, uap->addr, uap->data); in linux_ptrace()
547 error = linux_ptrace_seize(td, pid, uap->addr, uap->data); in linux_ptrace()
550 error = linux_ptrace_get_syscall_info(td, pid, uap->addr, uap->data); in linux_ptrace()
554 "returning EINVAL", uap->req); in linux_ptrace()