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