[1/3] Make all source files include defs.h or server.h first
Commit Message
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 <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-25 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 | 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(-)
Comments
On 07/25/2014 02:34 PM, Gary Benson wrote:
> 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 <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-25 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.
Looks good to me.
Thanks,
Pedro Alves
@@ -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"
@@ -17,6 +17,11 @@
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. */
@@ -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
@@ -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"
@@ -17,11 +17,11 @@
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"
@@ -47,6 +47,7 @@
# 3 is done by function 'handle_notif_ack'. */
+#include "server.h"
#include "notif.h"
static struct notif_server *notifs[] =
@@ -15,6 +15,11 @@
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"