From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Cc: Doug Evans <dje@google.com>, Pedro Alves <palves@redhat.com>,
Tom Tromey <tromey@redhat.com>
Subject: [PATCH 08/11 v5] Include common-defs.h instead of defs.h/server.h in shared code
Date: Fri, 01 Aug 2014 10:27:00 -0000 [thread overview]
Message-ID: <1406888377-25795-9-git-send-email-gbenson@redhat.com> (raw)
In-Reply-To: <1406888377-25795-1-git-send-email-gbenson@redhat.com>
This commit makes 19 of the 22 shared .c files in common, nat and
target include common-defs.h instead of defs.h/server.h. The
remaining three files need slight extra work and are dealt with
in separate commits.
gdb/
2014-08-01 Gary Benson <gbenson@redhat.com>
* common/agent.c: Include common-defs.h.
Don't include defs.h or server.h.
* common/buffer.c: Likewise.
* common/common-debug.c: Likewise.
* common/common-utils.c: Likewise.
* common/errors.c: Likewise.
* common/filestuff.c: Likewise.
* common/format.c: Likewise.
* common/gdb_vecs.c: Likewise.
* common/print-utils.c: Likewise.
* common/ptid.c: Likewise.
* common/rsp-low.c: Likewise.
* common/signals.c: Likewise.
* common/vec.c: Likewise.
* common/xml-utils.c: Likewise.
* nat/linux-osdata.c: Likewise.
* nat/linux-procfs.c: Likewise.
* nat/linux-ptrace.c: Likewise.
* nat/mips-linux-watch.c: Likewise.
* target/waitstatus.c: Likewise.
---
gdb/ChangeLog | 23 +++++++++++++++++++++++
gdb/common/agent.c | 6 +-----
gdb/common/buffer.c | 7 +------
gdb/common/common-debug.c | 6 +-----
gdb/common/common-utils.c | 6 +-----
gdb/common/errors.c | 6 +-----
gdb/common/filestuff.c | 6 +-----
gdb/common/format.c | 7 +------
gdb/common/gdb_vecs.c | 7 +------
gdb/common/print-utils.c | 7 +------
gdb/common/ptid.c | 6 +-----
gdb/common/rsp-low.c | 7 +------
gdb/common/signals.c | 6 +-----
gdb/common/vec.c | 7 +------
gdb/common/xml-utils.c | 7 +------
gdb/nat/linux-osdata.c | 7 +------
gdb/nat/linux-procfs.c | 7 +------
gdb/nat/linux-ptrace.c | 7 +------
gdb/nat/mips-linux-watch.c | 6 +-----
gdb/target/waitstatus.c | 7 +------
20 files changed, 42 insertions(+), 106 deletions(-)
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index d68e50e..8b90c4d 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include "target/target.h"
#include "target/symbol.h"
#include <unistd.h>
diff --git a/gdb/common/buffer.c b/gdb/common/buffer.c
index 4a213b3..d6afb6a 100644
--- a/gdb/common/buffer.c
+++ b/gdb/common/buffer.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "xml-utils.h"
#include "buffer.h"
#include "inttypes.h"
diff --git a/gdb/common/common-debug.c b/gdb/common/common-debug.c
index 660fc70..22f6a8a 100644
--- a/gdb/common/common-debug.c
+++ b/gdb/common/common-debug.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include "common-debug.h"
/* See common/common-debug.h. */
diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c
index a905d1d..3b8237e 100644
--- a/gdb/common/common-utils.c
+++ b/gdb/common/common-utils.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
/* The xmalloc() (libiberty.h) family of memory management routines.
diff --git a/gdb/common/errors.c b/gdb/common/errors.c
index 7d0bb6e..6da2666 100644
--- a/gdb/common/errors.c
+++ b/gdb/common/errors.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include "errors.h"
/* See common/errors.h. */
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index a31ecd7..7ee9c5a 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -16,11 +16,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include "filestuff.h"
#include "gdb_vecs.h"
#include <fcntl.h>
diff --git a/gdb/common/format.c b/gdb/common/format.c
index 247aaff..b989dc7 100644
--- a/gdb/common/format.c
+++ b/gdb/common/format.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "format.h"
struct format_piece *
diff --git a/gdb/common/gdb_vecs.c b/gdb/common/gdb_vecs.c
index 4a3330f..ae11cc6 100644
--- a/gdb/common/gdb_vecs.c
+++ b/gdb/common/gdb_vecs.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "gdb_vecs.h"
#include "host-defs.h"
diff --git a/gdb/common/print-utils.c b/gdb/common/print-utils.c
index f5bef0a..820ade0 100644
--- a/gdb/common/print-utils.c
+++ b/gdb/common/print-utils.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "print-utils.h"
#include <stdint.h>
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index 04fd118..84e4aa7 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include "ptid.h"
/* See ptid.h for these. */
diff --git a/gdb/common/rsp-low.c b/gdb/common/rsp-low.c
index 0263005..e88799a 100644
--- a/gdb/common/rsp-low.c
+++ b/gdb/common/rsp-low.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "rsp-low.h"
/* See rsp-low.h. */
diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 13d1e2c..ebe2761 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -17,11 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>
diff --git a/gdb/common/vec.c b/gdb/common/vec.c
index 4611e5f..9fc6915 100644
--- a/gdb/common/vec.c
+++ b/gdb/common/vec.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "vec.h"
struct vec_prefix
diff --git a/gdb/common/xml-utils.c b/gdb/common/xml-utils.c
index 0f81390..b90dd21 100644
--- a/gdb/common/xml-utils.c
+++ b/gdb/common/xml-utils.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "xml-utils.h"
/* Return a malloc allocated string with special characters from TEXT
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index 887e518..3f72883 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "linux-osdata.h"
#include <sys/types.h>
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 84fc890..30797da 100644
--- a/gdb/nat/linux-procfs.c
+++ b/gdb/nat/linux-procfs.c
@@ -16,12 +16,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "linux-procfs.h"
#include "filestuff.h"
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index b4db862..6275516 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -16,12 +16,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.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 ea6e02d..afa3d78 100644
--- a/gdb/nat/mips-linux-watch.c
+++ b/gdb/nat/mips-linux-watch.c
@@ -15,11 +15,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
+#include "common-defs.h"
#include <sys/ptrace.h>
#include "mips-linux-watch.h"
diff --git a/gdb/target/waitstatus.c b/gdb/target/waitstatus.c
index 4493555..717f47a 100644
--- a/gdb/target/waitstatus.c
+++ b/gdb/target/waitstatus.c
@@ -17,12 +17,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/>. */
-#ifdef GDBSERVER
-#include "server.h"
-#else
-#include "defs.h"
-#endif
-
+#include "common-defs.h"
#include "waitstatus.h"
/* Return a pretty printed form of target_waitstatus.
--
1.7.1
next prev parent reply other threads:[~2014-08-01 10:27 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 10:19 [PATCH 00/11 v5] Common code cleanups Gary Benson
2014-08-01 10:19 ` [PATCH 04/11 v5] Introduce and use debug_printf and debug_vprintf Gary Benson
2014-08-06 17:08 ` Doug Evans
2014-08-07 9:22 ` Gary Benson
2014-08-01 10:19 ` [PATCH 02/11 v5] Introduce common-types.h Gary Benson
2014-08-06 16:34 ` Doug Evans
2014-08-01 10:19 ` [PATCH 03/11 v5] Move print-utils.h to common-defs.h Gary Benson
2014-08-06 16:51 ` Doug Evans
2014-08-06 17:05 ` Gary Benson
2014-08-01 10:22 ` [PATCH 07/11 v5] Introduce get_thread_regcache_for_ptid Gary Benson
2014-08-06 18:15 ` Doug Evans
2014-08-01 10:22 ` [PATCH 09/11 v5] Remove GDBSERVER uses from linux-btrace.c Gary Benson
2014-08-06 18:27 ` Doug Evans
2014-08-01 10:27 ` Gary Benson [this message]
2014-08-06 18:16 ` [PATCH 08/11 v5] Include common-defs.h instead of defs.h/server.h in shared code Doug Evans
2014-08-01 10:27 ` [PATCH 10/11 v5] Remove GDBSERVER uses from i386-dregs.c Gary Benson
2014-08-06 18:32 ` Doug Evans
2014-08-07 12:28 ` Gary Benson
2014-08-01 10:28 ` [PATCH 06/11 v5] Add target/symbol.h Gary Benson
2014-08-06 18:08 ` Doug Evans
2014-08-07 10:42 ` Gary Benson
2014-08-20 11:16 ` Pedro Alves
2014-08-20 12:14 ` Gary Benson
2014-08-20 14:17 ` Pedro Alves
2014-08-01 10:28 ` [PATCH 05/11 v5] Add target/target.h Gary Benson
2014-08-06 17:49 ` Doug Evans
2014-08-07 13:48 ` Gary Benson
2014-08-20 14:49 ` Pedro Alves
2014-08-20 15:01 ` Gary Benson
2014-08-20 15:08 ` Pedro Alves
2014-08-20 12:00 ` Pedro Alves
2014-08-20 12:01 ` Pedro Alves
2014-08-20 13:38 ` Gary Benson
2014-08-01 10:30 ` [PATCH 01/11 v5] Introduce common/errors.h Gary Benson
2014-08-06 16:20 ` Doug Evans
2014-08-06 16:29 ` Gary Benson
2014-08-06 16:40 ` Doug Evans
2014-08-01 10:41 ` [PATCH 11/11 v5] Remove one GDBSERVER use from linux-waitpid.c Gary Benson
2014-08-06 18:35 ` Doug Evans
2014-08-07 12:39 ` Gary Benson
2014-08-20 15:04 ` Pedro Alves
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=1406888377-25795-9-git-send-email-gbenson@redhat.com \
--to=gbenson@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=tromey@redhat.com \
/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