Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/sys/ptrace.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/sys/ptrace.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.45.6.3 retrieving revision 1.45.6.4 diff -u -p -r1.45.6.3 -r1.45.6.4 --- src/sys/sys/ptrace.h 2017/02/05 13:41:01 1.45.6.3 +++ src/sys/sys/ptrace.h 2017/08/28 17:53:16 1.45.6.4 @@ -1,4 +1,4 @@ -/* $NetBSD: ptrace.h,v 1.45.6.3 2017/02/05 13:41:01 skrll Exp $ */ +/* $NetBSD: ptrace.h,v 1.45.6.4 2017/08/28 17:53:16 skrll Exp $ */ /*- * Copyright (c) 1984, 1993 @@ -55,6 +55,10 @@ #define PT_GET_PROCESS_STATE 18 /* get process state, defined below */ #define PT_SET_SIGINFO 19 /* set signal state, defined below */ #define PT_GET_SIGINFO 20 /* get signal state, defined below */ +#define PT_SET_SIGMASK 21 /* set signal mask */ +#define PT_GET_SIGMASK 22 /* get signal mask */ +#define PT_RESUME 23 /* allow execution of the LWP */ +#define PT_SUSPEND 24 /* prevent execution of the LWP */ #define PT_FIRSTMACH 32 /* for machine-specific requests */ #include /* machine-specific requests, if any */ @@ -80,7 +84,11 @@ /* 17 */ "PT_GET_EVENT_MASK", \ /* 18 */ "PT_GET_PROCESS_STATE", \ /* 19 */ "PT_SET_SIGINFO", \ -/* 20 */ "PT_GET_SIGINFO", +/* 20 */ "PT_GET_SIGINFO", \ +/* 21 */ "PT_GET_SIGMASK", \ +/* 22 */ "PT_GET_SIGMASK", \ +/* 23 */ "PT_RESUME", \ +/* 24 */ "PT_SUSPEND", /* PT_{G,S}EVENT_MASK */ typedef struct ptrace_event { @@ -131,22 +139,9 @@ struct ptrace_lwpinfo { /* Add fields at the end */ }; -#define PL_EVENT_NONE 0 -#define PL_EVENT_SIGNAL 1 - -/* - * Hardware Watchpoints - * - * MD code handles switch informing whether a particular watchpoint is enabled - */ -typedef struct ptrace_watchpoint { - int pw_index; /* HW Watchpoint ID (count from 0) */ - lwpid_t pw_lwpid; /* LWP described */ - int pw_type; /* HW Watchpoint type w/ MD content */ -#ifdef __HAVE_PTRACE_WATCHPOINTS - struct mdpw pw_md; /* MD fields */ -#endif -} ptrace_watchpoint_t; +#define PL_EVENT_NONE 0 +#define PL_EVENT_SIGNAL 1 +#define PL_EVENT_SUSPENDED 2 /* * Signal Information structure @@ -169,6 +164,7 @@ struct reg; #define process_reg64 struct reg #endif #endif + #if defined(PT_GETFPREGS) || defined(PT_SETFPREGS) struct fpreg; #ifndef process_fpreg32 @@ -178,12 +174,14 @@ struct fpreg; #define process_fpreg64 struct fpreg #endif #endif -#ifdef __HAVE_PTRACE_WATCHPOINTS -#ifndef process_watchpoint32 -#define process_watchpoint32 struct ptrace_watchpoint + +#if defined(PT_GETDBREGS) || defined(PT_SETDBREGS) +struct fpreg; +#ifndef process_dbreg32 +#define process_dbreg32 struct dbreg #endif -#ifndef process_watchpoint64 -#define process_watchpoint64 struct ptrace_watchpoint +#ifndef process_dbreg64 +#define process_dbreg64 struct dbreg #endif #endif @@ -192,8 +190,7 @@ struct ptrace_methods { void (*ptm_copyoutpiod)(const struct ptrace_io_desc *, void *); int (*ptm_doregs)(struct lwp *, struct lwp *, struct uio *); int (*ptm_dofpregs)(struct lwp *, struct lwp *, struct uio *); - int (*ptm_dowatchpoint)(struct lwp *, struct lwp *, int, - struct ptrace_watchpoint *, void *, register_t *); + int (*ptm_dodbregs)(struct lwp *, struct lwp *, struct uio *); }; int ptrace_init(void); @@ -206,14 +203,12 @@ int process_validregs(struct lwp *); int process_dofpregs(struct lwp *, struct lwp *, struct uio *); int process_validfpregs(struct lwp *); -int process_dowatchpoint(struct lwp *, struct lwp *, int, - struct ptrace_watchpoint *, void *, register_t *); -int process_validwatchpoint(struct lwp *); +int process_dodbregs(struct lwp *, struct lwp *, struct uio *); +int process_validdbregs(struct lwp *); int process_domem(struct lwp *, struct lwp *, struct uio *); -void process_stoptrace(void); - +void proc_stoptrace(int); void proc_reparent(struct proc *, struct proc *); void proc_changeparent(struct proc *, struct proc *); @@ -226,6 +221,15 @@ int do_ptrace(struct ptrace_methods *, s * will #define process_read_regs32 to netbsd32_process_read_regs (etc). * In all other cases these #defines drop the size suffix. */ +#ifdef PT_GETDBREGS +int process_read_dbregs(struct lwp *, struct dbreg *, size_t *); +#ifndef process_read_dbregs32 +#define process_read_dbregs32 process_read_dbregs +#endif +#ifndef process_read_dbregs64 +#define process_read_dbregs64 process_read_dbregs +#endif +#endif #ifdef PT_GETFPREGS int process_read_fpregs(struct lwp *, struct fpreg *, size_t *); #ifndef process_read_fpregs32 @@ -246,6 +250,15 @@ int process_read_regs(struct lwp *, stru #endif int process_set_pc(struct lwp *, void *); int process_sstep(struct lwp *, int); +#ifdef PT_SETDBREGS +int process_write_dbregs(struct lwp *, const struct dbreg *, size_t); +#ifndef process_write_dbregs32 +#define process_write_dbregs32 process_write_dbregs +#endif +#ifndef process_write_dbregs64 +#define process_write_dbregs64 process_write_dbregs +#endif +#endif #ifdef PT_SETFPREGS int process_write_fpregs(struct lwp *, const struct fpreg *, size_t); #ifndef process_write_fpregs32 @@ -265,32 +278,6 @@ int process_write_regs(struct lwp *, con #endif #endif -#ifdef __HAVE_PTRACE_WATCHPOINTS -int process_count_watchpoints(struct lwp *, register_t *retval); -#ifndef process_count_watchpoints32 -#define process_count_watchpoints32 process_count_watchpoints -#endif -#ifndef process_count_watchpoints64 -#define process_count_watchpoints64 process_count_watchpoints -#endif - -int process_read_watchpoint(struct lwp *, struct ptrace_watchpoint *); -#ifndef process_read_watchpoint32 -#define process_read_watchpoint32 process_read_watchpoint -#endif -#ifndef process_read_watchpoint64 -#define process_read_watchpoint64 process_read_watchpoint -#endif - -int process_write_watchpoint(struct lwp *, struct ptrace_watchpoint *); -#ifndef process_write_watchpoint32 -#define process_write_watchpoint32 process_write_watchpoint -#endif -#ifndef process_write_watchpoint64 -#define process_write_watchpoint64 process_write_watchpoint -#endif -#endif - int ptrace_machdep_dorequest(struct lwp *, struct lwp *, int, void *, int);