From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 06/15] Remove simple GDBSERVER uses from common, nat and target
Date: Wed, 09 Jul 2014 10:41:00 -0000 [thread overview]
Message-ID: <1404902255-11101-7-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1404902255-11101-1-git-send-email-gbenson@redhat.com>
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-09 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(-)
diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c
index 4d9edb8..80b4fa1 100644
--- a/gdb/common/buffer.c
+++ b/gdb/common/buffer.c
@@ -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"
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index 29fe2c5..ff4856b 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -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>
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index 4544926..1d93726 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -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>
diff --git a/gdb/common/filestuff.h b/gdb/common/filestuff.h
index 70e09aa..3bc0d40 100644
--- a/gdb/common/filestuff.h
+++ b/gdb/common/filestuff.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. */
diff --git a/gdb/common/format.c b/gdb/common/format.c
index bddfbc6..05156a8 100644
--- a/gdb/common/format.c
+++ b/gdb/common/format.c
@@ -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 *
diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c
index 4a3330f..edfab81 100644
--- a/gdb/common/gdb_vecs.c
+++ b/gdb/common/gdb_vecs.c
@@ -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"
diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c
index 0e612a3..0026b1e 100644
--- a/gdb/common/print-utils.c
+++ b/gdb/common/print-utils.c
@@ -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"
diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c
index b777716..597113e 100644
--- a/gdb/common/rsp-low.c
+++ b/gdb/common/rsp-low.c
@@ -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>
diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 3c9cd41..8e903ea 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -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"
diff --git a/gdb/common/vec.c b/gdb/common/vec.c
index 4611e5f..d6db2e5 100644
--- a/gdb/common/vec.c
+++ b/gdb/common/vec.c
@@ -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
diff --git a/gdb/common/xml-utils.c b/gdb/common/xml-utils.c
index c6ceb69..d2b7d17 100644
--- a/gdb/common/xml-utils.c
+++ b/gdb/common/xml-utils.c
@@ -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>
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index dae637b..8df6fc3 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -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>
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 1443a88..1577a62 100644
--- a/gdb/nat/linux-procfs.c
+++ b/gdb/nat/linux-procfs.c
@@ -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"
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index e3462ec..01bab14 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -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"
diff --git a/gdb/nat/mips-linux-watch.c b/gdb/nat/mips-linux-watch.c
index acfc7f4..f57e2fd 100644
--- a/gdb/nat/mips-linux-watch.c
+++ b/gdb/nat/mips-linux-watch.c
@@ -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. */
diff --git a/gdb/nat/mips-linux-watch.h b/gdb/nat/mips-linux-watch.h
index c9f6932..b5ddd4b 100644
--- a/gdb/nat/mips-linux-watch.h
+++ b/gdb/nat/mips-linux-watch.h
@@ -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>
diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c
index 4493555..9021477 100644
--- a/gdb/target/waitstatus.c
+++ b/gdb/target/waitstatus.c
@@ -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.
--
1.7.1
next prev parent reply other threads:[~2014-07-09 10:41 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 11:25 [PATCH 00/15] Common code cleanups Gary Benson
2014-07-09 10:38 ` [PATCH 01/15] Introduce common/errors.h Gary Benson
2014-07-09 10:38 ` [PATCH 02/15] Remove some GDBSERVER checks from linux-ptrace Gary Benson
2014-07-09 17:27 ` Breazeal, Don
2014-07-09 18:20 ` Gary Benson
2014-07-09 18:23 ` Breazeal, Don
2014-07-11 19:30 ` Doug Evans
2014-07-15 12:30 ` Gary Benson
2014-07-09 10:38 ` [PATCH 03/15] Make gdbserver CORE_ADDR unsigned Gary Benson
2014-07-11 19:34 ` Doug Evans
2014-07-09 10:38 ` [PATCH 04/15] Introduce common-types.h Gary Benson
2014-07-09 10:39 ` [PATCH 11/15] More target unification Gary Benson
2014-07-14 19:17 ` Doug Evans
2014-07-16 10:23 ` Gary Benson
2014-07-09 10:39 ` [PATCH 09/15] Mostly remove GDBSERVER from linux-waitpid.c Gary Benson
2014-07-14 19:01 ` Doug Evans
2014-07-15 17:17 ` Gary Benson
2014-07-09 10:39 ` [PATCH 15/15] Finally remove GDBSERVER (mostly) from linux-btrace.c Gary Benson
2014-07-09 10:41 ` Gary Benson [this message]
2014-07-14 18:49 ` [PATCH 06/15] Remove simple GDBSERVER uses from common, nat and target Doug Evans
2014-07-15 15:42 ` Gary Benson
2014-07-09 10:41 ` [PATCH 07/15] Remove GDBSERVER use from nat/i386-dregs.c Gary Benson
2014-07-10 17:49 ` Tom Tromey
2014-07-11 12:57 ` Gary Benson
2014-07-11 15:38 ` Tom Tromey
2014-07-14 8:36 ` Gary Benson
2014-07-14 18:49 ` Doug Evans
2014-07-09 10:41 ` [PATCH 08/15] Make btrace-common.h not use GDBSERVER Gary Benson
2014-07-14 18:59 ` Doug Evans
2014-07-09 10:41 ` [PATCH 10/15] Add target/target.h Gary Benson
2014-07-10 17:50 ` Tom Tromey
2014-07-16 8:55 ` Gary Benson
2014-07-17 16:49 ` Tom Tromey
2014-07-09 10:52 ` [PATCH 05/15] Introduce and use debug_printf and debug_vprintf Gary Benson
2014-07-11 19:57 ` Doug Evans
2014-07-15 15:21 ` Gary Benson
2014-07-09 11:25 ` [PATCH 14/15] Introduce common_get_thread_regcache Gary Benson
2014-07-14 20:32 ` Doug Evans
2014-07-16 13:32 ` Gary Benson
2014-07-09 11:25 ` [PATCH 12/15] Add target/symbol.h, update users Gary Benson
2014-07-10 17:52 ` Tom Tromey
2014-07-10 18:55 ` Doug Evans
2014-07-10 19:16 ` Tom Tromey
2014-07-11 13:25 ` Gary Benson
2014-07-11 19:29 ` Doug Evans
2014-07-16 13:01 ` Gary Benson
2014-07-17 18:14 ` Tom Tromey
2014-07-16 10:38 ` Gary Benson
2014-07-17 16:50 ` Tom Tromey
2014-07-09 11:32 ` [PATCH 13/15] Finally remove GDBSERVER (mostly) from agent.c Gary Benson
2014-07-14 19:35 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404902255-11101-7-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox