diff options
author | Mark Johnston <markj@FreeBSD.org> | 2015-12-07 21:33:15 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2015-12-07 21:33:15 +0000 |
commit | 711fbd17ecb5c73100aeb4991e158efcd50b8e7b (patch) | |
tree | 395bb015ca7c3a283ed4a6f10d9206628be6e3f3 /sys/sys/ptrace.h | |
parent | 23d63288c2d79b9355a24fc35381fb62ea12035a (diff) | |
download | src-711fbd17ecb5c73100aeb4991e158efcd50b8e7b.tar.gz src-711fbd17ecb5c73100aeb4991e158efcd50b8e7b.zip |
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
Notes:
svn path=/head/; revision=291961
Diffstat (limited to 'sys/sys/ptrace.h')
-rw-r--r-- | sys/sys/ptrace.h | 4 |
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); #ifdef COMPAT_FREEBSD32 struct reg32; struct fpreg32; |