From patchwork Wed Jul 16 14:17:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2085 Received: (qmail 6078 invoked by alias); 16 Jul 2014 16:45:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5986 invoked by uid 89); 16 Jul 2014 16:45:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Jul 2014 16:45:31 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6GGJbK7019973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Jul 2014 12:19:37 -0400 Received: from blade.nx (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6GGJZJm003260; Wed, 16 Jul 2014 12:19:36 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 1C86C2640CC; Wed, 16 Jul 2014 15:17:31 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Cc: Tom Tromey , Doug Evans Subject: [PATCH 06/15 v2] Remove simple GDBSERVER uses from common, nat and target Date: Wed, 16 Jul 2014 15:17:14 +0100 Message-Id: <1405520243-17282-7-git-send-email-gbenson@redhat.com> In-Reply-To: <1405520243-17282-1-git-send-email-gbenson@redhat.com> References: <1405520243-17282-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This removes various simple GDBSERVER uses from common, nat and target. The simple uses are just cases where the code includes defs.h or server.h depending on GDBSERVER. Instead, now the files include the headers that they require. Unfortunately we still need to check GDBSERVER for some files to decide which gnulib config header to import, but this is a step in the right direction. gdb/ 2014-07-16 Tom Tromey Gary Benson * common/buffer.c: Don't include server.h or defs.h; update includes. * common/common-utils.c: Don't include server.h or defs.h; update includes. * common/filestuff.c: Don't include server.h or defs.h; update includes. * common/filestuff.h: Include stdio.h. * common/format.c: Don't include server.h or defs.h; update includes. * common/gdb_vecs.c: Don't include server.h or defs.h; update includes. * common/print-utils.c: Don't include server.h or defs.h; update includes. * common/rsp-low.c: Don't include server.h or defs.h; update includes. * common/signals.c: Don't include server.h or defs.h; update includes. * common/vec.c: Don't include server.h or defs.h; update includes. * common/xml-utils.c: Don't include server.h or defs.h; update includes. * nat/linux-osdata.c: Don't include server.h or defs.h; update includes. * nat/linux-procfs.c: Don't include server.h or defs.h; update includes. * nat/linux-ptrace.c: Don't include server.h or defs.h; update includes. * nat/mips-linux-watch.h: Don't include server.h or defs.h; update includes. * target/waitstatus.c: Don't include server.h or defs.h; update includes. --- gdb/ChangeLog | 34 ++++++++++++++++++++++++++++++++++ gdb/common/buffer.c | 9 ++++----- gdb/common/common-utils.c | 9 ++++----- gdb/common/filestuff.c | 12 +++++++++--- gdb/common/filestuff.h | 2 ++ gdb/common/format.c | 10 +++++----- gdb/common/gdb_vecs.c | 9 ++++----- gdb/common/print-utils.c | 8 +++----- gdb/common/rsp-low.c | 8 +++----- gdb/common/signals.c | 14 +++++++++++--- gdb/common/vec.c | 9 ++++----- gdb/common/xml-utils.c | 7 ++----- gdb/nat/linux-osdata.c | 11 +++++++++-- gdb/nat/linux-procfs.c | 14 +++++++++++--- gdb/nat/linux-ptrace.c | 16 +++++++++++++--- gdb/nat/mips-linux-watch.c | 1 + gdb/nat/mips-linux-watch.h | 7 ++----- gdb/target/waitstatus.c | 6 ------ 18 files changed, 121 insertions(+), 65 deletions(-) diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c index 4d9edb8..fe7d4ca 100644 --- a/gdb/common/buffer.c +++ b/gdb/common/buffer.c @@ -17,11 +17,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" + +#include "libiberty.h" +#include "common-utils.h" #include "xml-utils.h" #include "buffer.h" diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c index 29fe2c5..c790075 100644 --- a/gdb/common/common-utils.c +++ b/gdb/common/common-utils.c @@ -17,12 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" +#include "libiberty.h" +#include "common-utils.h" +#include "gdb_locale.h" #include "gdb_assert.h" #include diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index 4544926..b2adb22 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -16,15 +16,21 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #ifdef GDBSERVER -#include "server.h" +#include "build-gnulib-gdbserver/config.h" #else -#include "defs.h" -#include +#include "build-gnulib/config.h" #endif + +#include "common-utils.h" +#include "gdb_locale.h" #include "filestuff.h" #include "gdb_vecs.h" +#include +#include #include #include #include diff --git a/gdb/common/filestuff.h b/gdb/common/filestuff.h index 70e09aa..3bc0d40 100644 --- a/gdb/common/filestuff.h +++ b/gdb/common/filestuff.h @@ -19,6 +19,8 @@ #ifndef FILESTUFF_H #define FILESTUFF_H +#include + /* Note all the file descriptors which are open when this is called. These file descriptors will not be closed by close_most_fds. */ diff --git a/gdb/common/format.c b/gdb/common/format.c index bddfbc6..b439720 100644 --- a/gdb/common/format.c +++ b/gdb/common/format.c @@ -17,14 +17,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" #include +#include "libiberty.h" +#include "common-utils.h" +#include "errors.h" +#include "gdb_locale.h" #include "format.h" struct format_piece * diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c index 4a3330f..e28256c 100644 --- a/gdb/common/gdb_vecs.c +++ b/gdb/common/gdb_vecs.c @@ -17,12 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" +#include "libiberty.h" +#include "common-utils.h" +#include "gdb_locale.h" #include "gdb_vecs.h" #include "host-defs.h" diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c index 0e612a3..0026b1e 100644 --- a/gdb/common/print-utils.c +++ b/gdb/common/print-utils.c @@ -17,11 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-utils.h" +#include "common-types.h" +#include "gdb_locale.h" #include "print-utils.h" diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c index b777716..597113e 100644 --- a/gdb/common/rsp-low.c +++ b/gdb/common/rsp-low.c @@ -17,11 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "common-utils.h" +#include "common-types.h" +#include "gdb_locale.h" #include diff --git a/gdb/common/signals.c b/gdb/common/signals.c index 3c9cd41..0e2c30b 100644 --- a/gdb/common/signals.c +++ b/gdb/common/signals.c @@ -17,17 +17,25 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #ifdef GDBSERVER -#include "server.h" +#include "build-gnulib-gdbserver/config.h" #else -#include "defs.h" -#include +#include "build-gnulib/config.h" #endif +#include + #ifdef HAVE_SIGNAL_H #include #endif +#include "libiberty.h" +#include "common-utils.h" +#include "gdb_assert.h" +#include "errors.h" +#include "gdb_locale.h" #include "gdb_signals.h" #include "gdb_assert.h" diff --git a/gdb/common/vec.c b/gdb/common/vec.c index 4611e5f..c64e110 100644 --- a/gdb/common/vec.c +++ b/gdb/common/vec.c @@ -17,12 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" +#include "libiberty.h" +#include "common-utils.h" +#include "gdb_locale.h" #include "vec.h" struct vec_prefix diff --git a/gdb/common/xml-utils.c b/gdb/common/xml-utils.c index c6ceb69..ddc5965 100644 --- a/gdb/common/xml-utils.c +++ b/gdb/common/xml-utils.c @@ -17,12 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" +#include "libiberty.h" #include "xml-utils.h" #include diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c index dae637b..3635682 100644 --- a/gdb/nat/linux-osdata.c +++ b/gdb/nat/linux-osdata.c @@ -17,13 +17,20 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #ifdef GDBSERVER -#include "server.h" +#include "build-gnulib-gdbserver/config.h" #else -#include "defs.h" +#include "build-gnulib/config.h" #endif +#include "libiberty.h" +#include "common-types.h" #include "linux-osdata.h" +#include "common-utils.h" +#include "gdb_assert.h" +#include "gdb_locale.h" #include #include diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c index 1443a88..2628fad 100644 --- a/gdb/nat/linux-procfs.c +++ b/gdb/nat/linux-procfs.c @@ -16,13 +16,21 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #ifdef GDBSERVER -#include "server.h" +#include "build-gnulib-gdbserver/config.h" #else -#include "defs.h" -#include +#include "build-gnulib/config.h" #endif +#include +#include + +#include "common-utils.h" +#include "libiberty.h" +#include "errors.h" +#include "gdb_locale.h" #include "linux-procfs.h" #include "filestuff.h" diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c index e3462ec..4617211 100644 --- a/gdb/nat/linux-ptrace.c +++ b/gdb/nat/linux-ptrace.c @@ -16,13 +16,23 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #ifdef GDBSERVER -#include "server.h" +#include "build-gnulib-gdbserver/config.h" #else -#include "defs.h" -#include +#include "build-gnulib/config.h" #endif +#include +#include +#include + +#include "libiberty.h" +#include "common-utils.h" +#include "gdb_locale.h" +#include "errors.h" +#include "gdb_assert.h" #include "linux-ptrace.h" #include "linux-procfs.h" #include "linux-waitpid.h" diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c index acfc7f4..f57e2fd 100644 --- a/gdb/nat/mips-linux-watch.c +++ b/gdb/nat/mips-linux-watch.c @@ -18,6 +18,7 @@ #include #include "mips-linux-watch.h" #include "gdb_assert.h" +#include "gdb_locale.h" /* Assuming usable watch registers REGS, return the irw_mask of register N. */ diff --git a/gdb/nat/mips-linux-watch.h b/gdb/nat/mips-linux-watch.h index c9f6932..b5ddd4b 100644 --- a/gdb/nat/mips-linux-watch.h +++ b/gdb/nat/mips-linux-watch.h @@ -18,11 +18,8 @@ #ifndef MIPS_LINUX_WATCH_H #define MIPS_LINUX_WATCH_H 1 -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif +#include "config.h" +#include "common-types.h" #include #include diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c index 4493555..9021477 100644 --- a/gdb/target/waitstatus.c +++ b/gdb/target/waitstatus.c @@ -17,12 +17,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef GDBSERVER -#include "server.h" -#else -#include "defs.h" -#endif - #include "waitstatus.h" /* Return a pretty printed form of target_waitstatus.