Index: gdb/gdbserver/server.h |
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h |
index 2d8a1c0394726dabde3fc17185a6324dff5ac489..40d05a5636e6f57dd1395dcdd9da19164de9ef27 100644 |
--- a/gdb/gdbserver/server.h |
+++ b/gdb/gdbserver/server.h |
@@ -21,6 +21,7 @@ |
#define SERVER_H |
#include "config.h" |
+#include "build-gnulib-gdbserver/config.h" |
#ifdef __MINGW32CE__ |
#include "wincecompat.h" |
@@ -59,10 +60,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 |
@@ -102,6 +99,12 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap); |
#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 +142,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,9 +199,9 @@ 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); |
void add_inferior_to_list (struct inferior_list *list, |
struct inferior_list_entry *new_inferior); |
@@ -245,8 +211,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); |
@@ -254,12 +218,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 *, |
@@ -272,8 +234,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); |
@@ -287,6 +247,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; |
@@ -342,6 +304,9 @@ extern int transport_is_reliable; |
int gdb_connected (void); |
+#define STDIO_CONNECTION_NAME "stdio" |
+int remote_connection_is_stdio (void); |
+ |
ptid_t read_ptid (char *buf, char **obuf); |
char *write_ptid (char *buf, ptid_t ptid); |
@@ -433,8 +398,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; |
@@ -507,6 +470,26 @@ int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline); |
int have_fast_tracepoint_trampoline_buffer (char *msgbuf); |
#endif |
+struct traceframe; |
+ |
+/* Do memory copies for bytecodes. */ |
+/* Do the recording of memory blocks for actions and bytecodes. */ |
+ |
+int agent_mem_read (struct traceframe *tframe, |
+ 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 traceframe *tframe, int n); |
+int agent_mem_read_string (struct traceframe *tframe, |
+ unsigned char *to, |
+ CORE_ADDR from, |
+ ULONGEST len); |
+ |
/* Bytecode compilation function vector. */ |
struct emit_ops |
@@ -562,6 +545,12 @@ struct emit_ops |
/* Returns the address of the get_raw_reg function in the IPA. */ |
CORE_ADDR get_raw_reg_func_addr (void); |
+/* 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); |
CORE_ADDR current_insn_ptr; |
int emit_error; |