From 47529628bb841dbd40b92a235231345e8927118b Mon Sep 17 00:00:00 2001 From: cgd Date: Sat, 8 Jan 1994 11:18:56 +0000 Subject: [PATCH] core reorg --- sys/kern/sys_process.c | 2 +- sys/sys/proc.h | 2 +- sys/sys/ptrace.h | 44 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 515824e99bf1..7365349db370 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1 +1 @@ -revision 1.15 intentionally removed +revision 1.16 intentionally removed diff --git a/sys/sys/proc.h b/sys/sys/proc.h index ea15b814f507..515824e99bf1 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1 +1 @@ -revision 1.14 intentionally removed +revision 1.15 intentionally removed diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 3267ca81c485..bbe397fa63ea 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ptrace.h 7.4 (Berkeley) 2/22/91 - * $Id: ptrace.h,v 1.5 1993/09/05 03:54:18 sef Exp $ + * $Id: ptrace.h,v 1.6 1994/01/08 11:19:53 cgd Exp $ */ #ifndef _SYS_PTRACE_H_ @@ -47,19 +47,47 @@ #define PT_CONTINUE 7 /* continue the child */ #define PT_KILL 8 /* kill the child process */ #define PT_STEP 9 /* single step the child */ -/*#define PT_ATTACH 10 /* attach to running process */ -/*#define PT_DETACH 11 /* detach from running process */ -#define PT_GETREGS 12 /* fetch registers */ -#define PT_SETREGS 13 /* set registers */ +#ifdef notyet +#define PT_ATTACH 10 /* attach to running process */ +#define PT_DETACH 11 /* detach from running process */ +#endif notyet -#ifndef KERNEL +#define PT_FIRSTMACH 32 /* for machine-specific requests */ +#include /* machine-specific requests, if any */ +#ifdef KERNEL +/* reparent a process */ +void proc_reparent __P((struct proc *child, struct proc *parent)); + +/* internal machine-dependent functions used by ptrace (and others) */ +#if defined(PT_GETREGS) || defined(PT_SETREGS) +struct reg; +#endif +#ifdef PT_GETREGS +int process_read_regs __P((struct proc *p, struct reg *regs)); +#endif +#ifdef PT_SETREGS +int process_write_regs __P((struct proc *p, struct reg *regs)); +#endif +int process_sstep __P((struct proc *p)); +int process_fix_sstep __P((struct proc *p)); +int process_set_pc __P((struct proc *p, u_int addr)); + +/* macros used by more than one kernel subsystem */ + +/* do a single-stepping fixup, if needed */ +#define FIX_SSTEP(p) { \ + if ((p)->p_stat & SSSTEP) { \ + process_fix_sstep(p); \ + (p)->p_stat &= ~SSSTEP; \ + } \ +} +#else /* KERNEL */ #include __BEGIN_DECLS int ptrace __P((int _request, pid_t _pid, caddr_t _addr, int _data)); __END_DECLS - -#endif /* !KERNEL */ +#endif #endif /* !_SYS_PTRACE_H_ */