GDBserver
/home/stan/gdb/src/gdb/gdbserver/server.h
Go to the documentation of this file.
00001 /* Common definitions for remote server for GDB.
00002    Copyright (C) 1993-2013 Free Software Foundation, Inc.
00003 
00004    This file is part of GDB.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 3 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00018 
00019 #ifndef SERVER_H
00020 #define SERVER_H
00021 
00022 #include "config.h"
00023 #include "build-gnulib-gdbserver/config.h"
00024 
00025 #ifdef __MINGW32CE__
00026 #include "wincecompat.h"
00027 #endif
00028 
00029 #include "libiberty.h"
00030 #include "ansidecl.h"
00031 #include "version.h"
00032 
00033 #include <stdarg.h>
00034 #include <stdio.h>
00035 #include <stdlib.h>
00036 #ifdef HAVE_ERRNO_H
00037 #include <errno.h>
00038 #endif
00039 #include <setjmp.h>
00040 
00041 /* For gnulib's PATH_MAX.  */
00042 #include "pathmax.h"
00043 
00044 #ifdef HAVE_STRING_H
00045 #include <string.h>
00046 #endif
00047 
00048 #ifdef HAVE_ALLOCA_H
00049 #include <alloca.h>
00050 #endif
00051 /* On some systems such as MinGW, alloca is declared in malloc.h
00052    (there is no alloca.h).  */
00053 #if HAVE_MALLOC_H
00054 #include <malloc.h>
00055 #endif
00056 
00057 #if !HAVE_DECL_STRERROR
00058 #ifndef strerror
00059 extern char *strerror (int);    /* X3.159-1989  4.11.6.2 */
00060 #endif
00061 #endif
00062 
00063 #if !HAVE_DECL_PERROR
00064 #ifndef perror
00065 extern void perror (const char *);
00066 #endif
00067 #endif
00068 
00069 #if !HAVE_DECL_VASPRINTF
00070 extern int vasprintf(char **strp, const char *fmt, va_list ap);
00071 #endif
00072 #if !HAVE_DECL_VSNPRINTF
00073 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
00074 #endif
00075 
00076 #ifdef IN_PROCESS_AGENT
00077 #  define PROG "ipa"
00078 #else
00079 #  define PROG "gdbserver"
00080 #endif
00081 
00082 /* A type used for binary buffers.  */
00083 typedef unsigned char gdb_byte;
00084 
00085 #include "ptid.h"
00086 #include "buffer.h"
00087 #include "xml-utils.h"
00088 #include "gdb_locale.h"
00089 
00090 /* FIXME: This should probably be autoconf'd for.  It's an integer type at
00091    least the size of a (void *).  */
00092 typedef long long CORE_ADDR;
00093 
00094 typedef long long LONGEST;
00095 typedef unsigned long long ULONGEST;
00096 
00097 #include "regcache.h"
00098 #include "gdb/signals.h"
00099 #include "gdb_signals.h"
00100 #include "target.h"
00101 #include "mem-break.h"
00102 #include "gdbthread.h"
00103 #include "inferiors.h"
00104 
00105 /* Target-specific functions */
00106 
00107 void initialize_low ();
00108 
00109 /* Public variables in server.c */
00110 
00111 extern ptid_t cont_thread;
00112 extern ptid_t general_thread;
00113 
00114 extern int server_waiting;
00115 extern int debug_threads;
00116 extern int debug_hw_points;
00117 extern int pass_signals[];
00118 extern int program_signals[];
00119 extern int program_signals_p;
00120 
00121 extern jmp_buf toplevel;
00122 
00123 extern int disable_packet_vCont;
00124 extern int disable_packet_Tthread;
00125 extern int disable_packet_qC;
00126 extern int disable_packet_qfThreadInfo;
00127 
00128 extern int run_once;
00129 extern int multi_process;
00130 extern int non_stop;
00131 
00132 extern int disable_randomization;
00133 
00134 #if USE_WIN32API
00135 #include <winsock2.h>
00136 typedef SOCKET gdb_fildes_t;
00137 #else
00138 typedef int gdb_fildes_t;
00139 #endif
00140 
00141 #include "event-loop.h"
00142 
00143 /* Functions from server.c.  */
00144 extern int handle_serial_event (int err, gdb_client_data client_data);
00145 extern int handle_target_event (int err, gdb_client_data client_data);
00146 
00147 #include "remote-utils.h"
00148 
00149 #include "common-utils.h"
00150 #include "utils.h"
00151 
00152 #include "gdb_assert.h"
00153 
00154 /* Maximum number of bytes to read/write at once.  The value here
00155    is chosen to fill up a packet (the headers account for the 32).  */
00156 #define MAXBUFBYTES(N) (((N)-32)/2)
00157 
00158 /* Buffer sizes for transferring memory, registers, etc.   Set to a constant
00159    value to accomodate multiple register formats.  This value must be at least
00160    as large as the largest register set supported by gdbserver.  */
00161 #define PBUFSIZ 16384
00162 
00163 #endif /* SERVER_H */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines