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