From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 4/5] move server.h to inferior.h
Date: Fri, 16 Mar 2012 15:01:00 -0000 [thread overview]
Message-ID: <1331909994-9473-5-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1331909994-9473-1-git-send-email-yao@codesourcery.com>
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
next prev parent reply other threads:[~2012-03-16 15:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 15:01 [PATCH 0/5] Preparatory patches for ITSET in GDBserver Yao Qi
2012-03-16 15:01 ` [PATCH 1/5] Define target_core_of_thread in gdbserver Yao Qi
2012-03-16 15:01 ` Yao Qi [this message]
2012-04-13 17:37 ` [PATCH 4/5] move server.h to inferior.h Tom Tromey
2012-03-16 15:01 ` [PATCH 3/5] s/struct process_info/struct inferior/ Yao Qi
2012-03-20 16:28 ` Doug Evans
2012-03-20 17:55 ` Pedro Alves
2012-03-20 21:31 ` Doug Evans
2012-03-21 4:27 ` Yao Qi
2012-03-21 3:18 ` Yao Qi
2012-03-16 15:02 ` [PATCH 2/5] Move vec to common/ Yao Qi
2012-03-16 15:02 ` [PATCH 5/5] move server.h to gdbthread.h Yao Qi
2012-04-13 17:43 ` Tom Tromey
2012-04-19 4:35 ` Yao Qi
2012-04-29 6:46 ` [committed]: " Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331909994-9473-5-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox