From patchwork Fri Jul 25 13:34:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2175 Received: (qmail 16565 invoked by alias); 25 Jul 2014 13:34:37 -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 16377 invoked by uid 89); 25 Jul 2014 13:34:34 -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; Fri, 25 Jul 2014 13:34:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6PDYVXW008552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 25 Jul 2014 09:34:31 -0400 Received: from blade.nx (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6PDYUXQ019617 for ; Fri, 25 Jul 2014 09:34:30 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 9DD1F2640CA for ; Fri, 25 Jul 2014 14:34:29 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Make all source files include defs.h or server.h first Date: Fri, 25 Jul 2014 14:34:23 +0100 Message-Id: <1406295265-4681-2-git-send-email-gbenson@redhat.com> In-Reply-To: <1406295265-4681-1-git-send-email-gbenson@redhat.com> References: <1406295265-4681-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit makes all source files under gdb/ that include headers from gdb/ include either defs.h or server.h before any other code. This ensures that definitions and macros from the two config.h files are always in place for our code. An exception has been made for gdb/gdbserver/gdbreplay.c which seems to be a special case. gdb/ 2014-07-25 Gary Benson * btrace.c: Include defs.h. * common/ptid.c: Include defs.h or server.h as appropriate. * nat/mips-linux-watch.c: Likewise. gdb/gdbserver/ 2014-07-25 Gary Benson * hostio-errno.c: Move server.h to top of includes list. * inferiors.c: Likewise. * linux-x86-low.c: Likewise. * notif.c: Include server.h. --- gdb/ChangeLog | 6 ++++++ gdb/btrace.c | 1 + gdb/common/ptid.c | 5 +++++ gdb/gdbserver/ChangeLog | 7 +++++++ gdb/gdbserver/hostio-errno.c | 2 +- gdb/gdbserver/inferiors.c | 3 +-- gdb/gdbserver/linux-x86-low.c | 2 +- gdb/gdbserver/notif.c | 1 + gdb/nat/mips-linux-watch.c | 5 +++++ 9 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gdb/btrace.c b/gdb/btrace.c index 87a171e..b5c3c26 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "defs.h" #include "btrace.h" #include "gdbthread.h" #include "exceptions.h" diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c index f614669..04fd118 100644 --- a/gdb/common/ptid.c +++ b/gdb/common/ptid.c @@ -17,6 +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 "ptid.h" /* See ptid.h for these. */ diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c index afe3c36..8817096 100644 --- a/gdb/gdbserver/hostio-errno.c +++ b/gdb/gdbserver/hostio-errno.c @@ -21,8 +21,8 @@ /* This file implements the hostio_last_error target callback on top of errno. */ -#include #include "server.h" +#include #include "gdb/fileio.h" static int diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index 8c1375f..48d7700 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -18,9 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include - #include "server.h" +#include #include "gdbthread.h" #include "dll.h" diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 9ba71e5..850ed7c 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "server.h" #include #include #include #include -#include "server.h" #include "linux-low.h" #include "i387-fp.h" #include "i386-low.h" diff --git a/gdb/gdbserver/notif.c b/gdb/gdbserver/notif.c index 8bc66dc..d69b2ed 100644 --- a/gdb/gdbserver/notif.c +++ b/gdb/gdbserver/notif.c @@ -47,6 +47,7 @@ # 3 is done by function 'handle_notif_ack'. */ +#include "server.h" #include "notif.h" static struct notif_server *notifs[] = diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c index acfc7f4..ebe5523 100644 --- a/gdb/nat/mips-linux-watch.c +++ b/gdb/nat/mips-linux-watch.c @@ -15,6 +15,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 #include "mips-linux-watch.h" #include "gdb_assert.h"