Make all source files include defs.h or server.h first
authorGary Benson <gbenson@redhat.com>
Fri, 25 Jul 2014 11:18:00 +0000 (12:18 +0100)
committerGary Benson <gbenson@redhat.com>
Wed, 30 Jul 2014 08:22:48 +0000 (09:22 +0100)
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  <gbenson@redhat.com>

* 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  <gbenson@redhat.com>

* 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
gdb/btrace.c
gdb/common/ptid.c
gdb/gdbserver/ChangeLog
gdb/gdbserver/hostio-errno.c
gdb/gdbserver/inferiors.c
gdb/gdbserver/linux-x86-low.c
gdb/gdbserver/notif.c
gdb/nat/mips-linux-watch.c

index 460547bdcceaa5f3aaca52b5bce70c468e25f150..144a5271d99fd7138f7d8dfd80e17df709b81873 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-30  Gary Benson  <gbenson@redhat.com>
+
+       * 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  <tromey@redhat.com>
 
        * target.c (target_is_pushed): Simplify.
index 87a171e812eb9b212679bb7b72275b73cf40fdab..b5c3c260b72c460aeab622e674555320112ca9aa 100644 (file)
@@ -19,6 +19,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "defs.h"
 #include "btrace.h"
 #include "gdbthread.h"
 #include "exceptions.h"
index f614669f93f1cf45aa7006827313a9603b4c1d55..04fd118855c52108214a52863213dab503f56487 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifdef GDBSERVER
+#include "server.h"
+#else
+#include "defs.h"
+#endif
 #include "ptid.h"
 
 /* See ptid.h for these.  */
index 60d2430ce790d78817ba43b37789d584f3d7e601..df20e8c2ea192df5557221852a153b6fe275a39e 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-30  Gary Benson  <gbenson@redhat.com>
+
+       * 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  <tromey@redhat.com>
            Gary Benson  <gbenson@redhat.com>
 
index afe3c36fc6d963d8e32f2efbdbaa145f8405d1ef..8817096517d3d1a6922ebc180c177f8f8cfc7e96 100644 (file)
@@ -21,8 +21,8 @@
 /* This file implements the hostio_last_error target callback
    on top of errno.  */
 
-#include <errno.h>
 #include "server.h"
+#include <errno.h>
 #include "gdb/fileio.h"
 
 static int
index 8c1375f6a369a5574616568d5cb726b426a9e8c3..48d7700b57f89e5cfc0a8b1a562734ce2929274a 100644 (file)
@@ -18,9 +18,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <stdlib.h>
-
 #include "server.h"
+#include <stdlib.h>
 #include "gdbthread.h"
 #include "dll.h"
 
index 9ba71e58b5715018f29bb7a813ee85d3d45cc3f8..850ed7cd4e3d7a04c1954c45947f388de66ccf27 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "server.h"
 #include <stddef.h>
 #include <signal.h>
 #include <limits.h>
 #include <inttypes.h>
-#include "server.h"
 #include "linux-low.h"
 #include "i387-fp.h"
 #include "i386-low.h"
index 8bc66dca9e3c556bc3b0b3f767e4289599ef5aae..d69b2ed1c1ae11c0c97fef09b5adde3536910f4e 100644 (file)
@@ -47,6 +47,7 @@
 
    # 3 is done by function 'handle_notif_ack'.  */
 
+#include "server.h"
 #include "notif.h"
 
 static struct notif_server *notifs[] =
index acfc7f41a98881d6c6fd55c5eb5abcc89563838a..ebe55233ae27a3699ae84d8b975503f150152e2f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifdef GDBSERVER
+#include "server.h"
+#else
+#include "defs.h"
+#endif
 #include <sys/ptrace.h>
 #include "mips-linux-watch.h"
 #include "gdb_assert.h"