This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/5] move server.h to inferior.h


This patch moves some inferior-related code out server.h.  This change
is not related to ITSET very much, but since we've put too mcuh stuff
into server.h, it is reasonable to put them in separate header files.

gdb/gdbserver:

2012-03-16  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (server_h): Append inferior.h.
	* server.h: Move some code to ...
	* inferior.h: ... here.  New.
---
 gdb/gdbserver/Makefile.in |    3 +-
 gdb/gdbserver/inferior.h  |   54 +++++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/server.h    |   41 +--------------------------------
 3 files changed, 58 insertions(+), 40 deletions(-)
 create mode 100644 gdb/gdbserver/inferior.h

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 5db0e01..fbcdbcb 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -341,6 +341,7 @@ ax_h = $(srcdir)/ax.h
 agent_h = $(srcdir)/../common/agent.h
 linux_osdata_h = $(srcdir)/../common/linux-osdata.h
 vec_h = $(srcdir)/../common/vec.h
+inferior_h = $(srcdir)/inferior.h $(ptid_h)
 server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
 		$(srcdir)/mem-break.h $(srcdir)/../common/gdb_signals.h \
 		$(srcdir)/../common/common-utils.h \
@@ -349,7 +350,7 @@ server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
 		$(srcdir)/../common/gdb_assert.h \
 		$(srcdir)/../common/gdb_locale.h \
 		$(ptid_h) \
-		$(signals_h)
+		$(signals_h) $(inferior_h)
 
 linux_low_h = $(srcdir)/linux-low.h
 
diff --git a/gdb/gdbserver/inferior.h b/gdb/gdbserver/inferior.h
new file mode 100644
index 0000000..5275efe
--- /dev/null
+++ b/gdb/gdbserver/inferior.h
@@ -0,0 +1,54 @@
+
+#ifndef INFERIOR_H
+#define INFERIOR_H
+
+#include "ptid.h"
+
+struct inferior_list_entry
+{
+  ptid_t id;
+  struct inferior_list_entry *next;
+};
+
+struct inferior_list_entry;
+struct sym_cache;
+struct breakpoint;
+struct raw_breakpoint;
+struct fast_tracepoint_jump;
+struct process_info_private;
+
+struct inferior
+{
+  struct inferior_list_entry head;
+
+  /* Nonzero if this child process was attached rather than
+     spawned.  */
+  int attached;
+
+  /* True if GDB asked us to detach from this process, but we remained
+     attached anyway.  */
+  int gdb_detached;
+
+  /* The symbol cache.  */
+  struct sym_cache *symbol_cache;
+
+  /* The list of memory breakpoints.  */
+  struct breakpoint *breakpoints;
+
+  /* The list of raw memory breakpoints.  */
+  struct raw_breakpoint *raw_breakpoints;
+
+  /* The list of installed fast tracepoints.  */
+  struct fast_tracepoint_jump *fast_tracepoint_jumps;
+
+  /* Private target data.  */
+  struct process_info_private *private;
+};
+
+extern struct inferior_list all_processes;
+
+struct inferior *add_process (int pid, int attached);
+void remove_process (struct inferior *process);
+struct inferior *find_process_pid (int pid);
+
+#endif /* define INFERIOR_H */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 10bfc96..e95eaeb 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -130,11 +130,8 @@ struct inferior_list
   struct inferior_list_entry *head;
   struct inferior_list_entry *tail;
 };
-struct inferior_list_entry
-{
-  ptid_t id;
-  struct inferior_list_entry *next;
-};
+
+#include "inferior.h"
 
 struct thread_info;
 struct inferior;
@@ -191,40 +188,6 @@ struct dll_info
   CORE_ADDR base_addr;
 };
 
-struct sym_cache;
-struct breakpoint;
-struct raw_breakpoint;
-struct fast_tracepoint_jump;
-struct process_info_private;
-
-struct inferior
-{
-  struct inferior_list_entry head;
-
-  /* Nonzero if this child process was attached rather than
-     spawned.  */
-  int attached;
-
-  /* True if GDB asked us to detach from this process, but we remained
-     attached anyway.  */
-  int gdb_detached;
-
-  /* The symbol cache.  */
-  struct sym_cache *symbol_cache;
-
-  /* The list of memory breakpoints.  */
-  struct breakpoint *breakpoints;
-
-  /* The list of raw memory breakpoints.  */
-  struct raw_breakpoint *raw_breakpoints;
-
-  /* The list of installed fast tracepoints.  */
-  struct fast_tracepoint_jump *fast_tracepoint_jumps;
-
-  /* Private target data.  */
-  struct process_info_private *private;
-};
-
 /* Return a pointer to the process that corresponds to the current
    thread (current_inferior).  It is an error to call this if there is
    no current thread selected.  */
-- 
1.7.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]