From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6255 invoked by alias); 16 Mar 2012 15:01:47 -0000 Received: (qmail 6242 invoked by uid 22791); 16 Mar 2012 15:01:46 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 15:01:30 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1S8Yem-0000Lt-FE from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 16 Mar 2012 08:01:28 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 16 Mar 2012 08:01:25 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Fri, 16 Mar 2012 08:01:27 -0700 From: Yao Qi To: Subject: [PATCH 4/5] move server.h to inferior.h Date: Fri, 16 Mar 2012 15:01:00 -0000 Message-ID: <1331909994-9473-5-git-send-email-yao@codesourcery.com> In-Reply-To: <1331909994-9473-1-git-send-email-yao@codesourcery.com> References: <1331909994-9473-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00615.txt.bz2 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 * 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