gdb/gdbserver/server.h - gdb

Data types defined

Macros defined

Source code

  1. /* Common definitions for remote server for GDB.
  2.    Copyright (C) 1993-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef SERVER_H
  15. #define SERVER_H

  16. #include "common-defs.h"

  17. gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));

  18. #ifdef __MINGW32CE__
  19. #include "wincecompat.h"
  20. #endif

  21. #include "version.h"

  22. #if !HAVE_DECL_STRERROR
  23. #ifndef strerror
  24. extern char *strerror (int);        /* X3.159-1989  4.11.6.2 */
  25. #endif
  26. #endif

  27. #if !HAVE_DECL_PERROR
  28. #ifndef perror
  29. extern void perror (const char *);
  30. #endif
  31. #endif

  32. #if !HAVE_DECL_VASPRINTF
  33. extern int vasprintf(char **strp, const char *fmt, va_list ap);
  34. #endif
  35. #if !HAVE_DECL_VSNPRINTF
  36. int vsnprintf(char *str, size_t size, const char *format, va_list ap);
  37. #endif

  38. #ifdef IN_PROCESS_AGENT
  39. #  define PROG "ipa"
  40. #else
  41. #  define PROG "gdbserver"
  42. #endif

  43. #include "buffer.h"
  44. #include "xml-utils.h"
  45. #include "regcache.h"
  46. #include "gdb_signals.h"
  47. #include "target.h"
  48. #include "mem-break.h"
  49. #include "gdbthread.h"
  50. #include "inferiors.h"

  51. /* Target-specific functions */

  52. void initialize_low ();

  53. /* Public variables in server.c */

  54. extern ptid_t cont_thread;
  55. extern ptid_t general_thread;

  56. extern int server_waiting;
  57. extern int pass_signals[];
  58. extern int program_signals[];
  59. extern int program_signals_p;

  60. extern int disable_packet_vCont;
  61. extern int disable_packet_Tthread;
  62. extern int disable_packet_qC;
  63. extern int disable_packet_qfThreadInfo;

  64. extern int run_once;
  65. extern int multi_process;
  66. extern int non_stop;

  67. extern int disable_randomization;

  68. #if USE_WIN32API
  69. #include <winsock2.h>
  70. typedef SOCKET gdb_fildes_t;
  71. #else
  72. typedef int gdb_fildes_t;
  73. #endif

  74. #include "event-loop.h"

  75. /* Functions from server.c.  */
  76. extern int handle_serial_event (int err, gdb_client_data client_data);
  77. extern int handle_target_event (int err, gdb_client_data client_data);

  78. #include "remote-utils.h"

  79. #include "utils.h"
  80. #include "debug.h"

  81. /* Maximum number of bytes to read/write at once.  The value here
  82.    is chosen to fill up a packet (the headers account for the 32).  */
  83. #define MAXBUFBYTES(N) (((N)-32)/2)

  84. /* Buffer sizes for transferring memory, registers, etc.   Set to a constant
  85.    value to accomodate multiple register formats.  This value must be at least
  86.    as large as the largest register set supported by gdbserver.  */
  87. #define PBUFSIZ 16384

  88. #endif /* SERVER_H */