Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Common definitions for remote server for GDB. |
ecd75fc8 | 2 | Copyright (C) 1993-2014 Free Software Foundation, Inc. |
c906108c | 3 | |
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
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 | |
a9762ec7 | 8 | the Free Software Foundation; either version 3 of the License, or |
c5aa993b | 9 | (at your option) any later version. |
c906108c | 10 | |
c5aa993b JM |
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. | |
c906108c | 15 | |
c5aa993b | 16 | You should have received a copy of the GNU General Public License |
a9762ec7 | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
c906108c | 18 | |
0a30fbc4 DJ |
19 | #ifndef SERVER_H |
20 | #define SERVER_H | |
21 | ||
22 | #include "config.h" | |
406b1477 | 23 | #include "build-gnulib-gdbserver/config.h" |
0729219d | 24 | |
68070c10 PA |
25 | #ifdef __MINGW32CE__ |
26 | #include "wincecompat.h" | |
27 | #endif | |
28 | ||
18c1b81a YQ |
29 | #include "libiberty.h" |
30 | #include "ansidecl.h" | |
01208463 | 31 | #include "version.h" |
18c1b81a | 32 | |
0a30fbc4 DJ |
33 | #include <stdarg.h> |
34 | #include <stdio.h> | |
35 | #include <stdlib.h> | |
68070c10 | 36 | #ifdef HAVE_ERRNO_H |
0a30fbc4 | 37 | #include <errno.h> |
68070c10 | 38 | #endif |
0729219d | 39 | #include <setjmp.h> |
0a30fbc4 | 40 | |
d8d2a3ee PA |
41 | /* For gnulib's PATH_MAX. */ |
42 | #include "pathmax.h" | |
43 | ||
d64b8841 | 44 | #include <string.h> |
d64b8841 | 45 | |
a1723c35 | 46 | #ifdef HAVE_ALLOCA_H |
47 | #include <alloca.h> | |
48 | #endif | |
a778ab81 | 49 | /* On some systems such as MinGW, alloca is declared in malloc.h |
50 | (there is no alloca.h). */ | |
51 | #if HAVE_MALLOC_H | |
52 | #include <malloc.h> | |
53 | #endif | |
a1723c35 | 54 | |
e122f1f5 | 55 | #if !HAVE_DECL_STRERROR |
43d5792c DJ |
56 | #ifndef strerror |
57 | extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ | |
58 | #endif | |
59 | #endif | |
60 | ||
68070c10 PA |
61 | #if !HAVE_DECL_PERROR |
62 | #ifndef perror | |
63 | extern void perror (const char *); | |
64 | #endif | |
65 | #endif | |
66 | ||
bb0116a4 JB |
67 | #if !HAVE_DECL_VASPRINTF |
68 | extern int vasprintf(char **strp, const char *fmt, va_list ap); | |
69 | #endif | |
70 | #if !HAVE_DECL_VSNPRINTF | |
71 | int vsnprintf(char *str, size_t size, const char *format, va_list ap); | |
72 | #endif | |
73 | ||
5e1dc496 LM |
74 | #ifdef IN_PROCESS_AGENT |
75 | # define PROG "ipa" | |
76 | #else | |
77 | # define PROG "gdbserver" | |
78 | #endif | |
79 | ||
01f9e8fa DJ |
80 | /* A type used for binary buffers. */ |
81 | typedef unsigned char gdb_byte; | |
82 | ||
d26e3629 KY |
83 | #include "ptid.h" |
84 | #include "buffer.h" | |
85 | #include "xml-utils.h" | |
86 | #include "gdb_locale.h" | |
87 | ||
0729219d DJ |
88 | /* FIXME: This should probably be autoconf'd for. It's an integer type at |
89 | least the size of a (void *). */ | |
0a30fbc4 DJ |
90 | typedef long long CORE_ADDR; |
91 | ||
219f2f23 | 92 | typedef long long LONGEST; |
95954743 PA |
93 | typedef unsigned long long ULONGEST; |
94 | ||
d50171e4 PA |
95 | #include "regcache.h" |
96 | #include "gdb/signals.h" | |
97 | #include "gdb_signals.h" | |
98 | #include "target.h" | |
99 | #include "mem-break.h" | |
623b6bdf | 100 | #include "gdbthread.h" |
6a6bbd9d | 101 | #include "inferiors.h" |
c04a1aa8 | 102 | |
c906108c SS |
103 | /* Target-specific functions */ |
104 | ||
4ce44c66 | 105 | void initialize_low (); |
c906108c | 106 | |
c906108c SS |
107 | /* Public variables in server.c */ |
108 | ||
95954743 PA |
109 | extern ptid_t cont_thread; |
110 | extern ptid_t general_thread; | |
5b1c542e | 111 | |
0d62e5e8 | 112 | extern int server_waiting; |
aa5ca48f | 113 | extern int debug_hw_points; |
89be2091 | 114 | extern int pass_signals[]; |
9b224c5e PA |
115 | extern int program_signals[]; |
116 | extern int program_signals_p; | |
c906108c SS |
117 | |
118 | extern jmp_buf toplevel; | |
c906108c | 119 | |
db42f210 PA |
120 | extern int disable_packet_vCont; |
121 | extern int disable_packet_Tthread; | |
122 | extern int disable_packet_qC; | |
123 | extern int disable_packet_qfThreadInfo; | |
124 | ||
03f2bd59 | 125 | extern int run_once; |
95954743 | 126 | extern int multi_process; |
bd99dc85 PA |
127 | extern int non_stop; |
128 | ||
03583c20 UW |
129 | extern int disable_randomization; |
130 | ||
ec48365d PA |
131 | #if USE_WIN32API |
132 | #include <winsock2.h> | |
133 | typedef SOCKET gdb_fildes_t; | |
134 | #else | |
135 | typedef int gdb_fildes_t; | |
136 | #endif | |
137 | ||
0ce3d3b5 | 138 | #include "event-loop.h" |
bd99dc85 PA |
139 | |
140 | /* Functions from server.c. */ | |
8336d594 PA |
141 | extern int handle_serial_event (int err, gdb_client_data client_data); |
142 | extern int handle_target_event (int err, gdb_client_data client_data); | |
bd99dc85 | 143 | |
541af0f4 | 144 | #include "remote-utils.h" |
c74d0ad8 | 145 | |
d26e3629 | 146 | #include "common-utils.h" |
ff42e6ab | 147 | #include "utils.h" |
87ce2a04 | 148 | #include "debug.h" |
0a30fbc4 | 149 | |
d26e3629 | 150 | #include "gdb_assert.h" |
e92d13d5 | 151 | |
5c44784c JM |
152 | /* Maximum number of bytes to read/write at once. The value here |
153 | is chosen to fill up a packet (the headers account for the 32). */ | |
154 | #define MAXBUFBYTES(N) (((N)-32)/2) | |
155 | ||
bb9c3d36 UW |
156 | /* Buffer sizes for transferring memory, registers, etc. Set to a constant |
157 | value to accomodate multiple register formats. This value must be at least | |
158 | as large as the largest register set supported by gdbserver. */ | |
159 | #define PBUFSIZ 16384 | |
0a30fbc4 DJ |
160 | |
161 | #endif /* SERVER_H */ |