[gdbserver] Split a new inferiors.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
255e7678
DJ
105struct dll_info
106{
107 struct inferior_list_entry entry;
108 char *name;
109 CORE_ADDR base_addr;
110};
111
c906108c
SS
112/* Target-specific functions */
113
4ce44c66 114void initialize_low ();
c906108c 115
6a6bbd9d 116/* From dll.c. */
ce3a066d 117
255e7678
DJ
118extern struct inferior_list all_dlls;
119extern int dlls_changed;
bf4c19f7 120extern void clear_dlls (void);
255e7678 121
255e7678
DJ
122void loaded_dll (const char *name, CORE_ADDR base_addr);
123void unloaded_dll (const char *name, CORE_ADDR base_addr);
124
c906108c
SS
125/* Public variables in server.c */
126
95954743
PA
127extern ptid_t cont_thread;
128extern ptid_t general_thread;
5b1c542e 129
0d62e5e8 130extern int server_waiting;
c74d0ad8 131extern int debug_threads;
aa5ca48f 132extern int debug_hw_points;
89be2091 133extern int pass_signals[];
9b224c5e
PA
134extern int program_signals[];
135extern int program_signals_p;
c906108c
SS
136
137extern jmp_buf toplevel;
c906108c 138
db42f210
PA
139extern int disable_packet_vCont;
140extern int disable_packet_Tthread;
141extern int disable_packet_qC;
142extern int disable_packet_qfThreadInfo;
143
03f2bd59 144extern int run_once;
95954743 145extern int multi_process;
bd99dc85
PA
146extern int non_stop;
147
03583c20
UW
148extern int disable_randomization;
149
ec48365d
PA
150#if USE_WIN32API
151#include <winsock2.h>
152typedef SOCKET gdb_fildes_t;
153#else
154typedef int gdb_fildes_t;
155#endif
156
bd99dc85
PA
157/* Functions from event-loop.c. */
158typedef void *gdb_client_data;
8336d594 159typedef int (handler_func) (int, gdb_client_data);
24b066ba 160typedef int (callback_handler_func) (gdb_client_data);
bd99dc85 161
ec48365d
PA
162extern void delete_file_handler (gdb_fildes_t fd);
163extern void add_file_handler (gdb_fildes_t fd, handler_func *proc,
bd99dc85 164 gdb_client_data client_data);
24b066ba
DE
165extern int append_callback_event (callback_handler_func *proc,
166 gdb_client_data client_data);
167extern void delete_callback_event (int id);
bd99dc85
PA
168
169extern void start_event_loop (void);
60f662b0 170extern void initialize_event_loop (void);
bd99dc85
PA
171
172/* Functions from server.c. */
8336d594
PA
173extern int handle_serial_event (int err, gdb_client_data client_data);
174extern int handle_target_event (int err, gdb_client_data client_data);
bd99dc85 175
a6b151f1
DJ
176/* Functions from hostio.c. */
177extern int handle_vFile (char *, int, int *);
178
59a016f0
PA
179/* Functions from hostio-errno.c. */
180extern void hostio_last_error_from_errno (char *own_buf);
181
541af0f4 182#include "remote-utils.h"
c74d0ad8 183
d26e3629 184#include "common-utils.h"
ff42e6ab 185#include "utils.h"
0a30fbc4 186
d26e3629 187#include "gdb_assert.h"
e92d13d5 188
5c44784c
JM
189/* Maximum number of bytes to read/write at once. The value here
190 is chosen to fill up a packet (the headers account for the 32). */
191#define MAXBUFBYTES(N) (((N)-32)/2)
192
bb9c3d36
UW
193/* Buffer sizes for transferring memory, registers, etc. Set to a constant
194 value to accomodate multiple register formats. This value must be at least
195 as large as the largest register set supported by gdbserver. */
196#define PBUFSIZ 16384
0a30fbc4
DJ
197
198#endif /* SERVER_H */
This page took 0.962106 seconds and 4 git commands to generate.