1 /* Common definitions for remote server for GDB.
2 Copyright (C) 1993-2014 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/>. */
22 #include "common-defs.h"
25 #include "wincecompat.h"
38 /* On some systems such as MinGW, alloca is declared in malloc.h
39 (there is no alloca.h). */
44 #if !HAVE_DECL_STRERROR
46 extern char *strerror (int); /* X3.159-1989 4.11.6.2 */
52 extern void perror (const char *);
56 #if !HAVE_DECL_VASPRINTF
57 extern int vasprintf(char **strp
, const char *fmt
, va_list ap
);
59 #if !HAVE_DECL_VSNPRINTF
60 int vsnprintf(char *str
, size_t size
, const char *format
, va_list ap
);
63 #ifdef IN_PROCESS_AGENT
66 # define PROG "gdbserver"
69 /* A type used for binary buffers. */
70 typedef unsigned char gdb_byte
;
73 #include "xml-utils.h"
75 /* FIXME: This should probably be autoconf'd for. It's an integer type at
76 least the size of a (void *). */
77 typedef unsigned long long CORE_ADDR
;
79 typedef long long LONGEST
;
80 typedef unsigned long long ULONGEST
;
83 #include "gdb_signals.h"
85 #include "mem-break.h"
86 #include "gdbthread.h"
87 #include "inferiors.h"
89 /* Target-specific functions */
91 void initialize_low ();
93 /* Public variables in server.c */
95 extern ptid_t cont_thread
;
96 extern ptid_t general_thread
;
98 extern int server_waiting
;
99 extern int debug_hw_points
;
100 extern int pass_signals
[];
101 extern int program_signals
[];
102 extern int program_signals_p
;
104 extern jmp_buf toplevel
;
106 extern int disable_packet_vCont
;
107 extern int disable_packet_Tthread
;
108 extern int disable_packet_qC
;
109 extern int disable_packet_qfThreadInfo
;
112 extern int multi_process
;
115 extern int disable_randomization
;
118 #include <winsock2.h>
119 typedef SOCKET gdb_fildes_t
;
121 typedef int gdb_fildes_t
;
124 #include "event-loop.h"
126 /* Functions from server.c. */
127 extern int handle_serial_event (int err
, gdb_client_data client_data
);
128 extern int handle_target_event (int err
, gdb_client_data client_data
);
130 #include "remote-utils.h"
135 /* Maximum number of bytes to read/write at once. The value here
136 is chosen to fill up a packet (the headers account for the 32). */
137 #define MAXBUFBYTES(N) (((N)-32)/2)
139 /* Buffer sizes for transferring memory, registers, etc. Set to a constant
140 value to accomodate multiple register formats. This value must be at least
141 as large as the largest register set supported by gdbserver. */
142 #define PBUFSIZ 16384
144 #endif /* SERVER_H */