From: Gary Benson Date: Fri, 25 Jul 2014 11:18:00 +0000 (+0100) Subject: Make all source files include defs.h or server.h first X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d41f6d8ea2868ed247c149c252741d02293c6659;p=binutils-gdb.git Make all source files include defs.h or server.h first 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-30 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-30 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 460547bdcce..144a5271d99 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-07-30 Gary Benson + + * btrace.c: Include defs.h. + * common/ptid.c: Include defs.h or server.h as appropriate. + * nat/mips-linux-watch.c: Likewise. + 2014-07-29 Tom Tromey * target.c (target_is_pushed): Simplify. diff --git a/gdb/btrace.c b/gdb/btrace.c index 87a171e812e..b5c3c260b72 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 f614669f93f..04fd118855c 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/ChangeLog b/gdb/gdbserver/ChangeLog index 60d2430ce79..df20e8c2ea1 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,10 @@ +2014-07-30 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. + 2014-07-24 Tom Tromey Gary Benson diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c index afe3c36fc6d..8817096517d 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 8c1375f6a36..48d7700b57f 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 9ba71e58b57..850ed7cd4e3 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 8bc66dca9e3..d69b2ed1c1a 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 acfc7f41a98..ebe55233ae2 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"