1*b725ae77Skettenis /* <proc_service.h> replacement for systems that don't have it.
2*b725ae77Skettenis    Copyright 2000 Free Software Foundation, Inc.
3*b725ae77Skettenis 
4*b725ae77Skettenis    This file is part of GDB.
5*b725ae77Skettenis 
6*b725ae77Skettenis    This program is free software; you can redistribute it and/or modify
7*b725ae77Skettenis    it under the terms of the GNU General Public License as published by
8*b725ae77Skettenis    the Free Software Foundation; either version 2 of the License, or
9*b725ae77Skettenis    (at your option) any later version.
10*b725ae77Skettenis 
11*b725ae77Skettenis    This program is distributed in the hope that it will be useful,
12*b725ae77Skettenis    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*b725ae77Skettenis    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*b725ae77Skettenis    GNU General Public License for more details.
15*b725ae77Skettenis 
16*b725ae77Skettenis    You should have received a copy of the GNU General Public License
17*b725ae77Skettenis    along with this program; if not, write to the Free Software
18*b725ae77Skettenis    Foundation, Inc., 59 Temple Place - Suite 330,
19*b725ae77Skettenis    Boston, MA 02111-1307, USA.  */
20*b725ae77Skettenis 
21*b725ae77Skettenis #ifndef GDB_PROC_SERVICE_H
22*b725ae77Skettenis #define GDB_PROC_SERVICE_H
23*b725ae77Skettenis 
24*b725ae77Skettenis #include <sys/types.h>
25*b725ae77Skettenis 
26*b725ae77Skettenis #ifdef HAVE_PROC_SERVICE_H
27*b725ae77Skettenis #include <proc_service.h>
28*b725ae77Skettenis #else
29*b725ae77Skettenis 
30*b725ae77Skettenis #ifdef HAVE_SYS_PROCFS_H
31*b725ae77Skettenis #include <sys/procfs.h>
32*b725ae77Skettenis #endif
33*b725ae77Skettenis 
34*b725ae77Skettenis #include "gregset.h"
35*b725ae77Skettenis 
36*b725ae77Skettenis typedef enum
37*b725ae77Skettenis {
38*b725ae77Skettenis   PS_OK,			/* Success.  */
39*b725ae77Skettenis   PS_ERR,			/* Generic error.  */
40*b725ae77Skettenis   PS_BADPID,			/* Bad process handle.  */
41*b725ae77Skettenis   PS_BADLID,			/* Bad LWP id.  */
42*b725ae77Skettenis   PS_BADADDR,			/* Bad address.  */
43*b725ae77Skettenis   PS_NOSYM,			/* Symbol not found.  */
44*b725ae77Skettenis   PS_NOFREGS			/* FPU register set not available.  */
45*b725ae77Skettenis } ps_err_e;
46*b725ae77Skettenis 
47*b725ae77Skettenis #ifndef HAVE_LWPID_T
48*b725ae77Skettenis typedef unsigned int lwpid_t;
49*b725ae77Skettenis #endif
50*b725ae77Skettenis 
51*b725ae77Skettenis typedef unsigned long paddr_t;
52*b725ae77Skettenis 
53*b725ae77Skettenis #ifndef HAVE_PSADDR_T
54*b725ae77Skettenis typedef unsigned long psaddr_t;
55*b725ae77Skettenis #endif
56*b725ae77Skettenis 
57*b725ae77Skettenis #ifndef HAVE_PRGREGSET_T
58*b725ae77Skettenis typedef gdb_gregset_t prgregset_t;
59*b725ae77Skettenis #endif
60*b725ae77Skettenis 
61*b725ae77Skettenis #ifndef HAVE_PRFPREGSET_T
62*b725ae77Skettenis typedef gdb_fpregset_t prfpregset_t;
63*b725ae77Skettenis #endif
64*b725ae77Skettenis 
65*b725ae77Skettenis #endif /* HAVE_PROC_SERVICE_H */
66*b725ae77Skettenis 
67*b725ae77Skettenis /* Fix-up some broken systems.  */
68*b725ae77Skettenis 
69*b725ae77Skettenis /* Unfortunately glibc 2.1.3 was released with a broken prfpregset_t
70*b725ae77Skettenis    type.  We let configure check for this lossage, and make
71*b725ae77Skettenis    appropriate typedefs here.  */
72*b725ae77Skettenis 
73*b725ae77Skettenis #ifdef PRFPREGSET_T_BROKEN
74*b725ae77Skettenis typedef gdb_fpregset_t gdb_prfpregset_t;
75*b725ae77Skettenis #else
76*b725ae77Skettenis typedef prfpregset_t gdb_prfpregset_t;
77*b725ae77Skettenis #endif
78*b725ae77Skettenis 
79*b725ae77Skettenis /* Structure that identifies the target process.  */
80*b725ae77Skettenis struct ps_prochandle
81*b725ae77Skettenis {
82*b725ae77Skettenis   /* The process id is all we need.  */
83*b725ae77Skettenis   pid_t pid;
84*b725ae77Skettenis };
85*b725ae77Skettenis 
86*b725ae77Skettenis #endif /* gdb_proc_service.h */
87