* configure.in: Build DLL tools on x86_64-*-cygwin* as well.
[deliverable/binutils-gdb.git] / gdb / gdbserver / server.h
index d3b4463a2adccf0c5290e3f3e3cefb5d18460b69..139cd498c7cee46291655083b3583faf2a3985e9 100644 (file)
@@ -1,6 +1,5 @@
 /* Common definitions for remote server for GDB.
-   Copyright (C) 1993, 1995, 1997-2000, 2002-2012 Free Software
-   Foundation, Inc.
+   Copyright (C) 1993-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #define SERVER_H
 
 #include "config.h"
+#include "build-gnulib-gdbserver/config.h"
 
 #ifdef __MINGW32CE__
 #include "wincecompat.h"
 #endif
 
+#include "libiberty.h"
+#include "ansidecl.h"
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -59,10 +62,6 @@ extern void perror (const char *);
 #endif
 #endif
 
-#if !HAVE_DECL_MEMMEM
-extern void *memmem (const void *, size_t , const void *, size_t);
-#endif
-
 #if !HAVE_DECL_VASPRINTF
 extern int vasprintf(char **strp, const char *fmt, va_list ap);
 #endif
@@ -70,38 +69,18 @@ extern int vasprintf(char **strp, const char *fmt, va_list ap);
 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
 #endif
 
-#ifndef ATTR_NORETURN
-#if defined(__GNUC__) && (__GNUC__ > 2 \
-                         || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
-#define ATTR_NORETURN __attribute__ ((noreturn))
-#else
-#define ATTR_NORETURN           /* nothing */
-#endif
-#endif
-
-#ifndef ATTR_FORMAT
-#if defined(__GNUC__) && (__GNUC__ > 2 \
-                         || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
-#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
-#else
-#define ATTR_FORMAT(type, x, y) /* nothing */
-#endif
-#endif
-
-#ifndef ATTR_MALLOC
-#if defined(__GNUC__) && (__GNUC__ >= 3)
-#define ATTR_MALLOC __attribute__ ((__malloc__))
-#else
-#define ATTR_MALLOC             /* nothing */
-#endif
-#endif
-
 /* Define underscore macro, if not available, to be able to use it inside
    code shared with gdb in common directory.  */
 #ifndef _
 #define _(String) (String)
 #endif
 
+#ifdef IN_PROCESS_AGENT
+#  define PROG "ipa"
+#else
+#  define PROG "gdbserver"
+#endif
+
 /* A type used for binary buffers.  */
 typedef unsigned char gdb_byte;
 
@@ -139,44 +118,7 @@ struct regcache;
 #include "gdb_signals.h"
 #include "target.h"
 #include "mem-break.h"
