path: root/sys/sys/ptrace.h
diff options
authorDag-Erling Smørgrav <des@FreeBSD.org>2001-10-07 20:08:42 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2001-10-07 20:08:42 +0000
commit3da32491065c484d29934fb36794ae721201b992 (patch)
tree619938768546b5f4413bb8dc40f32a9f6cff02e7 /sys/sys/ptrace.h
parent23fad5b6c9cf707e9fb934078f2a62f99f1c0aba (diff)
Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called various functions in procfs depending on which ptrace operation was requested. Most of these functions were themselves wrappers around procfs_{read,write}_{,db,fp}regs(), with only some extra error checks, which weren't necessary in the ptrace case anyway. This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c (renaming it to proc_rwmem() in the process), and implements ptrace() directly in terms of procfs_{read,write}_{,db,fp}regs() instead of having it fake up a struct uio and then call procfs_do{,db,fp}regs(). It also moves the prototypes for procfs_{read,write}_{,db,fp}regs() and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files except procfs_machdep.c as "optional procfs" instead of "standard".
Notes: svn path=/head/; revision=84637
Diffstat (limited to 'sys/sys/ptrace.h')
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
index de4e5e98ccd5..c290e38efef8 100644
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -55,14 +55,32 @@
#include <machine/ptrace.h> /* machine-specific requests, if any */
#ifdef _KERNEL
-int ptrace_set_pc __P((struct thread *td, unsigned long addr));
-int ptrace_single_step __P((struct thread *td));
+int ptrace_set_pc(struct thread *_td, unsigned long _addr);
+int ptrace_single_step(struct thread *_td);
+ * These are prototypes for functions that implement some of the
+ * debugging functionality exported by procfs / linprocfs and by the
+ * ptrace(2) syscall. They used to be part of procfs, but they don't
+ * really belong there.
+ */
+struct reg;
+struct fpreg;
+struct dbreg;
+int procfs_read_regs(struct thread *_td, struct reg *_reg);
+int procfs_write_regs(struct thread *_td, struct reg *_reg);
+int procfs_read_fpregs(struct thread *_td, struct fpreg *_fpreg);
+int procfs_write_fpregs(struct thread *_td, struct fpreg *_fpreg);
+int procfs_read_dbregs(struct thread *_td, struct dbreg *_dbreg);
+int procfs_write_dbregs(struct thread *_td, struct dbreg *_dbreg);
+int procfs_sstep(struct thread *_td);
+int proc_rwmem(struct proc *_p, struct uio *_uio);
#else /* !_KERNEL */
#include <sys/cdefs.h>
-int ptrace __P((int _request, pid_t _pid, caddr_t _addr, int _data));
+int ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
#endif /* !_KERNEL */