path: root/sys/sys/ptrace.h
diff options
authorMark Johnston <markj@FreeBSD.org>2015-12-07 21:33:15 +0000
committerMark Johnston <markj@FreeBSD.org>2015-12-07 21:33:15 +0000
commit711fbd17ecb5c73100aeb4991e158efcd50b8e7b (patch)
tree395bb015ca7c3a283ed4a6f10d9206628be6e3f3 /sys/sys/ptrace.h
parent23d63288c2d79b9355a24fc35381fb62ea12035a (diff)
Add helper functions proc_readmem() and proc_writemem().
These helper functions can be used to read in or write a buffer from or to an arbitrary process' address space. Without them, this can only be done using proc_rwmem(), which requires the caller to fill out a uio. This is onerous and results in code duplication; the new functions provide a simpler interface which is sufficient for most existing callers of proc_rwmem(). This change also adds a manual page for proc_rwmem() and the new functions. Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D4245
Notes: svn path=/head/; revision=291961
Diffstat (limited to 'sys/sys/ptrace.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
index 71357671b23e..7ccd3d6cd596 100644
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -166,6 +166,10 @@ int proc_read_dbregs(struct thread *_td, struct dbreg *_dbreg);
int proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg);
int proc_sstep(struct thread *_td);
int proc_rwmem(struct proc *_p, struct uio *_uio);
+ssize_t proc_readmem(struct thread *_td, struct proc *_p, vm_offset_t _va,
+ void *_buf, size_t _len);
+ssize_t proc_writemem(struct thread *_td, struct proc *_p, vm_offset_t _va,
+ void *_buf, size_t _len);
struct reg32;
struct fpreg32;