-
-struct thread_info
-{
-  struct inferior_list_entry entry;
-  void *target_data;
-  void *regcache_data;
-
-  /* The last resume GDB requested on this thread.  */
-  enum resume_kind last_resume_kind;
-
-  /* The last wait status reported for this thread.  */
-  struct target_waitstatus last_status;
-
-  /* Given `while-stepping', a thread may be collecting data for more
-     than one tracepoint simultaneously.  E.g.:
-
-    ff0001  INSN1 <-- TP1, while-stepping 10 collect $regs
-    ff0002  INSN2
-    ff0003  INSN3 <-- TP2, collect $regs
-    ff0004  INSN4 <-- TP3, while-stepping 10 collect $regs
-    ff0005  INSN5
-
-   Notice that when instruction INSN5 is reached, the while-stepping
-   actions of both TP1 and TP3 are still being collected, and that TP2
-   had been collected meanwhile.  The whole range of ff0001-ff0005
-   should be single-stepped, due to at least TP1's while-stepping
-   action covering the whole range.
-
-   On the other hand, the same tracepoint with a while-stepping action
-   may be hit by more than one thread simultaneously, hence we can't
-   keep the current step count in the tracepoint itself.
-
-   This is the head of the list of the states of `while-stepping'
-   tracepoint actions this thread is now collecting; NULL if empty.
-   Each item in the list holds the current step of the while-stepping
-   action.  */
-  struct wstep_state *while_stepping;
-};
+#include "gdbthread.h"
 
 struct dll_info
 {
@@ -233,7 +175,6 @@ void initialize_low ();
 /* From inferiors.c.  */
 
 extern struct inferior_list all_processes;
-extern struct inferior_list all_threads;
 extern struct inferior_list all_dlls;
 extern int dlls_changed;
 extern void clear_dlls (void);
@@ -246,8 +187,6 @@ void for_each_inferior (struct inferior_list *list,
 extern struct thread_info *current_inferior;
 void remove_inferior (struct inferior_list *list,
                      struct inferior_list_entry *entry);
-void remove_thread (struct thread_info *thread);
-void add_thread (ptid_t ptid, void *target_data);
 
 struct process_info *add_process (int pid, int attached);
 void remove_process (struct process_info *process);
@@ -255,12 +194,10 @@ struct process_info *find_process_pid (int pid);
 int have_started_inferiors_p (void);
 int have_attached_inferiors_p (void);
 
-struct thread_info *find_thread_ptid (ptid_t ptid);
-
 ptid_t thread_id_to_gdb_id (ptid_t);
 ptid_t thread_to_gdb_id (struct thread_info *);
 ptid_t gdb_id_to_thread_id (ptid_t);
-struct thread_info *gdb_id_to_thread (unsigned int);
+
 void clear_inferiors (void);
 struct inferior_list_entry *find_inferior
      (struct inferior_list *,
@@ -273,8 +210,6 @@ void *inferior_target_data (struct thread_info *);
 void set_inferior_target_data (struct thread_info *, void *);
 void *inferior_regcache_data (struct thread_info *);
 void set_inferior_regcache_data (struct thread_info *, void *);
-void add_pid_to_list (struct inferior_list *list, unsigned long pid);
-int pull_pid_from_list (struct inferior_list *list, unsigned long pid);
 
 void loaded_dll (const char *name, CORE_ADDR base_addr);
 void unloaded_dll (const char *name, CORE_ADDR base_addr);
@@ -288,6 +223,8 @@ extern int server_waiting;
 extern int debug_threads;
 extern int debug_hw_points;
 extern int pass_signals[];
+extern int program_signals[];
+extern int program_signals_p;
 
 extern jmp_buf toplevel;
 
@@ -322,13 +259,12 @@ extern int append_callback_event (callback_handler_func *proc,
 extern void delete_callback_event (int id);
 
 extern void start_event_loop (void);
+extern void initialize_event_loop (void);
 
 /* Functions from server.c.  */
 extern int handle_serial_event (int err, gdb_client_data client_data);
 extern int handle_target_event (int err, gdb_client_data client_data);
 
-extern void push_event (ptid_t ptid, struct target_waitstatus *status);
-
 /* Functions from hostio.c.  */
 extern int handle_vFile (char *, int, int *);
 
@@ -403,17 +339,10 @@ void monitor_output (const char *msg);
 /* Functions from utils.c */
 #include "common-utils.h"
 
-void *xmalloc (size_t) ATTR_MALLOC;
-void *xrealloc (void *, size_t);
-void *xcalloc (size_t, size_t) ATTR_MALLOC;
-char *xstrdup (const char *) ATTR_MALLOC;
-int xsnprintf (char *str, size_t size, const char *format, ...)
-  ATTR_FORMAT (printf, 3, 4);;
-void freeargv (char **argv);
 void perror_with_name (const char *string);
-void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
-void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
-void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2);
+void error (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void warning (const char *string,...) ATTRIBUTE_PRINTF (1, 2);
 char *paddress (CORE_ADDR addr);
 char *pulongest (ULONGEST u);
 char *plongest (LONGEST l);
@@ -437,8 +366,6 @@ char *pfildes (gdb_fildes_t fd);
    agent back to GDBserver.  */
 #define IPA_BUFSIZ 100
 
-int in_process_agent_loaded (void);
-
 void initialize_tracepoint (void);
 
 extern int tracing;
@@ -509,8 +436,30 @@ void stop_tracing (void);
 
 int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
 int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
+void gdb_agent_about_to_close (int pid);
 #endif
 
+struct traceframe;
+struct eval_agent_expr_context;
+
+/* Do memory copies for bytecodes.  */
+/* Do the recording of memory blocks for actions and bytecodes.  */
+
+int agent_mem_read (struct eval_agent_expr_context *ctx,
+                   unsigned char *to, CORE_ADDR from,
+                   ULONGEST len);
+
+LONGEST agent_get_trace_state_variable_value (int num);
+void agent_set_trace_state_variable_value (int num, LONGEST val);
+
+/* Record the value of a trace state variable.  */
+
+int agent_tsv_read (struct eval_agent_expr_context *ctx, int n);
+int agent_mem_read_string (struct eval_agent_expr_context *ctx,
+                          unsigned char *to,
+                          CORE_ADDR from,
+                          ULONGEST len);
+
 /* Bytecode compilation function vector.  */
 
 struct emit_ops
@@ -566,9 +515,15 @@ struct emit_ops
 
 /* Returns the address of the get_raw_reg function in the IPA.  */
 CORE_ADDR get_raw_reg_func_addr (void);
-
-CORE_ADDR current_insn_ptr;
-int emit_error;
+/* Returns the address of the get_trace_state_variable_value
+   function in the IPA.  */
+CORE_ADDR get_get_tsv_func_addr (void);
+/* Returns the address of the set_trace_state_variable_value
+   function in the IPA.  */
+CORE_ADDR get_set_tsv_func_addr (void);
+
+extern CORE_ADDR current_insn_ptr;
+extern int emit_error;
 
 /* Version information, from version.c.  */
 extern const char version[];
This page took 0.026225 seconds and 4 git commands to generate.