[06/15,v2] Remove simple GDBSERVER uses from common, nat and target
Commit Message
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 <tromey@redhat.com>
Gary Benson <gbenson@redhat.com>
* 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(-)
@@ -17,11 +17,10 @@
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 "config.h"
+
+#include "libiberty.h"
+#include "common-utils.h"
#include "xml-utils.h"
#include "buffer.h"
@@ -17,12 +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 "config.h"
+#include "libiberty.h"
+#include "common-utils.h"
+#include "gdb_locale.h"
#include "gdb_assert.h"
#include <string.h>
@@ -16,15 +16,21 @@
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 "config.h"
+
#ifdef GDBSERVER
-#include "server.h"
+#include "build-gnulib-gdbserver/config.h"
#else
-#include "defs.h"
-#include <string.h>
+#include "build-gnulib/config.h"
#endif
+
+#include "common-utils.h"
+#include "gdb_locale.h"
#include "filestuff.h"
#include "gdb_vecs.h"
+#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
@@ -19,6 +19,8 @@
#ifndef FILESTUFF_H
#define FILESTUFF_H
+#include <stdio.h>
+
/* Note all the file descriptors which are open when this is called.
These file descriptors will not be closed by close_most_fds. */
@@ -17,14 +17,14 @@
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 "config.h"
#include <string.h>
+#include "libiberty.h"
+#include "common-utils.h"
+#include "errors.h"
+#include "gdb_locale.h"
#include "format.h"
struct format_piece *
@@ -17,12 +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 "config.h"
+#include "libiberty.h"
+#include "common-utils.h"
+#include "gdb_locale.h"
#include "gdb_vecs.h"
#include "host-defs.h"
@@ -17,11 +17,9 @@
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 "common-utils.h"
+#include "common-types.h"
+#include "gdb_locale.h"
#include "print-utils.h"
@@ -17,11 +17,9 @@
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 "common-utils.h"
+#include "common-types.h"
+#include "gdb_locale.h"
#include <string.h>
@@ -17,17 +17,25 @@
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 "config.h"
+
#ifdef GDBSERVER
-#include "server.h"
+#include "build-gnulib-gdbserver/config.h"
#else
-#include "defs.h"
-#include <string.h>
+#include "build-gnulib/config.h"
#endif
+#include <string.h>
+
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#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"
@@ -17,12 +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 "config.h"
+#include "libiberty.h"
+#include "common-utils.h"
+#include "gdb_locale.h"
#include "vec.h"
struct vec_prefix
@@ -17,12 +17,9 @@
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 "config.h"
+#include "libiberty.h"
#include "xml-utils.h"
#include <string.h>
@@ -17,13 +17,20 @@
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 "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 <sys/types.h>
#include <sys/sysinfo.h>
@@ -16,13 +16,21 @@
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 "config.h"
+
#ifdef GDBSERVER
-#include "server.h"
+#include "build-gnulib-gdbserver/config.h"
#else
-#include "defs.h"
-#include <string.h>
+#include "build-gnulib/config.h"
#endif
+#include <string.h>
+#include <stdlib.h>
+
+#include "common-utils.h"
+#include "libiberty.h"
+#include "errors.h"
+#include "gdb_locale.h"
#include "linux-procfs.h"
#include "filestuff.h"
@@ -16,13 +16,23 @@
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 "config.h"
+
#ifdef GDBSERVER
-#include "server.h"
+#include "build-gnulib-gdbserver/config.h"
#else
-#include "defs.h"
-#include <string.h>
+#include "build-gnulib/config.h"
#endif
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#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"
@@ -18,6 +18,7 @@
#include <sys/ptrace.h>
#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. */
@@ -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 <asm/ptrace.h>
#include <stdint.h>
@@ -17,12 +17,6 @@
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 "waitstatus.h"
/* Return a pretty printed form of target_waitstatus.