[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/ptrace.h

Version: -  FREEBSD  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  cheribsd  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1  -  FREEBSD-LIBC  -  FREEBSD8-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1984, 1993
    3  *      The Regents of the University of California.  All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 4. Neither the name of the University nor the names of its contributors
   14  *    may be used to endorse or promote products derived from this software
   15  *    without specific prior written permission.
   16  *
   17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   27  * SUCH DAMAGE.
   28  *
   29  *      @(#)ptrace.h    8.2 (Berkeley) 1/4/94
   30  * $FreeBSD: src/sys/sys/ptrace.h,v 1.25 2004/08/08 22:26:11 davidxu Exp $
   31  */
   32 
   33 #ifndef _SYS_PTRACE_H_
   34 #define _SYS_PTRACE_H_
   35 
   36 #define PT_TRACE_ME     0       /* child declares it's being traced */
   37 #define PT_READ_I       1       /* read word in child's I space */
   38 #define PT_READ_D       2       /* read word in child's D space */
   39 /* was  PT_READ_U       3        * read word in child's user structure */
   40 #define PT_WRITE_I      4       /* write word in child's I space */
   41 #define PT_WRITE_D      5       /* write word in child's D space */
   42 /* was  PT_WRITE_U      6        * write word in child's user structure */
   43 #define PT_CONTINUE     7       /* continue the child */
   44 #define PT_KILL         8       /* kill the child process */
   45 #define PT_STEP         9       /* single step the child */
   46 
   47 #define PT_ATTACH       10      /* trace some running process */
   48 #define PT_DETACH       11      /* stop tracing a process */
   49 #define PT_IO           12      /* do I/O to/from stopped process. */
   50 #define PT_LWPINFO      13      /* Info about the LWP that stopped. */
   51 #define PT_GETNUMLWPS   14      /* get total number of threads */
   52 #define PT_GETLWPLIST   15      /* get thread list */
   53 #define PT_CLEARSTEP    16      /* turn off single step */
   54 #define PT_SETSTEP      17      /* turn on single step */
   55 #define PT_SUSPEND      18      /* suspend a thread */
   56 #define PT_RESUME       19      /* resume a thread */
   57 
   58 #define PT_TO_SCE       20
   59 #define PT_TO_SCX       21
   60 #define PT_SYSCALL      22
   61 
   62 #define PT_GETREGS      33      /* get general-purpose registers */
   63 #define PT_SETREGS      34      /* set general-purpose registers */
   64 #define PT_GETFPREGS    35      /* get floating-point registers */
   65 #define PT_SETFPREGS    36      /* set floating-point registers */
   66 #define PT_GETDBREGS    37      /* get debugging registers */
   67 #define PT_SETDBREGS    38      /* set debugging registers */
   68 #define PT_FIRSTMACH    64      /* for machine-specific requests */
   69 #include <machine/ptrace.h>     /* machine-specific requests, if any */
   70 
   71 struct ptrace_io_desc {
   72         int     piod_op;        /* I/O operation */
   73         void    *piod_offs;     /* child offset */
   74         void    *piod_addr;     /* parent offset */
   75         size_t  piod_len;       /* request length */
   76 };
   77 
   78 /*
   79  * Operations in piod_op.
   80  */
   81 #define PIOD_READ_D     1       /* Read from D space */
   82 #define PIOD_WRITE_D    2       /* Write to D space */
   83 #define PIOD_READ_I     3       /* Read from I space */
   84 #define PIOD_WRITE_I    4       /* Write to I space */
   85 
   86 /* Argument structure for PT_LWPINFO. */
   87 struct ptrace_lwpinfo {
   88         lwpid_t pl_lwpid;       /* LWP described. */
   89         int     pl_event;       /* Event that stopped the LWP. */
   90 #define PL_EVENT_NONE   0
   91 #define PL_EVENT_SIGNAL 1
   92         int     pl_flags;       /* LWP flags. */
   93 #define PL_FLAG_SA      0x01    /* M:N thread */
   94 #define PL_FLAG_BOUND   0x02    /* M:N bound thread */
   95 };
   96 
   97 #ifdef _KERNEL
   98 
   99 #define PTRACESTOP_SC(p, td, flag)                              \
  100         if ((p)->p_flag & P_TRACED && (p)->p_stops & (flag)) {  \
  101                 PROC_LOCK(p);                                   \
  102                 ptracestop((td), SIGTRAP);                      \
  103         }
  104 /*
  105  * The flags below are used for ptrace(2) tracing and have no relation
  106  * to procfs.  They are stored in struct proc's p_stops member.
  107  */
  108 #define S_PT_SCE        0x000010000
  109 #define S_PT_SCX        0x000020000
  110 
  111 int     ptrace_set_pc(struct thread *_td, unsigned long _addr);
  112 int     ptrace_single_step(struct thread *_td);
  113 int     ptrace_clear_single_step(struct thread *_td);
  114 
  115 #ifdef __HAVE_PTRACE_MACHDEP
  116 int     cpu_ptrace(struct thread *_td, int _req, void *_addr, int _data);
  117 #endif
  118 
  119 /*
  120  * These are prototypes for functions that implement some of the
  121  * debugging functionality exported by procfs / linprocfs and by the
  122  * ptrace(2) syscall.  They used to be part of procfs, but they don't
  123  * really belong there.
  124  */
  125 struct reg;
  126 struct fpreg;
  127 struct dbreg;
  128 struct uio;
  129 int     proc_read_regs(struct thread *_td, struct reg *_reg);
  130 int     proc_write_regs(struct thread *_td, struct reg *_reg);
  131 int     proc_read_fpregs(struct thread *_td, struct fpreg *_fpreg);
  132 int     proc_write_fpregs(struct thread *_td, struct fpreg *_fpreg);
  133 int     proc_read_dbregs(struct thread *_td, struct dbreg *_dbreg);
  134 int     proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg);
  135 int     proc_sstep(struct thread *_td);
  136 int     proc_rwmem(struct proc *_p, struct uio *_uio);
  137 #else /* !_KERNEL */
  138 
  139 #include <sys/cdefs.h>
  140 
  141 __BEGIN_DECLS
  142 int     ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
  143 __END_DECLS
  144 
  145 #endif /* !_KERNEL */
  146 
  147 #endif  /* !_SYS_PTRACE_H_ */

Cache object: 37f296a7baf2a5a5cab4d2360e4aeca0


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.