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