Make gdbserver CORE_ADDR unsigned
[external/binutils.git] / gdb / gdbserver / server.h
1 /* Common definitions for remote server for GDB.
2    Copyright (C) 1993-2014 Free Software Foundation, Inc.
3
4    This file is part of GDB.
5
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.
10
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.
15
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/>.  */
18
19 #ifndef SERVER_H
20 #define SERVER_H
21
22 #include "config.h"
23 #include "build-gnulib-gdbserver/config.h"
24
25 #ifdef __MINGW32CE__
26 #include "wincecompat.h"
27 #endif
28
29 #include "libiberty.h"
30 #include "ansidecl.h"
31 #include "version.h"
32
33 #include <stdarg.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #ifdef HAVE_ERRNO_H
37 #include <errno.h>
38 #endif
39 #include <setjmp.h>
40
41 /* For gnulib's PATH_MAX.  */
42 #include "pathmax.h"
43
44 #include <string.h>
45
46 #ifdef HAVE_ALLOCA_H
47 #include <alloca.h>
48 #endif
49 /* On some systems such as MinGW, alloca is declared in malloc.h
50    (there is no alloca.h).  */
51 #if HAVE_MALLOC_H
52 #include <malloc.h>
53 #endif
54
55 #if !HAVE_DECL_STRERROR
56 #ifndef strerror
57 extern char *strerror (int);    /* X3.159-1989  4.11.6.2 */
58 #endif
59 #endif
60
61 #if !HAVE_DECL_PERROR
62 #ifndef perror
63 extern void perror (const char *);
64 #endif
65 #endif
66
67 #if !HAVE_DECL_VASPRINTF
68 extern int vasprintf(char **strp, const char *fmt, va_list ap);
69 #endif
70 #if !HAVE_DECL_VSNPRINTF
71 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
72 #endif
73
74 #ifdef IN_PROCESS_AGENT
75 #  define PROG "ipa"
76 #else
77 #  define PROG "gdbserver"
78 #endif
79
80 /* A type used for binary buffers.  */
81 typedef unsigned char gdb_byte;
82
83 #include "ptid.h"
84 #include "buffer.h"
85 #include "xml-utils.h"
86 #include "gdb_locale.h"
87
88 /* FIXME: This should probably be autoconf'd for.  It's an integer type at
89    least the size of a (void *).  */
90 typedef unsigned long long CORE_ADDR;
91
92 typedef long long LONGEST;
93 typedef unsigned long long ULONGEST;
94
95 #include "regcache.h"
96 #include "gdb/signals.h"
97 #include "gdb_signals.h"
98 #include "target.h"
99 #include "mem-break.h"
100 #include "gdbthread.h"
101 #include "inferiors.h"
102
103 /* Target-specific functions */
104
105 void initialize_low ();
106
107 /* Public variables in server.c */
108
109 extern ptid_t cont_thread;
110 extern ptid_t general_thread;
111
112 extern int server_waiting;
113 extern int debug_hw_points;
114 extern int pass_signals[];
115 extern int program_signals[];
116 extern int program_signals_p;
117
118 extern jmp_buf toplevel;
119
120 extern int disable_packet_vCont;
121 extern int disable_packet_Tthread;
122 extern int disable_packet_qC;
123 extern int disable_packet_qfThreadInfo;
124
125 extern int run_once;
126 extern int multi_process;
127 extern int non_stop;
128
129 extern int disable_randomization;
130
131 #if USE_WIN32API
132 #include <winsock2.h>
133 typedef SOCKET gdb_fildes_t;
134 #else
135 typedef int gdb_fildes_t;
136 #endif
137
138 #include "event-loop.h"
139
140 /* Functions from server.c.  */
141 extern int handle_serial_event (int err, gdb_client_data client_data);
142 extern int handle_target_event (int err, gdb_client_data client_data);
143
144 #include "remote-utils.h"
145
146 #include "common-utils.h"
147 #include "utils.h"
148 #include "debug.h"
149
150 #include "gdb_assert.h"
151
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)
155
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
160
161 #endif /* SERVER_H */