1 /* Common definitions for remote server for GDB.
2 Copyright (C) 1993-2013 Free Software Foundation, Inc.
4 This file is part of GDB.
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 3 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "build-gnulib-gdbserver/config.h"
26 #include "wincecompat.h"
29 #include "libiberty.h"
41 /* For gnulib's PATH_MAX. */
49 /* On some systems such as MinGW, alloca is declared in malloc.h
50 (there is no alloca.h). */
55 #if !HAVE_DECL_STRERROR
57 extern char *strerror (int); /* X3.159-1989 4.11.6.2 */
63 extern void perror (const char *);
67 #if !HAVE_DECL_VASPRINTF
68 extern int vasprintf(char **strp, const char *fmt, va_list ap);
70 #if !HAVE_DECL_VSNPRINTF
71 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
74 #ifdef IN_PROCESS_AGENT
77 # define PROG "gdbserver"
80 /* A type used for binary buffers. */
81 typedef unsigned char gdb_byte;
85 #include "xml-utils.h"
86 #include "gdb_locale.h"
88 /* FIXME: This should probably be autoconf'd for. It's an integer type at
89 least the size of a (void *). */
90 typedef long long CORE_ADDR;
92 typedef long long LONGEST;
93 typedef unsigned long long ULONGEST;
96 #include "gdb/signals.h"
97 #include "gdb_signals.h"
99 #include "mem-break.h"
100 #include "gdbthread.h"
101 #include "inferiors.h"
103 /* Target-specific functions */
105 void initialize_low ();
107 /* Public variables in server.c */
109 extern ptid_t cont_thread;
110 extern ptid_t general_thread;
112 extern int server_waiting;
113 extern int debug_threads;
114 extern int debug_hw_points;
115 extern int pass_signals[];
116 extern int program_signals[];
117 extern int program_signals_p;
119 extern jmp_buf toplevel;
121 extern int disable_packet_vCont;
122 extern int disable_packet_Tthread;
123 extern int disable_packet_qC;
124 extern int disable_packet_qfThreadInfo;
127 extern int multi_process;
130 extern int disable_randomization;
133 #include <winsock2.h>
134 typedef SOCKET gdb_fildes_t;
136 typedef int gdb_fildes_t;
139 #include "event-loop.h"
141 /* Functions from server.c. */
142 extern int handle_serial_event (int err, gdb_client_data client_data);
143 extern int handle_target_event (int err, gdb_client_data client_data);
145 #include "remote-utils.h"
147 #include "common-utils.h"
150 #include "gdb_assert.h"
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)
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
161 #endif /* SERVER_H */