Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/pm_machdep.c
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
td->td_frame->pc = (register_t) addr; | td->td_frame->pc = (register_t) addr; | ||||
return 0; | return 0; | ||||
} | } | ||||
static int | static int | ||||
ptrace_read_int(struct thread *td, off_t addr, int *v) | ptrace_read_int(struct thread *td, off_t addr, int *v) | ||||
{ | { | ||||
struct iovec iov; | |||||
struct uio uio; | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); | if (proc_readmem(td, td->td_proc, addr, v, sizeof(*v)) != sizeof(*v)) | ||||
iov.iov_base = (caddr_t) v; | return (ENOMEM); | ||||
iov.iov_len = sizeof(int); | return (0); | ||||
uio.uio_iov = &iov; | |||||
uio.uio_iovcnt = 1; | |||||
uio.uio_offset = (off_t)addr; | |||||
uio.uio_resid = sizeof(int); | |||||
uio.uio_segflg = UIO_SYSSPACE; | |||||
uio.uio_rw = UIO_READ; | |||||
uio.uio_td = td; | |||||
return proc_rwmem(td->td_proc, &uio); | |||||
} | } | ||||
static int | static int | ||||
ptrace_write_int(struct thread *td, off_t addr, int v) | ptrace_write_int(struct thread *td, off_t addr, int v) | ||||
{ | { | ||||
struct iovec iov; | |||||
struct uio uio; | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); | if (proc_writemem(td, td->td_proc, addr, &v, sizeof(v)) != sizeof(v)) | ||||
iov.iov_base = (caddr_t) &v; | return (ENOMEM); | ||||
iov.iov_len = sizeof(int); | return (0); | ||||
uio.uio_iov = &iov; | |||||
uio.uio_iovcnt = 1; | |||||
uio.uio_offset = (off_t)addr; | |||||
uio.uio_resid = sizeof(int); | |||||
uio.uio_segflg = UIO_SYSSPACE; | |||||
uio.uio_rw = UIO_WRITE; | |||||
uio.uio_td = td; | |||||
return proc_rwmem(td->td_proc, &uio); | |||||
} | } | ||||
int | int | ||||
ptrace_single_step(struct thread *td) | ptrace_single_step(struct thread *td) | ||||
{ | { | ||||
unsigned va; | unsigned va; | ||||
struct trapframe *locr0 = td->td_frame; | struct trapframe *locr0 = td->td_frame; | ||||
int i; | int i; | ||||
▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines |