OSDN Git Service

Copyright updates for 2007.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / gdbserver / gdb_proc_service.h
1 /* <proc_service.h> replacement for systems that don't have it.
2    Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
3
4    This file is part of GDB.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.  */
20
21 #ifndef GDB_PROC_SERVICE_H
22 #define GDB_PROC_SERVICE_H
23
24 #include <sys/types.h>
25
26 #ifdef HAVE_PROC_SERVICE_H
27 #include <proc_service.h>
28 #else
29
30 #ifdef HAVE_SYS_PROCFS_H
31 #include <sys/procfs.h>
32 #endif
33
34 /* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>.  If
35    <sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel
36    headers also (but don't if we don't need to).  */
37 #ifndef HAVE_ELF_FPREGSET_T
38 # ifdef HAVE_LINUX_ELF_H
39 #  include <linux/elf.h>
40 # endif
41 #endif
42
43 typedef enum
44 {
45   PS_OK,                        /* Success.  */
46   PS_ERR,                       /* Generic error.  */
47   PS_BADPID,                    /* Bad process handle.  */
48   PS_BADLID,                    /* Bad LWP id.  */
49   PS_BADADDR,                   /* Bad address.  */
50   PS_NOSYM,                     /* Symbol not found.  */
51   PS_NOFREGS                    /* FPU register set not available.  */
52 } ps_err_e;
53
54 #ifndef HAVE_LWPID_T
55 typedef unsigned int lwpid_t;
56 #endif
57
58 #ifndef HAVE_PSADDR_T
59 typedef unsigned long psaddr_t;
60 #endif
61
62 #ifndef HAVE_PRGREGSET_T
63 typedef elf_gregset_t prgregset_t;
64 #endif
65
66 #endif /* HAVE_PROC_SERVICE_H */
67
68 /* Structure that identifies the target process.  */
69 struct ps_prochandle
70 {
71   /* The process id is all we need.  */
72   pid_t pid;
73 };
74
75 #endif /* gdb_proc_service.h */