Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [0/10] RFC: use gnulib more heavily + more configure fixes
@ 2012-11-15 19:09 Tom Tromey
  2012-11-15 19:11 ` Tom Tromey
                   ` (12 more replies)
  0 siblings, 13 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:09 UTC (permalink / raw)
  To: gdb-patches

Here's the patch series to rely more heavily on gnulib.

Some of these patches move to using a gnulib module and delete some
corresponding gdb_*.h file.

Others just remove useless configury junk.

I tested by building each patch (cumulatively; while they are
conceptually independent, in practice if you try to rearrange them you
will get conflicts) on an x86-64 Fedora 16 box.  Of course, this is the
machine least likely to show any problems, but that's what I've got.

I did a "make check" of the series as a whole just to be sure.

More is possible here.  I didn't try to touch perror or strerror; we
could also perhaps use the gnulib socket-related modules; and maybe more
as well.

Let me know what you think.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
@ 2012-11-15 19:11 ` Tom Tromey
  2012-11-15 19:14 ` [1/10] RFC: update gnulib Tom Tromey
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:11 UTC (permalink / raw)
  To: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> Here's the patch series to rely more heavily on gnulib.

Tom> Let me know what you think.

One thing I forgot to note is that I didn't update the ARI code.
I'll look at that in a bit.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [1/10] RFC: update gnulib
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
  2012-11-15 19:11 ` Tom Tromey
@ 2012-11-15 19:14 ` Tom Tromey
  2012-11-15 19:19   ` Joel Brobecker
  2012-11-15 19:15 ` [0/10] RFC: use gnulib more heavily + more configure fixes Eli Zaretskii
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:14 UTC (permalink / raw)
  To: gdb-patches

This first patch just updates gdb to the latest (as of yesterday)
gnulib.  I wanted to use a few modules that weren't in the version we
were pegged to.

I've omitted all the auto-generated stuff from this patch.

Tom

	* gdb/gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Update.
	* gdb/gnulib/configure: Update.
	* gdb/gnulib/import/alloca.in.h: Update.
	* gdb/gnulib/import/localcharset.c: Update.
	* gdb/gnulib/import/m4/fcntl-o.m4: Update.
	* gdb/gnulib/import/m4/gnulib-cache.m4: Update.
	* gdb/gnulib/import/m4/gnulib-comp.m4: Update.
	* gdb/gnulib/import/stdbool.in.h: Update.
	* gdb/gnulib/import/verify.h: Update.
---
 gdb/gnulib/configure                 |   47 +++++++++-----
 gdb/gnulib/import/alloca.in.h        |    7 ++
 gdb/gnulib/import/localcharset.c     |    7 ++
 gdb/gnulib/import/m4/fcntl-o.m4      |   13 ++++-
 gdb/gnulib/import/m4/gnulib-cache.m4 |    2 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |  116 +++++++++++++++++-----------------
 gdb/gnulib/import/stdbool.in.h       |   51 +++++++++------
 gdb/gnulib/import/verify.h           |    6 ++-
 gdb/gnulib/update-gnulib.sh          |    2 +-
 9 files changed, 151 insertions(+), 100 deletions(-)

diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index 1bab512..0268057 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -32,7 +32,7 @@
 IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright"
 
 # The gnulib commit ID to use for the update.
-GNULIB_COMMIT_SHA1="a39f53ccb70a613e647e1019fb4c63645220267e"
+GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
 
 # The expected version number for the various auto tools we will
 # use after the import.
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
  2012-11-15 19:11 ` Tom Tromey
  2012-11-15 19:14 ` [1/10] RFC: update gnulib Tom Tromey
@ 2012-11-15 19:15 ` Eli Zaretskii
  2012-11-15 19:22 ` [3/10] RFC: remove gdb_dirent.h Tom Tromey
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-15 19:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Date: Thu, 15 Nov 2012 12:09:12 -0700
> 
> More is possible here.  I didn't try to touch perror or strerror; we
> could also perhaps use the gnulib socket-related modules; and maybe more
> as well.

Please, let's take this one small step at a time.  In my experience,
gnulib does not always cater well enough to non-Posix platforms, so we
should always compare its solutions with what we already have, on a
case by case basis.  E.g., their canonicalize_file_name does not
support Windows file names at all (although I submitted a patch to do
that in January!).  Also, many of their solutions are unnecessarily
complicated, while we might have much more simple and elegant
solutions.


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [1/10] RFC: update gnulib
  2012-11-15 19:14 ` [1/10] RFC: update gnulib Tom Tromey
@ 2012-11-15 19:19   ` Joel Brobecker
  0 siblings, 0 replies; 44+ messages in thread
From: Joel Brobecker @ 2012-11-15 19:19 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> This first patch just updates gdb to the latest (as of yesterday)
> gnulib.  I wanted to use a few modules that weren't in the version we
> were pegged to.

FTR: This will also have the nice side-effect of bringing in some
changes to the errno module that I need for Lynx178, regarding
EINVAL:

    commit daf7f8c02242c535d596231e2f655109b97fa2bc
    Author: Paul Eggert <eggert@cs.ucla.edu>
    Date:   Thu Nov 1 15:29:14 2012 -0700

        errno: port to LynxOS 178 2.2.2

        Problem reported by Joel Brobecker in
        <http://lists.gnu.org/archive/html/bug-gnulib/2012-10/msg00088.html>.
        * doc/posix-headers/errno.texi (errno.h): Document this.
        * lib/errno.in.h (EILSEQ, GNULIB_defined_EILSEQ) [!EILSEQ]: New macros.
        * lib/strerror-override.c, lib/strerror-override.h (strerror_override):
        Supply a string for EILSEQ.
        * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Check for EILSEQ.

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [3/10] RFC: remove gdb_dirent.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (2 preceding siblings ...)
  2012-11-15 19:15 ` [0/10] RFC: use gnulib more heavily + more configure fixes Eli Zaretskii
@ 2012-11-15 19:22 ` Tom Tromey
  2012-11-16  2:46   ` Joel Brobecker
  2012-11-15 19:25 ` [4/10] RFC: unconditionally include signal.h Tom Tromey
                   ` (8 subsequent siblings)
  12 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:22 UTC (permalink / raw)
  To: gdb-patches

This patch removes gdb_dirent.h in favor of the corresponding gnulib
module.

Tom

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirent.
	* common/gdb_dirent.h: Remove.
	* common/linux-osdata.c: Use <dirent.h>.
	(NAMELEN): Define.
	* config.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Don't call AC_HEADER_DIRENT.
	* gnulib/aclocal.m4: Update.
	* gnulib/configure: Update.
	* gnulib/import/Makefile.am: Update.
	* gnulib/import/Makefile.in: Update.
	* gnulib/import/dirent.in.h: Update.
	* gnulib/import/m4/dirent_h.m4: Update.
	* gnulib/import/m4/gnulib-cache.m4: Update.
	* gnulib/import/m4/gnulib-comp.m4: Update.
	* gnulib/import/m4/unistd_h.m4: Update.
	* linux-fork.c: Update.
	* linux-nat.c: Update.
	* nto-procfs.c: Update.
	* procfs.c: Update.

	* Makefile.in (linux-osdata.o): Don't reference gdb_dirent.h.
	* config.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Don't call AC_HEADER_DIRENT.
---
 gdb/common/gdb_dirent.h              |   40 ---
 gdb/common/linux-osdata.c            |    4 +-
 gdb/config.in                        |   15 -
 gdb/configure                        |  159 ------------
 gdb/configure.ac                     |    1 -
 gdb/gdbserver/Makefile.in            |    2 +-
 gdb/gdbserver/config.in              |   15 -
 gdb/gdbserver/configure              |  159 ------------
 gdb/gdbserver/configure.ac           |    1 -
 gdb/gnulib/aclocal.m4                |    2 +
 gdb/gnulib/configure                 |  465 ++++++++++++++++++++++++++++++++--
 gdb/gnulib/import/Makefile.am        |   50 ++++-
 gdb/gnulib/import/Makefile.in        |  215 +++++++++++++++-
 gdb/gnulib/import/dirent.in.h        |  258 +++++++++++++++++++
 gdb/gnulib/import/m4/dirent_h.m4     |   64 +++++
 gdb/gnulib/import/m4/gnulib-cache.m4 |    3 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |    5 +
 gdb/gnulib/import/m4/unistd_h.m4     |  187 ++++++++++++++
 gdb/gnulib/update-gnulib.sh          |    2 +-
 gdb/linux-fork.c                     |    2 +-
 gdb/linux-nat.c                      |    2 +-
 gdb/nto-procfs.c                     |    2 +-
 gdb/procfs.c                         |    2 +-
 23 files changed, 1223 insertions(+), 432 deletions(-)
 delete mode 100644 gdb/common/gdb_dirent.h
 create mode 100644 gdb/gnulib/import/dirent.in.h
 create mode 100644 gdb/gnulib/import/m4/dirent_h.m4
 create mode 100644 gdb/gnulib/import/m4/unistd_h.m4

diff --git a/gdb/common/gdb_dirent.h b/gdb/common/gdb_dirent.h
deleted file mode 100644
index 183dfe4..0000000
--- a/gdb/common/gdb_dirent.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Portable <dirent.h>.
-   Copyright (C) 2000, 2002, 2007-2012 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef GDB_DIRENT_H
-#define GDB_DIRENT_H 1
-
-/* See description of `AC_HEADER_DIRENT' in the Autoconf manual.  */
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>		/* ARI: dirent.h */
-# define NAMELEN(dirent) strlen ((dirent)->d_name)    /* ARI: strlen d_name */
-#else
-# define dirent direct
-# define NAMELEN(dirent) (dirent)->d_namelen	/* ARI: d_namelen */
-# ifdef HAVE_SYS_NDIR_H
-#  include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-#  include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-#  include <ndir.h>
-# endif
-#endif
-
-#endif /* not GDB_DIRENT_H */
diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c
index afe3e75..0be6ba9 100644
--- a/gdb/common/linux-osdata.c
+++ b/gdb/common/linux-osdata.c
@@ -41,8 +41,10 @@
 #include "xml-utils.h"
 #include "buffer.h"
 #include "gdb_assert.h"
-#include "gdb_dirent.h"
 #include "gdb_stat.h"
+#include <dirent.h>
+
+#define NAMELEN(dirent) strlen ((dirent)->d_name)
 
 /* Define PID_T to be a fixed size that is at least as large as pid_t,
    so that reading pid values embedded in /proc works
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ac0761e..28291ff 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1071,7 +1071,6 @@ fi
 # Checks for header files.  #
 # ------------------------- #
 
-AC_HEADER_DIRENT
 AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index fc4fd1d..a44c64e 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -517,7 +517,7 @@ gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
 xml-utils.o: ../common/xml-utils.c $(server_h)
 	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
 
-linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h
+linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h)
 	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
 
 ptid.o: ../common/ptid.c $(ptid_h)
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 2d8a703..9b364ff 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -36,7 +36,6 @@ AC_PROG_RANLIB
 AC_ARG_PROGRAM
 
 AC_HEADER_STDC
-AC_HEADER_DIRENT
 
 AC_FUNC_ALLOCA
 
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index de82463..c9c78d5 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,7 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index b36bc2c..d46fe84 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -33,7 +33,7 @@
 #include <sys/ptrace.h>
 #include "gdb_wait.h"
 #include <sys/param.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
 #include <ctype.h>
 
 struct fork_info *fork_list;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index e39347d..6b868f8 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -53,7 +53,7 @@
 #include "event-top.h"
 #include <pwd.h>
 #include <sys/types.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
 #include "xml-support.h"
 #include "terminal.h"
 #include <sys/vfs.h>
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 5713fac..1c1890e 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -28,7 +28,7 @@
 #include <sys/procfs.h>
 #include <sys/neutrino.h>
 #include <sys/syspage.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
 #include <sys/netmgr.h>
 
 #include "exceptions.h"
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 7249bec..3875858 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -90,7 +90,7 @@
 
 #ifdef NEW_PROC_API
 #include <sys/types.h>
-#include "gdb_dirent.h"	/* opendir/readdir, for listing the LWP's */
+#include <dirent.h>	/* opendir/readdir, for listing the LWP's */
 #endif
 
 #include <fcntl.h>	/* for O_RDONLY */
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [4/10] RFC: unconditionally include signal.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (3 preceding siblings ...)
  2012-11-15 19:22 ` [3/10] RFC: remove gdb_dirent.h Tom Tromey
@ 2012-11-15 19:25 ` Tom Tromey
  2012-11-16 17:18   ` Pedro Alves
  2012-11-15 19:26 ` [5/10] RFC: don't check for stddef.h Tom Tromey
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:25 UTC (permalink / raw)
  To: gdb-patches

I think that checking for signal.h is pointless, because gdb already
includes it unconditionally in various places -- e.g., utils.c.

This patch removes the useless check and updates the few spots that were
using HAVE_SIGNAL_H.

Tom

	* configure.ac: Don't check for signal.h.
	* config.in: Rebuild.
	* configure: Rebuild.
	* common/signals.c: Update.

	* configure.ac: Don't check for signal.h.
	* config.in: Rebuild.
	* configure: Rebuild.
	* gdbreplay.c: Update.
	* remote-utils.c: Update.
	* server.c: Update.
---
 gdb/common/signals.c         |    2 --
 gdb/config.in                |    3 ---
 gdb/configure                |    2 +-
 gdb/configure.ac             |    2 +-
 gdb/gdbserver/config.in      |    3 ---
 gdb/gdbserver/configure      |    2 +-
 gdb/gdbserver/configure.ac   |    2 +-
 gdb/gdbserver/gdbreplay.c    |    2 --
 gdb/gdbserver/remote-utils.c |    2 --
 gdb/gdbserver/server.c       |    2 --
 10 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 4ab863c..4541c8e 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -24,9 +24,7 @@
 #include <string.h>
 #endif
 
-#ifdef HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 
 #include "gdb_signals.h"
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 28291ff..58f715b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1074,7 +1074,7 @@ fi
 AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
-                  thread_db.h signal.h stddef.h \
+                  thread_db.h stddef.h \
 		  stdlib.h sys/fault.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 9b364ff..ecbb921 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -52,7 +52,7 @@ ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])
 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
 		 stdlib.h unistd.h dnl
-		 errno.h fcntl.h signal.h sys/file.h malloc.h dnl
+		 errno.h fcntl.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h)
 AC_CHECK_FUNCS(pread pwrite pread64 readlink)
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 6034d93..2a48c04 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -25,9 +25,7 @@
 #if HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include <ctype.h>
 #if HAVE_FCNTL_H
 #include <fcntl.h>
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index adc8783..6f5d7ef 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -43,9 +43,7 @@
 #if HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index fae9199..b08f1ba 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -24,9 +24,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif
 #include "gdb_wait.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [5/10] RFC: don't check for stddef.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (4 preceding siblings ...)
  2012-11-15 19:25 ` [4/10] RFC: unconditionally include signal.h Tom Tromey
@ 2012-11-15 19:26 ` Tom Tromey
  2012-11-15 19:28 ` [6/10] RFC: don't check for stdlib.h Tom Tromey
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:26 UTC (permalink / raw)
  To: gdb-patches

I think checking for stddef.h is likewise useless.
gdb includes it unconditionally already.

Also this pointed out that it is included twice in defs.h; also fixed in
this patch.

Tom

	* config.in: Rebuild.
	* configure: Rebuild.
	* configure.ac: Don't check for stddef.h.
	* defs.h: Update.  Remove redundant include.
---
 gdb/config.in    |    3 ---
 gdb/configure    |    2 +-
 gdb/configure.ac |    2 +-
 gdb/defs.h       |    6 ------
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/gdb/configure.ac b/gdb/configure.ac
index 58f715b..41bed53 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1074,7 +1074,7 @@ fi
 AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
-                  thread_db.h stddef.h \
+                  thread_db.h \
 		  stdlib.h sys/fault.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
diff --git a/gdb/defs.h b/gdb/defs.h
index 5e8a681..7bb85b0 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -49,9 +49,7 @@
    included, so it's ok to blank out gstdint.h.  */
 #define GCC_GENERATED_STDINT_H 1
 
-#ifdef HAVE_STDDEF_H
 #include <stddef.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -623,10 +621,6 @@ enum gdb_osabi
 
 /* From other system libraries */
 
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [6/10] RFC: don't check for stdlib.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (5 preceding siblings ...)
  2012-11-15 19:26 ` [5/10] RFC: don't check for stddef.h Tom Tromey
@ 2012-11-15 19:28 ` Tom Tromey
  2012-11-15 19:29 ` [7/10] RFC: don't check for unistd.h Tom Tromey
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:28 UTC (permalink / raw)
  To: gdb-patches

I think checking for stdlib.h is useless.
gdb includes it unconditionally already.

Tom

	* configure: Rebuild.
	* configure.ac: Don't check for stdlib.h.
	* defs.h: Update.

	* configure: Rebuild.
	* configure.ac: Don't check for stdlib.h.
	* gdbreplay.c: Update.
---
 gdb/configure              |    2 +-
 gdb/configure.ac           |    2 +-
 gdb/defs.h                 |    3 +--
 gdb/gdbserver/configure    |    2 +-
 gdb/gdbserver/configure.ac |    2 +-
 gdb/gdbserver/gdbreplay.c  |    2 --
 6 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gdb/configure.ac b/gdb/configure.ac
index 41bed53..ccd8322 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1075,7 +1075,7 @@ AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
                   thread_db.h \
-		  stdlib.h sys/fault.h \
+		  sys/fault.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
 		  sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
diff --git a/gdb/defs.h b/gdb/defs.h
index 7bb85b0..6d49d8f 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -621,9 +621,8 @@ enum gdb_osabi
 
 /* From other system libraries */
 
-#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#endif
+
 #ifndef min
 #define min(a, b) ((a) < (b) ? (a) : (b))
 #endif
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index ecbb921..a5d636a 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -51,7 +51,7 @@ ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])
 
 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
-		 stdlib.h unistd.h dnl
+		 unistd.h dnl
 		 errno.h fcntl.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h)
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 2a48c04..22ae9e4 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -33,9 +33,7 @@
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#endif
 #include <string.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [7/10] RFC: don't check for unistd.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (6 preceding siblings ...)
  2012-11-15 19:28 ` [6/10] RFC: don't check for stdlib.h Tom Tromey
@ 2012-11-15 19:29 ` Tom Tromey
  2012-11-15 19:31 ` [8/10] RFC: don't check for sys/types.h Tom Tromey
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:29 UTC (permalink / raw)
  To: gdb-patches

unistd.h is also apparently available universally.

Tom

	* configure: Rebuild.
	* configure.ac: Don't check for unistd.h.
	* defs.h: Update.
	* tracepoint.c: Update.
	* utils.c: Update.

	* configure: Rebuild.
	* configure.ac: Don't check for unistd.h.
	* event-loop.c: Update.
	* gdbreplay.c: Update.
	* remote-utils.c: Update.
	* server.c: Update.
---
 gdb/defs.h                   |    2 --
 gdb/gdbserver/configure      |    2 +-
 gdb/gdbserver/configure.ac   |    1 -
 gdb/gdbserver/event-loop.c   |    2 --
 gdb/gdbserver/gdbreplay.c    |    2 --
 gdb/gdbserver/remote-utils.c |    2 --
 gdb/gdbserver/server.c       |    2 --
 gdb/tracepoint.c             |    2 --
 gdb/utils.c                  |    2 +-
 9 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/gdb/defs.h b/gdb/defs.h
index 6d49d8f..3e54e27 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -51,9 +51,7 @@
 
 #include <stddef.h>
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 
 #include <fcntl.h>
 
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index a5d636a..5e7545e 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -51,7 +51,6 @@ ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])
 
 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
-		 unistd.h dnl
 		 errno.h fcntl.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h)
diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c
index bcc9f1b..1ec946b 100644
--- a/gdb/gdbserver/event-loop.c
+++ b/gdb/gdbserver/event-loop.c
@@ -34,9 +34,7 @@
 #include <errno.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 
 typedef struct gdb_event gdb_event;
 typedef int (event_handler_func) (gdb_fildes_t);
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 22ae9e4..42ccf95 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -35,9 +35,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 6f5d7ef..942a5c1 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -48,9 +48,7 @@
 #include <fcntl.h>
 #endif
 #include <sys/time.h>
-#if HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index b08f1ba..427f40d 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -21,9 +21,7 @@
 #include "gdbthread.h"
 #include "agent.h"
 
-#if HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <signal.h>
 #include "gdb_wait.h"
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 57e001b..36efe83 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -61,9 +61,7 @@
 /* readline defines this.  */
 #undef savestring
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
diff --git a/gdb/utils.c b/gdb/utils.c
index 8e781fc..316cbd6 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3225,7 +3225,7 @@ gdb_realpath (const char *filename)
      pathconf()) making it impossible to pass a correctly sized buffer
      to realpath() (it could always overflow).  On those systems, we
      skip this.  */
-#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
+#if defined (HAVE_REALPATH) && defined(HAVE_ALLOCA)
   {
     /* Find out the max path size.  */
     long path_max = pathconf ("/", _PC_PATH_MAX);
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [8/10] RFC: don't check for sys/types.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (7 preceding siblings ...)
  2012-11-15 19:29 ` [7/10] RFC: don't check for unistd.h Tom Tromey
@ 2012-11-15 19:31 ` Tom Tromey
  2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:31 UTC (permalink / raw)
  To: gdb-patches

Not only is sys/types.h apparently always available, gdb doesn't have
any code actually relying on the check.

Tom

	* configure.ac: Don't check for sys/types.h.
	* configure: Rebuild.
---
 gdb/configure    |    2 +-
 gdb/configure.ac |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/configure.ac b/gdb/configure.ac
index ccd8322..644d853 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1079,7 +1079,7 @@ AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
 		  sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
-		  sys/types.h sys/wait.h wait.h termios.h termio.h \
+		  sys/wait.h wait.h termios.h termio.h \
 		  sgtty.h unistd.h elf_hp.h locale.h \
 		  dlfcn.h sys/socket.h sys/un.h])
 AC_CHECK_HEADERS(link.h, [], [],
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [9/10] RFC: remove gdb_stat.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (9 preceding siblings ...)
  2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
@ 2012-11-15 19:33 ` Tom Tromey
  2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
  2012-11-16 17:55 ` [0/10] RFC: use gnulib more heavily + more configure fixes Pedro Alves
  12 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:33 UTC (permalink / raw)
  To: gdb-patches

This patch replaces gdb_stat.h with the corresponding gnulib module.

I removed the gnulib-generated stuff from this patch.

Tom

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add sys_stat.
	* common/gdb_stat.h: Remove.
	* gnulib/aclocal.m4: Update.
	* gnulib/configure: Update.
	* gnulib/import/Makefile.am: Update.
	* gnulib/import/Makefile.in: Update.
	* gnulib/import/m4/gnulib-cache.m4: Update.
	* gnulib/import/m4/gnulib-comp.m4: Update.
	* gnulib/import/m4/off_t.m4: Update.
	* gnulib/import/m4/ssize_t.m4: Update.
	* gnulib/import/m4/sys_stat_h.m4: Update.
	* gnulib/import/m4/sys_types_h.m4: Update.
	* gnulib/import/m4/time_h.m4: Update.
	* gnulib/import/sys_stat.in.h: Update.
	* gnulib/import/sys_types.in.h: Update.
	* gnulib/import/time.in.h: Update.
	* ada-lang.c: Update.
	* corefile.c: Update.
	* darwin-nat.c: Update.
	* dbxread.c: Update.
	* dwarf2read.c: Update.
	* exec.c: Update.
	* inf-child.c: Update.
	* jit.c: Update.
	* linux-nat.c: Update.
	* m68klinux-nat.c: Update.
	* main.c: Update.
	* mdebugread.c: Update.
	* mi/mi-cmd-env.c: Update.
	* nto-tdep.c: Update.
	* objfiles.c: Update.
	* procfs.c: Update.
	* remote-fileio.c: Update.
	* remote-mips.c: Update.
	* remote.c: Update.
	* rs6000-nat.c: Update.
	* sol-thread.c: Update.
	* solib-spu.c: Update.
	* source.c: Update.
	* symfile.c: Update.
	* symmisc.c: Update.
	* symtab.c: Update.
	* top.c: Update.
	* xcoffread.c: Update.
	* common/linux-osdata.c: Update.

	* linux-low.c: Update.
	* remote-utils.c: Update.
---
 gdb/ada-lang.c                       |    2 +-
 gdb/common/gdb_stat.h                |   59 --
 gdb/common/linux-osdata.c            |    3 +-
 gdb/corefile.c                       |    2 +-
 gdb/darwin-nat.c                     |    2 +-
 gdb/dbxread.c                        |    2 +-
 gdb/dwarf2read.c                     |    2 +-
 gdb/exec.c                           |    2 +-
 gdb/gdbserver/linux-low.c            |    2 +-
 gdb/gdbserver/remote-utils.c         |    2 +-
 gdb/gnulib/aclocal.m4                |    5 +
 gdb/gnulib/configure                 | 1128 ++++++++++++++++++++++++++--------
 gdb/gnulib/import/Makefile.am        |  131 ++++-
 gdb/gnulib/import/Makefile.in        |  174 +++++-
 gdb/gnulib/import/m4/gnulib-cache.m4 |    3 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |   18 +
 gdb/gnulib/import/m4/off_t.m4        |   18 +
 gdb/gnulib/import/m4/ssize_t.m4      |   23 +
 gdb/gnulib/import/m4/sys_stat_h.m4   |   99 +++
 gdb/gnulib/import/m4/sys_types_h.m4  |   24 +
 gdb/gnulib/import/m4/time_h.m4       |  109 ++++
 gdb/gnulib/import/sys_stat.in.h      |  728 ++++++++++++++++++++++
 gdb/gnulib/import/sys_types.in.h     |   51 ++
 gdb/gnulib/import/time.in.h          |  248 ++++++++
 gdb/gnulib/update-gnulib.sh          |    2 +-
 gdb/inf-child.c                      |    2 +-
 gdb/jit.c                            |    2 +-
 gdb/linux-nat.c                      |    2 +-
 gdb/m68klinux-nat.c                  |    2 +-
 gdb/main.c                           |    2 +-
 gdb/mdebugread.c                     |    2 +-
 gdb/mi/mi-cmd-env.c                  |    2 +-
 gdb/nto-tdep.c                       |    2 +-
 gdb/objfiles.c                       |    2 +-
 gdb/procfs.c                         |    2 +-
 gdb/remote-fileio.c                  |    2 +-
 gdb/remote-mips.c                    |    2 +-
 gdb/remote.c                         |    2 +-
 gdb/rs6000-nat.c                     |    2 +-
 gdb/sol-thread.c                     |    2 +-
 gdb/solib-spu.c                      |    2 +-
 gdb/source.c                         |    2 +-
 gdb/symfile.c                        |    2 +-
 gdb/symmisc.c                        |    2 +-
 gdb/symtab.c                         |    2 +-
 gdb/top.c                            |    2 +-
 gdb/xcoffread.c                      |    2 +-
 47 files changed, 2542 insertions(+), 341 deletions(-)
 delete mode 100644 gdb/common/gdb_stat.h
 create mode 100644 gdb/gnulib/import/m4/off_t.m4
 create mode 100644 gdb/gnulib/import/m4/ssize_t.m4
 create mode 100644 gdb/gnulib/import/m4/sys_stat_h.m4
 create mode 100644 gdb/gnulib/import/m4/sys_types_h.m4
 create mode 100644 gdb/gnulib/import/m4/time_h.m4
 create mode 100644 gdb/gnulib/import/sys_stat.in.h
 create mode 100644 gdb/gnulib/import/sys_types.in.h
 create mode 100644 gdb/gnulib/import/time.in.h

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 49d5b6e..3a4b26f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -43,7 +43,7 @@
 #include "gdb_obstack.h"
 #include "ada-lang.h"
 #include "completer.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #ifdef UI_OUT
 #include "ui-out.h"
 #endif
diff --git a/gdb/common/gdb_stat.h b/gdb/common/gdb_stat.h
deleted file mode 100644
index 51e2e56..0000000
--- a/gdb/common/gdb_stat.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Portable <sys/stat.h>
-   Copyright (C) 1995, 2007-2012 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if !defined(GDB_STAT_H)
-#define GDB_STAT_H
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if !defined(S_ISBLK) && defined(S_IFBLK)
-#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
-#endif
-#if !defined(S_ISCHR) && defined(S_IFCHR)
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#endif
-#if !defined(S_ISDIR) && defined(S_IFDIR)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-#if !defined(S_ISREG) && defined(S_IFREG)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-#if !defined(S_ISFIFO) && defined(S_IFIFO)
-#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
-#endif
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#if !defined(S_ISSOCK) && defined(S_IFSOCK)
-#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
-#endif
-#if !defined(S_ISMPB) && defined(S_IFMPB)	/* V7 */
-#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
-#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
-#endif
-#if !defined(S_ISNWK) && defined(S_IFNWK)	/* HP/UX */
-#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
-#endif
-
-/* Microsoft C's stat.h doesn't define all the POSIX file modes.  */
-#ifndef S_IROTH
-#define S_IROTH	S_IREAD
-#endif
-
-#endif /* !defined(GDB_STAT_H) */
diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c
index 0be6ba9..d227b1a 100644
--- a/gdb/common/linux-osdata.c
+++ b/gdb/common/linux-osdata.c
@@ -37,11 +37,12 @@
 #include <netdb.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <sys/stat.h>
 
 #include "xml-utils.h"
 #include "buffer.h"
 #include "gdb_assert.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <dirent.h>
 
 #define NAMELEN(dirent) strlen ((dirent)->d_name)
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 7115a2e..441cffc 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -31,7 +31,7 @@
 #include "target.h"
 #include "gdbcore.h"
 #include "dis-asm.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "completer.h"
 #include "exceptions.h"
 #include "observer.h"
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 252fe3e..4135922 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -33,7 +33,7 @@
 #include "regcache.h"
 #include "event-top.h"
 #include "inf-loop.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "exceptions.h"
 #include "inf-child.h"
 #include "value.h"
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 1dd6213..ff98036 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -39,7 +39,7 @@
 #endif
 
 #include "gdb_obstack.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "symtab.h"
 #include "breakpoint.h"
 #include "target.h"
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index d5db4db..403bc3c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -56,7 +56,7 @@
 #include "jv-lang.h"
 #include "psympriv.h"
 #include "exceptions.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "completer.h"
 #include "vec.h"
 #include "c-lang.h"
diff --git a/gdb/exec.c b/gdb/exec.c
index 8dec898..742c2ab 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -42,7 +42,7 @@
 #include "gdbcore.h"
 
 #include <ctype.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 
 #include "xcoffsolib.h"
 
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 2de46d2..fa85413 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -40,7 +40,7 @@
 #include <pwd.h>
 #include <sys/types.h>
 #include <dirent.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <sys/vfs.h>
 #include <sys/uio.h>
 #ifndef ELFMAG0
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 942a5c1..419b203 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -52,7 +52,7 @@
 #if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index c9c78d5..e866c87 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,7 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent sys_stat"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index cfccb86..c42e08d 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -26,7 +26,7 @@
 #include "target.h"
 #include "inferior.h"
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "inf-child.h"
 #include "gdb/fileio.h"
 #include "agent.h"
diff --git a/gdb/jit.c b/gdb/jit.c
index 1afbee6..5db96b8 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -36,7 +36,7 @@
 #include "symtab.h"
 #include "target.h"
 #include "gdb-dlfcn.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "exceptions.h"
 #include "gdb_bfd.h"
 
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 6b868f8..67a6c43 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -46,7 +46,7 @@
 #include "gdbcore.h"		/* for get_exec_file */
 #include <ctype.h>		/* for isdigit */
 #include "gdbthread.h"		/* for struct thread_info etc.  */
-#include "gdb_stat.h"		/* for struct stat */
+#include <sys/stat.h>		/* for struct stat */
 #include <fcntl.h>		/* for O_RDONLY */
 #include "inf-loop.h"
 #include "event-loop.h"
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index eaf8e62..ad741e9 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -43,7 +43,7 @@
 #endif
 
 #include <sys/file.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 
 #include "floatformat.h"
 
diff --git a/gdb/main.c b/gdb/main.c
index e795a9e..12d0430 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -28,7 +28,7 @@
 #include "getopt.h"
 
 #include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <ctype.h>
 
 #include <string.h>
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 638903d..41487ec 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -56,7 +56,7 @@
 #include "block.h"
 #include "dictionary.h"
 #include "mdebugread.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <string.h>
 #include "psympriv.h"
 
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index cb565de..208adc2 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -32,7 +32,7 @@
 #include "top.h"
 
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 
 static void env_mod_path (char *dirname, char **which_path);
 
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index b8aab5e..1fa7bf5 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <string.h>
 #include "nto-tdep.h"
 #include "top.h"
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 38710b7..004d5f4 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -36,7 +36,7 @@
 
 #include "gdb_assert.h"
 #include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <fcntl.h>
 #include "gdb_obstack.h"
 #include <string.h>
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 3875858..d7d0d50 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -95,7 +95,7 @@
 
 #include <fcntl.h>	/* for O_RDONLY */
 #include <unistd.h>	/* for "X_OK" */
-#include "gdb_stat.h"	/* for struct stat */
+#include <sys/stat.h>	/* for struct stat */
 
 /* Note: procfs-utils.h must be included after the above system header
    files, because it redefines various system calls using macros.
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 7653f38..ec981ee 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -25,7 +25,7 @@
 #include "remote.h"
 #include "gdb/fileio.h"
 #include "gdb_wait.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "exceptions.h"
 #include "remote-fileio.h"
 #include "event-loop.h"
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 689dfa7..db8242a 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -30,7 +30,7 @@
 #include "target.h"
 #include "exceptions.h"
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "gdb_usleep.h"
 #include "regcache.h"
 #include <ctype.h>
diff --git a/gdb/remote.c b/gdb/remote.c
index 15f5ba4..68dcce8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -58,7 +58,7 @@
 
 #include "remote-fileio.h"
 #include "gdb/fileio.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "xml-support.h"
 
 #include "memory-map.h"
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index f46169b..24690f8 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -52,7 +52,7 @@
 
 #include <a.out.h>
 #include <sys/file.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "gdb_bfd.h"
 #include <sys/core.h>
 #define __LDINFO_PTRACE32__	/* for __ld_info32 */
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index fcc9ed3..70a806d 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -56,7 +56,7 @@
 #include "target.h"
 #include "inferior.h"
 #include <fcntl.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <dlfcn.h>
 #include "gdbcmd.h"
 #include "gdbcore.h"
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 5680fce..18d03ca 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -23,7 +23,7 @@
 #include "gdbcore.h"
 #include <string.h>
 #include "gdb_assert.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "arch-utils.h"
 #include "bfd.h"
 #include "symtab.h"
diff --git a/gdb/source.c b/gdb/source.c
index 07d8872..fa3dfae 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -30,7 +30,7 @@
 
 #include <sys/types.h>
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <fcntl.h>
 #include "gdbcore.h"
 #include "gdb_regex.h"
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 35d818d..bc04e76 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -60,7 +60,7 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <ctype.h>
 #include <time.h>
 #include <sys/time.h>
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index d789311..de86aa7 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -33,7 +33,7 @@
 #include "bcache.h"
 #include "block.h"
 #include "gdb_regex.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include "dictionary.h"
 #include "typeprint.h"
 
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 9b366eb..d1b64b0 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -51,7 +51,7 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <ctype.h>
 #include "cp-abi.h"
 #include "cp-support.h"
diff --git a/gdb/top.c b/gdb/top.c
index 22c2ac0..a303d1e 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -60,7 +60,7 @@
 
 #include "event-top.h"
 #include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
 #include <ctype.h>
 #include "ui-out.h"
 #include "cli-out.h"
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 6629481..c085aa4 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -30,7 +30,7 @@
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
-#include "gdb_stat.h"
+#include <sys/stat.h>
 
 #include "coff/internal.h"
 #include "libcoff.h"		/* FIXME, internal data from BFD */
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [2/10] RFC: remove gdb_string.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (8 preceding siblings ...)
  2012-11-15 19:31 ` [8/10] RFC: don't check for sys/types.h Tom Tromey
@ 2012-11-15 19:33 ` Tom Tromey
  2012-11-15 20:08   ` Eli Zaretskii
  2012-11-16  2:42   ` Joel Brobecker
  2012-11-15 19:33 ` [9/10] RFC: remove gdb_stat.h Tom Tromey
                   ` (2 subsequent siblings)
  12 siblings, 2 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 19:33 UTC (permalink / raw)
  To: gdb-patches

This one removes gdb_string.h and pulls in various related gnulib
modules.

The bulk of this patch is just changing "gdb_string.h" to <string.h>.

I dropped the auto-generated bits from this patch, but not the #include
changes.

Tom

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add string,
	strerror, and strstr.
	* common/gdb_string.h: Remove.
	* configure.ac: Don't check for string.h, memory.h, strings.h,
	strerror, or strstr.
	* config.in: Rebuild.
	* configure: Rebuild.
	* gnulib/aclocal.m4: Update.
	* gnulib/configure: Update.
	* gnulib/import/Makefile.am: Update.
	* gnulib/import/Makefile.in: Update.
	* gnulib/import/errno.in.h: Update.
	* gnulib/import/intprops.h: Update.
	* gnulib/import/m4/errno_h.m4: Update.
	* gnulib/import/m4/gnulib-cache.m4: Update.
	* gnulib/import/m4/gnulib-comp.m4: Update.
	* gnulib/import/m4/strerror.m4: Update.
	* gnulib/import/m4/strstr.m4: Update.
	* gnulib/import/m4/sys_socket_h.m4: Update.
	* gnulib/import/strerror-override.c: Update.
	* gnulib/import/strerror-override.h: Update.
	* gnulib/import/strerror.c: Update.
	* gnulib/import/strstr.c: Update.

	* ada-exp.y: Update.
	* ada-lang.c: Update.
	* ada-lex.l: Update.
	* ada-typeprint.c: Update.
	* ada-valprint.c: Update.
	* aix-thread.c: Update.
	* alpha-linux-tdep.c: Update.
	* alpha-mdebug-tdep.c: Update.
	* alpha-nat.c: Update.
	* alpha-osf1-tdep.c: Update.
	* alpha-tdep.c: Update.
	* alphanbsd-tdep.c: Update.
	* amd64-dicos-tdep.c: Update.
	* amd64-linux-nat.c: Update.
	* amd64-linux-tdep.c: Update.
	* amd64-nat.c: Update.
	* amd64-sol2-tdep.c: Update.
	* amd64fbsd-tdep.c: Update.
	* amd64obsd-tdep.c: Update.
	* arch-utils.c: Update.
	* arm-linux-nat.c: Update.
	* arm-linux-tdep.c: Update.
	* arm-tdep.c: Update.
	* arm-wince-tdep.c: Update.
	* armbsd-tdep.c: Update.
	* armnbsd-nat.c: Update.
	* armnbsd-tdep.c: Update.
	* armobsd-tdep.c: Update.
	* avr-tdep.c: Update.
	* ax-gdb.c: Update.
	* ax-general.c: Update.
	* bcache.c: Update.
	* bfin-tdep.c: Update.
	* breakpoint.c: Update.
	* buildsym.c: Update.
	* c-exp.y: Update.
	* c-lang.c: Update.
	* c-typeprint.c: Update.
	* c-valprint.c: Update.
	* charset.c: Update.
	* cli-out.c: Update.
	* cli/cli-cmds.c: Update.
	* cli/cli-decode.c: Update.
	* cli/cli-dump.c: Update.
	* cli/cli-interp.c: Update.
	* cli/cli-logging.c: Update.
	* cli/cli-script.c: Update.
	* cli/cli-setshow.c: Update.
	* cli/cli-utils.c: Update.
	* coffread.c: Update.
	* common/linux-procfs.c: Update.
	* common/linux-ptrace.c: Update.
	* common/signals.c: Update.
	* common/vec.h: Update.
	* core-regset.c: Update.
	* corefile.c: Update.
	* corelow.c: Update.
	* cp-abi.c: Update.
	* cp-support.c: Update.
	* cp-valprint.c: Update.
	* cris-tdep.c: Update.
	* d-lang.c: Update.
	* dbxread.c: Update.
	* dcache.c: Update.
	* demangle.c: Update.
	* dicos-tdep.c: Update.
	* disasm.c: Update.
	* doublest.c: Update.
	* dsrec.c: Update.
	* dummy-frame.c: Update.
	* dwarf2-frame.c: Update.
	* dwarf2loc.c: Update.
	* dwarf2read.c: Update.
	* elfread.c: Update.
	* environ.c: Update.
	* eval.c: Update.
	* event-loop.c: Update.
	* exceptions.c: Update.
	* exec.c: Update.
	* expprint.c: Update.
	* f-exp.y: Update.
	* f-lang.c: Update.
	* f-typeprint.c: Update.
	* f-valprint.c: Update.
	* fbsd-nat.c: Update.
	* findcmd.c: Update.
	* findvar.c: Update.
	* fork-child.c: Update.
	* frame.c: Update.
	* frv-linux-tdep.c: Update.
	* frv-tdep.c: Update.
	* gdb.c: Update.
	* gdb_bfd.c: Update.
	* gdbarch.c: Update.
	* gdbserver/gdbreplay.c: Update.
	* gdbserver/server.h: Update.
	* gdbtypes.c: Update.
	* gnu-nat.c: Update.
	* gnu-v2-abi.c: Update.
	* gnu-v3-abi.c: Update.
	* go-exp.y: Update.
	* go-lang.c: Update.
	* go32-nat.c: Update.
	* hppa-hpux-tdep.c: Update.
	* hppa-linux-nat.c: Update.
	* hppanbsd-tdep.c: Update.
	* hppaobsd-tdep.c: Update.
	* i386-cygwin-tdep.c: Update.
	* i386-dicos-tdep.c: Update.
	* i386-linux-nat.c: Update.
	* i386-linux-tdep.c: Update.
	* i386-nto-tdep.c: Update.
	* i386-sol2-tdep.c: Update.
	* i386-tdep.c: Update.
	* i386bsd-tdep.c: Update.
	* i386gnu-nat.c: Update.
	* i386nbsd-tdep.c: Update.
	* i386obsd-tdep.c: Update.
	* i387-tdep.c: Update.
	* ia64-libunwind-tdep.c: Update.
	* ia64-linux-nat.c: Update.
	* inf-child.c: Update.
	* inf-ptrace.c: Update.
	* inf-ttrace.c: Update.
	* infcall.c: Update.
	* infcmd.c: Update.
	* inflow.c: Update.
	* infrun.c: Update.
	* interps.c: Update.
	* iq2000-tdep.c: Update.
	* irix5-nat.c: Update.
	* jv-exp.y: Update.
	* jv-lang.c: Update.
	* jv-typeprint.c: Update.
	* jv-valprint.c: Update.
	* language.c: Update.
	* linux-fork.c: Update.
	* linux-nat.c: Update.
	* lm32-tdep.c: Update.
	* m2-exp.y: Update.
	* m2-typeprint.c: Update.
	* m32c-tdep.c: Update.
	* m32r-linux-nat.c: Update.
	* m32r-linux-tdep.c: Update.
	* m32r-rom.c: Update.
	* m32r-tdep.c: Update.
	* m68hc11-tdep.c: Update.
	* m68k-tdep.c: Update.
	* m68kbsd-tdep.c: Update.
	* m68klinux-nat.c: Update.
	* m68klinux-tdep.c: Update.
	* m88k-tdep.c: Update.
	* macrocmd.c: Update.
	* main.c: Update.
	* mdebugread.c: Update.
	* mem-break.c: Update.
	* memattr.c: Update.
	* memory-map.c: Update.
	* mep-tdep.c: Update.
	* mi/mi-cmd-break.c: Update.
	* mi/mi-cmd-disas.c: Update.
	* mi/mi-cmd-env.c: Update.
	* mi/mi-cmd-stack.c: Update.
	* mi/mi-cmd-var.c: Update.
	* mi/mi-cmds.c: Update.
	* mi/mi-console.c: Update.
	* mi/mi-getopt.c: Update.
	* mi/mi-interp.c: Update.
	* mi/mi-main.c: Update.
	* mi/mi-parse.c: Update.
	* microblaze-rom.c: Update.
	* microblaze-tdep.c: Update.
	* mingw-hdep.c: Update.
	* minsyms.c: Update.
	* mips-irix-tdep.c: Update.
	* mips-linux-tdep.c: Update.
	* mips-tdep.c: Update.
	* mips64obsd-tdep.c: Update.
	* mipsnbsd-tdep.c: Update.
	* mipsread.c: Update.
	* mn10300-linux-tdep.c: Update.
	* mn10300-tdep.c: Update.
	* monitor.c: Update.
	* moxie-tdep.c: Update.
	* mt-tdep.c: Update.
	* nbsd-tdep.c: Update.
	* nto-procfs.c: Update.
	* nto-tdep.c: Update.
	* objc-lang.c: Update.
	* objfiles.c: Update.
	* opencl-lang.c: Update.
	* osabi.c: Update.
	* osdata.c: Update.
	* p-exp.y: Update.
	* p-lang.c: Update.
	* p-typeprint.c: Update.
	* parse.c: Update.
	* posix-hdep.c: Update.
	* ppc-linux-nat.c: Update.
	* ppc-sysv-tdep.c: Update.
	* ppcnbsd-tdep.c: Update.
	* ppcobsd-tdep.c: Update.
	* printcmd.c: Update.
	* procfs.c: Update.
	* prologue-value.c: Update.
	* python/py-auto-load.c: Update.
	* python/py-gdb-readline.c: Update.
	* ravenscar-thread.c: Update.
	* regcache.c: Update.
	* registry.c: Update.
	* remote-fileio.c: Update.
	* remote-m32r-sdi.c: Update.
	* remote-mips.c: Update.
	* remote-sim.c: Update.
	* remote.c: Update.
	* reverse.c: Update.
	* rs6000-aix-tdep.c: Update.
	* ser-base.c: Update.
	* ser-go32.c: Update.
	* ser-mingw.c: Update.
	* ser-pipe.c: Update.
	* ser-tcp.c: Update.
	* ser-unix.c: Update.
	* serial.c: Update.
	* sh-tdep.c: Update.
	* sh64-tdep.c: Update.
	* shnbsd-tdep.c: Update.
	* skip.c: Update.
	* sol-thread.c: Update.
	* solib-dsbt.c: Update.
	* solib-frv.c: Update.
	* solib-osf.c: Update.
	* solib-spu.c: Update.
	* solib-sunos.c: Update.
	* solib-target.c: Update.
	* solib.c: Update.
	* somread.c: Update.
	* source.c: Update.
	* sparc-nat.c: Update.
	* sparc-sol2-tdep.c: Update.
	* sparc-tdep.c: Update.
	* sparc64-tdep.c: Update.
	* sparc64fbsd-tdep.c: Update.
	* sparc64nbsd-tdep.c: Update.
	* sparcnbsd-tdep.c: Update.
	* spu-linux-nat.c: Update.
	* spu-multiarch.c: Update.
	* spu-tdep.c: Update.
	* stabsread.c: Update.
	* stack.c: Update.
	* std-regs.c: Update.
	* symfile.c: Update.
	* symmisc.c: Update.
	* symtab.c: Update.
	* target.c: Update.
	* thread.c: Update.
	* tilegx-linux-nat.c: Update.
	* tilegx-tdep.c: Update.
	* top.c: Update.
	* tracepoint.c: Update.
	* tui/tui-command.c: Update.
	* tui/tui-data.c: Update.
	* tui/tui-disasm.c: Update.
	* tui/tui-file.c: Update.
	* tui/tui-layout.c: Update.
	* tui/tui-out.c: Update.
	* tui/tui-regs.c: Update.
	* tui/tui-source.c: Update.
	* tui/tui-stack.c: Update.
	* tui/tui-win.c: Update.
	* tui/tui-windata.c: Update.
	* tui/tui-winsource.c: Update.
	* typeprint.c: Update.
	* ui-file.c: Update.
	* ui-out.c: Update.
	* user-regs.c: Update.
	* utils.c: Update.
	* v850-tdep.c: Update.
	* valarith.c: Update.
	* valops.c: Update.
	* valprint.c: Update.
	* value.c: Update.
	* varobj.c: Update.
	* vax-tdep.c: Update.
	* vaxnbsd-tdep.c: Update.
	* vaxobsd-tdep.c: Update.
	* windows-nat.c: Update.
	* xcoffread.c: Update.
	* xml-support.c: Update.
	* xstormy16-tdep.c: Update.
	* xtensa-linux-nat.c: Update.

	* configure.ac: Don't check for string.h, strerror, strstr.
	* config.in: Rebuild.
	* configure: Rebuild.
---
 gdb/ada-exp.y                         |    2 +-
 gdb/ada-lang.c                        |    2 +-
 gdb/ada-lex.l                         |    2 +-
 gdb/ada-typeprint.c                   |    2 +-
 gdb/ada-valprint.c                    |    2 +-
 gdb/aix-thread.c                      |    2 +-
 gdb/alpha-linux-tdep.c                |    2 +-
 gdb/alpha-mdebug-tdep.c               |    2 +-
 gdb/alpha-nat.c                       |    2 +-
 gdb/alpha-osf1-tdep.c                 |    2 +-
 gdb/alpha-tdep.c                      |    2 +-
 gdb/alphanbsd-tdep.c                  |    2 +-
 gdb/amd64-dicos-tdep.c                |    2 +-
 gdb/amd64-linux-nat.c                 |    2 +-
 gdb/amd64-linux-tdep.c                |    2 +-
 gdb/amd64-nat.c                       |    2 +-
 gdb/amd64-sol2-tdep.c                 |    2 +-
 gdb/amd64fbsd-tdep.c                  |    2 +-
 gdb/amd64obsd-tdep.c                  |    2 +-
 gdb/arch-utils.c                      |    2 +-
 gdb/arm-linux-nat.c                   |    2 +-
 gdb/arm-linux-tdep.c                  |    2 +-
 gdb/arm-tdep.c                        |    2 +-
 gdb/arm-wince-tdep.c                  |    2 +-
 gdb/armbsd-tdep.c                     |    2 +-
 gdb/armnbsd-nat.c                     |    2 +-
 gdb/armnbsd-tdep.c                    |    2 +-
 gdb/armobsd-tdep.c                    |    2 +-
 gdb/avr-tdep.c                        |    2 +-
 gdb/ax-gdb.c                          |    2 +-
 gdb/ax-general.c                      |    2 +-
 gdb/bcache.c                          |    2 +-
 gdb/bfin-tdep.c                       |    2 +-
 gdb/breakpoint.c                      |    2 +-
 gdb/buildsym.c                        |    2 +-
 gdb/c-exp.y                           |    2 +-
 gdb/c-lang.c                          |    2 +-
 gdb/c-typeprint.c                     |    2 +-
 gdb/c-valprint.c                      |    2 +-
 gdb/charset.c                         |    2 +-
 gdb/cli-out.c                         |    2 +-
 gdb/cli/cli-cmds.c                    |    2 +-
 gdb/cli/cli-decode.c                  |    2 +-
 gdb/cli/cli-dump.c                    |    2 +-
 gdb/cli/cli-interp.c                  |    2 +-
 gdb/cli/cli-logging.c                 |    2 +-
 gdb/cli/cli-script.c                  |    2 +-
 gdb/cli/cli-setshow.c                 |    2 +-
 gdb/cli/cli-utils.c                   |    2 +-
 gdb/coffread.c                        |    2 +-
 gdb/common/gdb_string.h               |   70 --
 gdb/common/linux-procfs.c             |    2 +-
 gdb/common/linux-ptrace.c             |    2 +-
 gdb/common/signals.c                  |    2 +-
 gdb/common/vec.h                      |    2 +-
 gdb/config.in                         |    8 -
 gdb/configure                         |   22 +-
 gdb/configure.ac                      |    4 +-
 gdb/core-regset.c                     |    2 +-
 gdb/corefile.c                        |    2 +-
 gdb/corelow.c                         |    2 +-
 gdb/cp-abi.c                          |    2 +-
 gdb/cp-support.c                      |    2 +-
 gdb/cp-valprint.c                     |    2 +-
 gdb/cris-tdep.c                       |    2 +-
 gdb/d-lang.c                          |    2 +-
 gdb/dbxread.c                         |    4 +-
 gdb/dcache.c                          |    2 +-
 gdb/demangle.c                        |    2 +-
 gdb/dicos-tdep.c                      |    2 +-
 gdb/disasm.c                          |    2 +-
 gdb/doublest.c                        |    2 +-
 gdb/dsrec.c                           |    2 +-
 gdb/dummy-frame.c                     |    2 +-
 gdb/dwarf2-frame.c                    |    2 +-
 gdb/dwarf2loc.c                       |    2 +-
 gdb/dwarf2read.c                      |    2 +-
 gdb/elfread.c                         |    2 +-
 gdb/environ.c                         |    2 +-
 gdb/eval.c                            |    2 +-
 gdb/event-loop.c                      |    2 +-
 gdb/exceptions.c                      |    2 +-
 gdb/exec.c                            |    2 +-
 gdb/expprint.c                        |    2 +-
 gdb/f-exp.y                           |    2 +-
 gdb/f-lang.c                          |    2 +-
 gdb/f-typeprint.c                     |    2 +-
 gdb/f-valprint.c                      |    2 +-
 gdb/fbsd-nat.c                        |    2 +-
 gdb/findcmd.c                         |    2 +-
 gdb/findvar.c                         |    2 +-
 gdb/fork-child.c                      |    2 +-
 gdb/frame.c                           |    2 +-
 gdb/frv-linux-tdep.c                  |    2 +-
 gdb/frv-tdep.c                        |    2 +-
 gdb/gdb.c                             |    2 +-
 gdb/gdb_bfd.c                         |    2 +-
 gdb/gdbarch.c                         |    2 +-
 gdb/gdbserver/config.in               |    8 -
 gdb/gdbserver/configure               |   22 +-
 gdb/gdbserver/configure.ac            |    4 +-
 gdb/gdbserver/gdbreplay.c             |    2 -
 gdb/gdbserver/server.h                |    8 -
 gdb/gdbtypes.c                        |    2 +-
 gdb/gnu-nat.c                         |    2 +-
 gdb/gnu-v2-abi.c                      |    2 +-
 gdb/gnu-v3-abi.c                      |    2 +-
 gdb/gnulib/aclocal.m4                 |    4 +
 gdb/gnulib/configure                  | 1795 ++++++++++++++++++++++++---------
 gdb/gnulib/import/Makefile.am         |   70 ++-
 gdb/gnulib/import/Makefile.in         |   75 ++-
 gdb/gnulib/import/errno.in.h          |  279 +++++
 gdb/gnulib/import/intprops.h          |  319 ++++++
 gdb/gnulib/import/m4/errno_h.m4       |  137 +++
 gdb/gnulib/import/m4/gnulib-cache.m4  |    5 +-
 gdb/gnulib/import/m4/gnulib-comp.m4   |   38 +
 gdb/gnulib/import/m4/strerror.m4      |   96 ++
 gdb/gnulib/import/m4/strstr.m4        |  130 +++
 gdb/gnulib/import/m4/sys_socket_h.m4  |  177 ++++
 gdb/gnulib/import/strerror-override.c |  302 ++++++
 gdb/gnulib/import/strerror-override.h |   56 +
 gdb/gnulib/import/strerror.c          |   70 ++
 gdb/gnulib/import/strstr.c            |   82 ++
 gdb/gnulib/update-gnulib.sh           |    2 +-
 gdb/go-exp.y                          |    2 +-
 gdb/go-lang.c                         |    2 +-
 gdb/go32-nat.c                        |    2 +-
 gdb/hppa-hpux-tdep.c                  |    2 +-
 gdb/hppa-linux-nat.c                  |    2 +-
 gdb/hppanbsd-tdep.c                   |    2 +-
 gdb/hppaobsd-tdep.c                   |    2 +-
 gdb/i386-cygwin-tdep.c                |    2 +-
 gdb/i386-dicos-tdep.c                 |    2 +-
 gdb/i386-linux-nat.c                  |    2 +-
 gdb/i386-linux-tdep.c                 |    2 +-
 gdb/i386-nto-tdep.c                   |    2 +-
 gdb/i386-sol2-tdep.c                  |    2 +-
 gdb/i386-tdep.c                       |    2 +-
 gdb/i386bsd-tdep.c                    |    2 +-
 gdb/i386gnu-nat.c                     |    2 +-
 gdb/i386nbsd-tdep.c                   |    2 +-
 gdb/i386obsd-tdep.c                   |    2 +-
 gdb/i387-tdep.c                       |    2 +-
 gdb/ia64-libunwind-tdep.c             |    2 +-
 gdb/ia64-linux-nat.c                  |    2 +-
 gdb/inf-child.c                       |    2 +-
 gdb/inf-ptrace.c                      |    2 +-
 gdb/inf-ttrace.c                      |    2 +-
 gdb/infcall.c                         |    2 +-
 gdb/infcmd.c                          |    2 +-
 gdb/inflow.c                          |    2 +-
 gdb/infrun.c                          |    2 +-
 gdb/interps.c                         |    2 +-
 gdb/iq2000-tdep.c                     |    2 +-
 gdb/irix5-nat.c                       |    2 +-
 gdb/jv-exp.y                          |    2 +-
 gdb/jv-lang.c                         |    2 +-
 gdb/jv-typeprint.c                    |    2 +-
 gdb/jv-valprint.c                     |    2 +-
 gdb/language.c                        |    2 +-
 gdb/linux-fork.c                      |    2 +-
 gdb/linux-nat.c                       |    2 +-
 gdb/lm32-tdep.c                       |    2 +-
 gdb/m2-exp.y                          |    2 +-
 gdb/m2-typeprint.c                    |    2 +-
 gdb/m32c-tdep.c                       |    3 -
 gdb/m32r-linux-nat.c                  |    2 +-
 gdb/m32r-linux-tdep.c                 |    2 +-
 gdb/m32r-rom.c                        |    2 +-
 gdb/m32r-tdep.c                       |    2 +-
 gdb/m68hc11-tdep.c                    |    2 +-
 gdb/m68k-tdep.c                       |    2 +-
 gdb/m68kbsd-tdep.c                    |    2 +-
 gdb/m68klinux-nat.c                   |    2 +-
 gdb/m68klinux-tdep.c                  |    2 +-
 gdb/m88k-tdep.c                       |    2 +-
 gdb/macrocmd.c                        |    2 +-
 gdb/main.c                            |    2 +-
 gdb/mdebugread.c                      |    2 +-
 gdb/mem-break.c                       |    2 +-
 gdb/memattr.c                         |    2 +-
 gdb/memory-map.c                      |    2 +-
 gdb/mep-tdep.c                        |    2 +-
 gdb/mi/mi-cmd-break.c                 |    2 +-
 gdb/mi/mi-cmd-disas.c                 |    2 +-
 gdb/mi/mi-cmd-env.c                   |    2 +-
 gdb/mi/mi-cmd-stack.c                 |    2 +-
 gdb/mi/mi-cmd-var.c                   |    2 +-
 gdb/mi/mi-cmds.c                      |    2 +-
 gdb/mi/mi-console.c                   |    2 +-
 gdb/mi/mi-getopt.c                    |    2 +-
 gdb/mi/mi-interp.c                    |    2 +-
 gdb/mi/mi-main.c                      |    2 +-
 gdb/mi/mi-parse.c                     |    2 +-
 gdb/microblaze-rom.c                  |    2 +-
 gdb/microblaze-tdep.c                 |    2 +-
 gdb/mingw-hdep.c                      |    2 +-
 gdb/minsyms.c                         |    2 +-
 gdb/mips-irix-tdep.c                  |    2 +-
 gdb/mips-linux-tdep.c                 |    2 +-
 gdb/mips-tdep.c                       |    2 +-
 gdb/mips64obsd-tdep.c                 |    2 +-
 gdb/mipsnbsd-tdep.c                   |    2 +-
 gdb/mipsread.c                        |    2 +-
 gdb/mn10300-linux-tdep.c              |    2 +-
 gdb/mn10300-tdep.c                    |    2 +-
 gdb/monitor.c                         |    2 +-
 gdb/moxie-tdep.c                      |    2 +-
 gdb/mt-tdep.c                         |    2 +-
 gdb/nbsd-tdep.c                       |    2 +-
 gdb/nto-procfs.c                      |    2 +-
 gdb/nto-tdep.c                        |    2 +-
 gdb/objc-lang.c                       |    2 +-
 gdb/objfiles.c                        |    2 +-
 gdb/opencl-lang.c                     |    2 +-
 gdb/osabi.c                           |    2 +-
 gdb/osdata.c                          |    2 +-
 gdb/p-exp.y                           |    2 +-
 gdb/p-lang.c                          |    2 +-
 gdb/p-typeprint.c                     |    2 +-
 gdb/parse.c                           |    2 +-
 gdb/posix-hdep.c                      |    2 +-
 gdb/ppc-linux-nat.c                   |    2 +-
 gdb/ppc-sysv-tdep.c                   |    2 +-
 gdb/ppcnbsd-tdep.c                    |    2 +-
 gdb/ppcobsd-tdep.c                    |    2 +-
 gdb/printcmd.c                        |    2 +-
 gdb/procfs.c                          |    2 +-
 gdb/prologue-value.c                  |    2 +-
 gdb/python/py-auto-load.c             |    2 +-
 gdb/python/py-gdb-readline.c          |    2 +-
 gdb/ravenscar-thread.c                |    2 +-
 gdb/regcache.c                        |    2 +-
 gdb/registry.c                        |    2 +-
 gdb/remote-fileio.c                   |    2 +-
 gdb/remote-m32r-sdi.c                 |    2 +-
 gdb/remote-mips.c                     |    2 +-
 gdb/remote-sim.c                      |    2 +-
 gdb/remote.c                          |    2 +-
 gdb/reverse.c                         |    2 +-
 gdb/rs6000-aix-tdep.c                 |    2 +-
 gdb/ser-base.c                        |    2 +-
 gdb/ser-go32.c                        |    2 +-
 gdb/ser-mingw.c                       |    2 +-
 gdb/ser-pipe.c                        |    2 +-
 gdb/ser-tcp.c                         |    2 +-
 gdb/ser-unix.c                        |    2 +-
 gdb/serial.c                          |    2 +-
 gdb/sh-tdep.c                         |    2 +-
 gdb/sh64-tdep.c                       |    2 +-
 gdb/shnbsd-tdep.c                     |    2 +-
 gdb/skip.c                            |    2 +-
 gdb/sol-thread.c                      |    2 +-
 gdb/solib-dsbt.c                      |    2 +-
 gdb/solib-frv.c                       |    2 +-
 gdb/solib-osf.c                       |    2 +-
 gdb/solib-spu.c                       |    2 +-
 gdb/solib-sunos.c                     |    2 +-
 gdb/solib-target.c                    |    2 +-
 gdb/solib.c                           |    2 +-
 gdb/somread.c                         |    2 +-
 gdb/source.c                          |    2 +-
 gdb/sparc-nat.c                       |    2 +-
 gdb/sparc-sol2-tdep.c                 |    2 +-
 gdb/sparc-tdep.c                      |    2 +-
 gdb/sparc64-tdep.c                    |    2 +-
 gdb/sparc64fbsd-tdep.c                |    2 +-
 gdb/sparc64nbsd-tdep.c                |    2 +-
 gdb/sparcnbsd-tdep.c                  |    2 +-
 gdb/spu-linux-nat.c                   |    2 +-
 gdb/spu-multiarch.c                   |    2 +-
 gdb/spu-tdep.c                        |    2 +-
 gdb/stabsread.c                       |    2 +-
 gdb/stack.c                           |    2 +-
 gdb/std-regs.c                        |    2 +-
 gdb/symfile.c                         |    2 +-
 gdb/symmisc.c                         |    2 +-
 gdb/symtab.c                          |    2 +-
 gdb/target.c                          |    2 +-
 gdb/thread.c                          |    2 +-
 gdb/tilegx-linux-nat.c                |    2 +-
 gdb/tilegx-tdep.c                     |    2 +-
 gdb/top.c                             |    2 +-
 gdb/tracepoint.c                      |    2 +-
 gdb/tui/tui-command.c                 |    2 +-
 gdb/tui/tui-data.c                    |    2 +-
 gdb/tui/tui-disasm.c                  |    2 +-
 gdb/tui/tui-file.c                    |    2 +-
 gdb/tui/tui-layout.c                  |    2 +-
 gdb/tui/tui-out.c                     |    2 +-
 gdb/tui/tui-regs.c                    |    2 +-
 gdb/tui/tui-source.c                  |    2 +-
 gdb/tui/tui-stack.c                   |    2 +-
 gdb/tui/tui-win.c                     |    2 +-
 gdb/tui/tui-windata.c                 |    2 +-
 gdb/tui/tui-winsource.c               |    2 +-
 gdb/typeprint.c                       |    2 +-
 gdb/ui-file.c                         |    2 +-
 gdb/ui-out.c                          |    2 +-
 gdb/user-regs.c                       |    2 +-
 gdb/utils.c                           |    2 +-
 gdb/v850-tdep.c                       |    2 +-
 gdb/valarith.c                        |    2 +-
 gdb/valops.c                          |    2 +-
 gdb/valprint.c                        |    2 +-
 gdb/value.c                           |    2 +-
 gdb/varobj.c                          |    2 +-
 gdb/vax-tdep.c                        |    2 +-
 gdb/vaxnbsd-tdep.c                    |    2 +-
 gdb/vaxobsd-tdep.c                    |    2 +-
 gdb/windows-nat.c                     |    2 +-
 gdb/xcoffread.c                       |    2 +-
 gdb/xml-support.c                     |    2 +-
 gdb/xstormy16-tdep.c                  |    2 +-
 gdb/xtensa-linux-nat.c                |    2 +-
 315 files changed, 3461 insertions(+), 905 deletions(-)
 delete mode 100644 gdb/common/gdb_string.h
 create mode 100644 gdb/gnulib/import/errno.in.h
 create mode 100644 gdb/gnulib/import/intprops.h
 create mode 100644 gdb/gnulib/import/m4/errno_h.m4
 create mode 100644 gdb/gnulib/import/m4/strerror.m4
 create mode 100644 gdb/gnulib/import/m4/strstr.m4
 create mode 100644 gdb/gnulib/import/m4/sys_socket_h.m4
 create mode 100644 gdb/gnulib/import/strerror-override.c
 create mode 100644 gdb/gnulib/import/strerror-override.h
 create mode 100644 gdb/gnulib/import/strerror.c
 create mode 100644 gdb/gnulib/import/strstr.c

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 1a80b0b..d1a838a 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -37,7 +37,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index e1dced5..49d5b6e 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -21,7 +21,7 @@
 
 #include "defs.h"
 #include <stdio.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include <stdarg.h>
 #include "demangle.h"
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 714265e..8bd949f 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -289,7 +289,7 @@ false		{ return FALSEKEYWORD; }
 %%
 
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 /* Initialize the lexer for processing new expression. */
 
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 2e28b55..7843964 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -35,7 +35,7 @@
 #include "ada-lang.h"
 
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 
 static int print_selected_record_field_types (struct type *, struct type *,
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index ca30e42..9926340 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -20,7 +20,7 @@
 
 #include "defs.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 5da6c4e..30c747c 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -48,7 +48,7 @@
 #include "regcache.h"
 #include "gdbcmd.h"
 #include "ppc-tdep.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "observer.h"
 
 #include <procinfo.h>
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index aaca985..a375b8b 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -19,7 +19,7 @@
 #include "defs.h"
 #include "frame.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "osabi.h"
 #include "solib-svr4.h"
 #include "symtab.h"
diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
index 4b46a3c..629b9fb 100644
--- a/gdb/alpha-mdebug-tdep.c
+++ b/gdb/alpha-mdebug-tdep.c
@@ -24,7 +24,7 @@
 #include "gdbcore.h"
 #include "block.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "trad-frame.h"
 
 #include "alpha-tdep.h"
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 900a586..90a68c1 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "gdbcore.h"
 #include "target.h"
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index f3bddaa..0880126 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -21,7 +21,7 @@
 #include "gdbcore.h"
 #include "value.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "objfiles.h"
 
 #include "alpha-tdep.h"
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index e5b75d2..11820b0 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -31,7 +31,7 @@
 #include "dis-asm.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "linespec.h"
 #include "regcache.h"
 #include "reggroups.h"
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
index bc17385..712cb15 100644
--- a/gdb/alphanbsd-tdep.c
+++ b/gdb/alphanbsd-tdep.c
@@ -28,7 +28,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "alpha-tdep.h"
 #include "alphabsd-tdep.h"
diff --git a/gdb/amd64-dicos-tdep.c b/gdb/amd64-dicos-tdep.c
index a983bb2..d886fd9 100644
--- a/gdb/amd64-dicos-tdep.c
+++ b/gdb/amd64-dicos-tdep.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "amd64-tdep.h"
 #include "dicos-tdep.h"
 
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index f4a12db..1804444 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -27,7 +27,7 @@
 #include "amd64-linux-tdep.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "elf/common.h"
 #include <sys/uio.h>
 #include <sys/ptrace.h>
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index d919216..d385fe1 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -33,7 +33,7 @@
 #include "linux-tdep.h"
 #include "i386-xstate.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "amd64-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index d79b71b..130be25 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -22,7 +22,7 @@
 #include "regcache.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "amd64-tdep.h"
diff --git a/gdb/amd64-sol2-tdep.c b/gdb/amd64-sol2-tdep.c
index dbc65d4..e925153 100644
--- a/gdb/amd64-sol2-tdep.c
+++ b/gdb/amd64-sol2-tdep.c
@@ -26,7 +26,7 @@
 #include "osabi.h"
 #include "symtab.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sol2-tdep.h"
 #include "amd64-tdep.h"
diff --git a/gdb/amd64fbsd-tdep.c b/gdb/amd64fbsd-tdep.c
index 87b661c..4df2cf7 100644
--- a/gdb/amd64fbsd-tdep.c
+++ b/gdb/amd64fbsd-tdep.c
@@ -25,7 +25,7 @@
 #include "osabi.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "amd64-tdep.h"
 #include "bsd-uthread.h"
diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c
index f2a8ed9..4cef8f0 100644
--- a/gdb/amd64obsd-tdep.c
+++ b/gdb/amd64obsd-tdep.c
@@ -30,7 +30,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "amd64-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 5a47e37..a35baef 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -23,7 +23,7 @@
 #include "buildsym.h"
 #include "gdbcmd.h"
 #include "inferior.h"		/* enum CALL_DUMMY_LOCATION et al.  */
-#include "gdb_string.h"
+#include <string.h>
 #include "regcache.h"
 #include "gdb_assert.h"
 #include "sim-regno.h"
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index bf81c03..cdcd249 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -19,7 +19,7 @@
 #include "defs.h"
 #include "inferior.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "regcache.h"
 #include "target.h"
 #include "linux-nat.h"
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index f4eaa5c..f743439 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -49,7 +49,7 @@
 #include "user-regs.h"
 #include <ctype.h>
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* This is defined in <elf.h> on ARM GNU/Linux systems.  */
 #define AT_HWCAP        16
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index a221fd6..c7a3d34 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -26,7 +26,7 @@
 #include "inferior.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "dis-asm.h"		/* For register styles.  */
 #include "regcache.h"
 #include "reggroups.h"
diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c
index 5bc6473..654bf06 100644
--- a/gdb/arm-wince-tdep.c
+++ b/gdb/arm-wince-tdep.c
@@ -26,7 +26,7 @@
 #include "solib-target.h"
 #include "frame.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "arm-tdep.h"
 
diff --git a/gdb/armbsd-tdep.c b/gdb/armbsd-tdep.c
index 1b87ba6..3b6188f 100644
--- a/gdb/armbsd-tdep.c
+++ b/gdb/armbsd-tdep.c
@@ -23,7 +23,7 @@
 #include "regset.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "arm-tdep.h"
 
diff --git a/gdb/armnbsd-nat.c b/gdb/armnbsd-nat.c
index a65a00d..0d6b43c 100644
--- a/gdb/armnbsd-nat.c
+++ b/gdb/armnbsd-nat.c
@@ -24,7 +24,7 @@
 #include "regcache.h"
 #include "target.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/types.h>
 #include <sys/ptrace.h>
 #include <machine/reg.h>
diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c
index 19aa000..7a48a4d 100644
--- a/gdb/armnbsd-tdep.c
+++ b/gdb/armnbsd-tdep.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "osabi.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "arm-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/armobsd-tdep.c b/gdb/armobsd-tdep.c
index fab4e42..97536bd 100644
--- a/gdb/armobsd-tdep.c
+++ b/gdb/armobsd-tdep.c
@@ -22,7 +22,7 @@
 #include "trad-frame.h"
 #include "tramp-frame.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "obsd-tdep.h"
 #include "arm-tdep.h"
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 864d288..cb6e9ca 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -34,7 +34,7 @@
 #include "symfile.h"
 #include "arch-utils.h"
 #include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "dis-asm.h"
 
 /* AVR Background:
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 9cb8fe9..136272d 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -31,7 +31,7 @@
 #include "target.h"
 #include "ax.h"
 #include "ax-gdb.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "block.h"
 #include "regcache.h"
 #include "user-regs.h"
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 6ea6f14..e8abea7 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -25,7 +25,7 @@
 #include "ax.h"
 
 #include "value.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "user-regs.h"
 
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 2a180af..29d1912 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -23,7 +23,7 @@
 #include "defs.h"
 #include "gdb_obstack.h"
 #include "bcache.h"
-#include "gdb_string.h"		/* For memcpy declaration */
+#include <string.h>		/* For memcpy declaration */
 #include "gdb_assert.h"
 
 #include <stddef.h>
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 4eb5763..f379bfe 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "gdbcore.h"
 #include "arch-utils.h"
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ccf7ee1..2e8d70b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -35,7 +35,7 @@
 #include "gdbthread.h"
 #include "target.h"
 #include "language.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb-demangle.h"
 #include "filenames.h"
 #include "annotate.h"
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 8f2e732..a8f040a 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -32,7 +32,7 @@
 #include "gdbtypes.h"
 #include "gdb_assert.h"
 #include "complaints.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "expression.h"		/* For "enum exp_opcode" used by...  */
 #include "bcache.h"
 #include "filenames.h"		/* For DOSish file names.  */
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 11eaadb..846c10b 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -37,7 +37,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 84830be..4d5b8e1 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -29,7 +29,7 @@
 #include "macroscope.h"
 #include "gdb_assert.h"
 #include "charset.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "demangle.h"
 #include "cp-abi.h"
 #include "cp-support.h"
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index c6f8bb2..31aa7b5 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -32,7 +32,7 @@
 #include "typeprint.h"
 #include "cp-abi.h"
 #include "jv-lang.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include "cp-support.h"
 
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index dada9e2..4eca34a 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff --git a/gdb/charset.c b/gdb/charset.c
index 777d901..d032908 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -30,7 +30,7 @@
 #include "gdb_vecs.h"
 
 #include <stddef.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 
 #ifdef USE_WIN32API
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 5404036..f3a93da 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -24,7 +24,7 @@
 #include "defs.h"
 #include "ui-out.h"
 #include "cli-out.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "vec.h"
 
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index b65262e..991ad00 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -27,7 +27,7 @@
 #include "target.h"	/* For baud_rate, remote_debug and remote_timeout.  */
 #include "gdb_wait.h"	/* For shell escape implementation.  */
 #include "gdb_regex.h"	/* Used by apropos_command.  */
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_vfork.h"
 #include "linespec.h"
 #include "expression.h"
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 6e0f0de..54843f1 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -20,7 +20,7 @@
 #include "symtab.h"
 #include <ctype.h>
 #include "gdb_regex.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "completer.h"
 #include "ui-out.h"
 
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index c2d1397..ec50b82 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "cli/cli-decode.h"
 #include "cli/cli-cmds.h"
 #include "value.h"
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 70b6c28..bb936a9 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -23,7 +23,7 @@
 #include "ui-out.h"
 #include "cli-out.h"
 #include "top.h"		/* for "execute_command" */
-#include "gdb_string.h"
+#include <string.h>
 #include "exceptions.h"
 
 struct ui_out *cli_uiout;
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index 6ff064a..6397da6 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -23,7 +23,7 @@
 #include "interps.h"
 #include "gdb_assert.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* These hold the pushed copies of the gdb output files.
    If NULL then nothing has yet been pushed.  */
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 743c65f..b87d9c7 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -23,7 +23,7 @@
 #include <ctype.h>
 
 #include "ui-out.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "exceptions.h"
 #include "top.h"
 #include "breakpoint.h"
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 9d8cb2e..b75dd80 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -19,7 +19,7 @@
 #include "readline/tilde.h"
 #include "value.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "arch-utils.h"
 #include "observer.h"
 
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index 81a4acc..b21d666 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "cli/cli-utils.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "gdb_assert.h"
 
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 0c7e6d9..43dbba6 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -26,7 +26,7 @@
 #include "bfd.h"
 #include "gdb_obstack.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 
 #include "coff/internal.h"	/* Internal format of COFF symbols in BFD */
diff --git a/gdb/common/gdb_string.h b/gdb/common/gdb_string.h
deleted file mode 100644
index aa037df..0000000
--- a/gdb/common/gdb_string.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Portable <string.h>
-
-   Copyright (C) 1995, 1998-2001, 2004, 2007-2012 Free Software
-   Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if !defined(GDB_STRING_H)
-#define GDB_STRING_H
-
-#ifdef STDC_HEADERS
-#include <string.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h> /* strcasecmp etc..  */
-#endif
-#else
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#include <strings.h>
-#endif
-
-#ifndef strchr
-extern char *strchr (const char *, int);	/* X3.159-1989  4.11.5.2 */
-#endif
-
-#ifndef strrchr
-extern char *strrchr (const char *, int);	/* X3.159-1989  4.11.5.5 */
-#endif
-
-#ifndef strtok
-extern char *strtok (char *, const char *);	/* X3.159-1989  4.11.5.8 */
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#else
-extern void *memset ();
-extern void *memcpy ();
-extern void *memmove ();
-extern int memcmp ();
-#endif
-#endif /* STDC_HEADERS */
-
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
-#if !HAVE_DECL_STRSTR
-#ifndef strstr
-extern char *strstr (const char *, const char *); /* X3.159-1989  4.11.5.7 */
-#endif
-#endif
-
-#endif /* !defined(GDB_STRING_H) */
diff --git a/gdb/common/linux-procfs.c b/gdb/common/linux-procfs.c
index a5aa830..eda40e2 100644
--- a/gdb/common/linux-procfs.c
+++ b/gdb/common/linux-procfs.c
@@ -20,7 +20,7 @@
 #include "server.h"
 #else
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #endif
 
 #include "linux-procfs.h"
diff --git a/gdb/common/linux-ptrace.c b/gdb/common/linux-ptrace.c
index 55ba766..22cc204 100644
--- a/gdb/common/linux-ptrace.c
+++ b/gdb/common/linux-ptrace.c
@@ -20,7 +20,7 @@
 #include "server.h"
 #else
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #endif
 
 #include "linux-ptrace.h"
diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 3ef9840..4ab863c 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -21,7 +21,7 @@
 #include "server.h"
 #else
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #endif
 
 #ifdef HAVE_SIGNAL_H
diff --git a/gdb/common/vec.h b/gdb/common/vec.h
index a99bcd6..048184f 100644
--- a/gdb/common/vec.h
+++ b/gdb/common/vec.h
@@ -22,7 +22,7 @@
 
 #include <stddef.h>
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 
 /* The macros here implement a set of templated vector types and
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 030fb06..ac0761e 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1076,7 +1076,7 @@ AC_HEADER_STDC
 # elf_hp.h is for HP/UX 64-bit shared library support.
 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
                   thread_db.h signal.h stddef.h \
-		  stdlib.h string.h memory.h strings.h sys/fault.h \
+		  stdlib.h sys/fault.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
 		  sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
@@ -1124,7 +1124,7 @@ AC_CHECK_HEADERS(term.h, [], [],
 # Checks for declarations.  #
 # ------------------------- #
 
-AC_CHECK_DECLS([free, malloc, realloc, strerror, strstr, getopt,
+AC_CHECK_DECLS([free, malloc, realloc, getopt,
                 snprintf, vsnprintf])
 AM_LC_MESSAGES
 
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
index 2ebe911..d34cd1a 100644
--- a/gdb/core-regset.c
+++ b/gdb/core-regset.c
@@ -36,7 +36,7 @@
 
 #include <fcntl.h>
 #include <errno.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <time.h>
 #ifdef HAVE_SYS_PROCFS_H
 #include <sys/procfs.h>
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 78dbbc2..7115a2e 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 99611ba..b1be3d6 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -20,7 +20,7 @@
 
 #include "defs.h"
 #include "arch-utils.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 16b5356..564e1e4 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -25,7 +25,7 @@
 #include "gdbcmd.h"
 #include "ui-out.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 static struct cp_abi_ops *find_cp_abi (const char *short_name);
 
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 97524ed..b2ac090 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -20,7 +20,7 @@
 
 #include "defs.h"
 #include "cp-support.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "demangle.h"
 #include "gdb_assert.h"
 #include "gdbcmd.h"
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 4586da2..dfb4ca0 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -28,7 +28,7 @@
 #include "gdbcmd.h"
 #include "demangle.h"
 #include "annotate.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "c-lang.h"
 #include "target.h"
 #include "cp-abi.h"
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 6739037..4e9d629 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -42,7 +42,7 @@
 
 #include "solib.h"              /* Support for shared libraries.  */
 #include "solib-svr4.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "dis-asm.h"
 
 enum cris_num_regs
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index 7b2c322..31efe90 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -22,7 +22,7 @@
 #include "language.h"
 #include "d-lang.h"
 #include "c-lang.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "parser-defs.h"
 #include "gdb_obstack.h"
 
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 2d47407..1dd6213 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -31,7 +31,7 @@
    for real.  dbx_psymtab_to_symtab() is the function that does this */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #if defined(__CYGNUSCLIB__)
 #include <sys/types.h>
@@ -57,7 +57,7 @@
 #include "psympriv.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "aout/aout64.h"
 #include "aout/stab_gnu.h"	/* We always use GNU stabs, not
diff --git a/gdb/dcache.c b/gdb/dcache.c
index ce9fe31..9c6b999 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "dcache.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcore.h"
 #include "target.h"
 #include "inferior.h"
diff --git a/gdb/demangle.c b/gdb/demangle.c
index fa6f4a6..8237343 100644
--- a/gdb/demangle.c
+++ b/gdb/demangle.c
@@ -29,7 +29,7 @@
 #include "gdbcmd.h"
 #include "demangle.h"
 #include "gdb-demangle.h"
-#include "gdb_string.h"
+#include <string.h>
 
 /* Select the default C++ demangling style to use.  The default is "auto",
    which allows gdb to attempt to pick an appropriate demangling style for
diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
index aac253b..3cee50a 100644
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "solib.h"
 #include "solib-target.h"
 #include "inferior.h"
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 25d87d7..1c6c608 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -21,7 +21,7 @@
 #include "target.h"
 #include "value.h"
 #include "ui-out.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "disasm.h"
 #include "gdbcore.h"
 #include "dis-asm.h"
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 0308dac..0afcd2d 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -28,7 +28,7 @@
 #include "doublest.h"
 #include "floatformat.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbtypes.h"
 #include <math.h>		/* ldexp */
 
diff --git a/gdb/dsrec.c b/gdb/dsrec.c
index 9ea23c0..4d6ea43 100644
--- a/gdb/dsrec.c
+++ b/gdb/dsrec.c
@@ -22,7 +22,7 @@
 #include "srec.h"
 #include <time.h>
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_bfd.h"
 
 extern void report_transfer_performance (unsigned long, time_t, time_t);
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index b8a8c86..bf589c4 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -27,7 +27,7 @@
 #include "frame-unwind.h"
 #include "command.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "observer.h"
 #include "gdbthread.h"
 
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index dcfbeb7..2b485bc 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -33,7 +33,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "complaints.h"
 #include "dwarf2-frame.h"
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index cadcc17..bba08f0 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -39,7 +39,7 @@
 #include "dwarf2loc.h"
 #include "dwarf2-frame.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 
 DEF_VEC_I(int);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 078eb50..d5db4db 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -69,7 +69,7 @@
 #include "f-lang.h"
 
 #include <fcntl.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include <sys/types.h>
 
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 516cbd0..4db92f1 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -21,7 +21,7 @@
 
 #include "defs.h"
 #include "bfd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "elf-bfd.h"
 #include "elf/common.h"
 #include "elf/internal.h"
diff --git a/gdb/environ.c b/gdb/environ.c
index 33426eb..bc89780 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -21,7 +21,7 @@
 
 #include "defs.h"
 #include "environ.h"
-#include "gdb_string.h"
+#include <string.h>
 \f
 
 /* Return a new environment object.  */
diff --git a/gdb/eval.c b/gdb/eval.c
index f655957..5dbe03e 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 279335a..b9df80a 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/types.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include <sys/time.h>
 #include "exceptions.h"
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index b7cf9a2..198bcb6 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -25,7 +25,7 @@
 #include "annotate.h"
 #include "ui-out.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "serial.h"
 #include "gdbthread.h"
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 615d5c0..8dec898 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -37,7 +37,7 @@
 
 #include <fcntl.h>
 #include "readline/readline.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "gdbcore.h"
 
diff --git a/gdb/expprint.c b/gdb/expprint.c
index ddd3a77..46372b3 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -27,7 +27,7 @@
 #include "parser-defs.h"
 #include "user-regs.h"		/* For user_reg_map_regnum_to_name.  */
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "block.h"
 #include "objfiles.h"
 #include "gdb_assert.h"
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 33c7418..c2be68f 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -43,7 +43,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "expression.h"
 #include "value.h"
 #include "parser-defs.h"
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 0b3645f..0cd713b 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -22,7 +22,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index a9940cc..8a08343 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -32,7 +32,7 @@
 #include "target.h"
 #include "f-lang.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 
 #if 0				/* Currently unused.  */
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index c3d2383..2f3a216 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -22,7 +22,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 254a01a..1bf88ed 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -25,7 +25,7 @@
 #include "gdbthread.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/types.h>
 #include <sys/procfs.h>
 #include <sys/sysctl.h>
diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index 116e0b0..055df98 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "arch-utils.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"
 #include "value.h"
 #include "target.h"
diff --git a/gdb/findvar.c b/gdb/findvar.c
index d005145..8a7ab94 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -26,7 +26,7 @@
 #include "gdbcore.h"
 #include "inferior.h"
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "floatformat.h"
 #include "symfile.h"		/* for overlay functions */
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index b47019d..1e136de 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -21,7 +21,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "terminal.h"
 #include "target.h"
diff --git a/gdb/frame.c b/gdb/frame.c
index bf034a8..53f802f 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -25,7 +25,7 @@
 #include "inferior.h"	/* for inferior_ptid */
 #include "regcache.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "user-regs.h"
 #include "gdb_obstack.h"
 #include "dummy-frame.h"
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index dd41883..01fc183 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -30,7 +30,7 @@
 #include "trad-frame.h"
 #include "frame-unwind.h"
 #include "regset.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "linux-tdep.h"
 
 /* Define the size (in bytes) of an FR-V instruction.  */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 28151f6..113e596 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "gdbcore.h"
 #include "arch-utils.h"
diff --git a/gdb/gdb.c b/gdb/gdb.c
index e1dcdc6..c201380 100644
--- a/gdb/gdb.c
+++ b/gdb/gdb.c
@@ -18,7 +18,7 @@
 
 #include "defs.h"
 #include "main.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "interps.h"
 
 int
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 2bcc4b4..bb22ddf 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "gdb_bfd.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "ui-out.h"
 #include "gdbcmd.h"
 #include "hashtab.h"
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 09576b1..fb99597 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -44,7 +44,7 @@
 #include "floatformat.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "reggroups.h"
 #include "osabi.h"
 #include "gdb_obstack.h"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 46f5dc0..2d8a703 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -50,7 +50,7 @@ AC_CHECK_PROGS(MAKE, make)
 # build it in the same directory, when building in the source dir.
 ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"])
 
-AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
+AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
 		 stdlib.h unistd.h dnl
 		 errno.h fcntl.h signal.h sys/file.h malloc.h dnl
@@ -174,7 +174,7 @@ AC_TRY_LINK([
   [AC_MSG_RESULT(no)])
 fi
 
-AC_CHECK_DECLS([strerror, strstr, perror, vasprintf, vsnprintf])
+AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
 
 AC_CHECK_TYPES(socklen_t, [], [],
 [#include <sys/types.h>
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 5aaa98e..6034d93 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -38,9 +38,7 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e93ad00..f0e9db2 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -38,9 +38,7 @@
 #endif
 #include <setjmp.h>
 
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 
 #ifdef HAVE_ALLOCA_H
 #include <alloca.h>
@@ -51,12 +49,6 @@
 #include <malloc.h>
 #endif
 
-#if !HAVE_DECL_STRERROR
-#ifndef strerror
-extern char *strerror (int);	/* X3.159-1989  4.11.6.2 */
-#endif
-#endif
-
 #if !HAVE_DECL_PERROR
 #ifndef perror
 extern void perror (const char *);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d322004..ada0ed8 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "bfd.h"
 #include "symtab.h"
 #include "symfile.h"
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index e6836d7..fb042b1 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -30,7 +30,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdio.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/ptrace.h>
 
 #include <mach.h>
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index e635e8f..1e16984 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -21,7 +21,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index c025a7b..3627e6e 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -30,7 +30,7 @@
 #include "typeprint.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 static struct cp_abi_ops gnu_v3_abi_ops;
 
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index 0268057..de82463 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,7 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index c3171c3..436dedf 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -52,7 +52,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
diff --git a/gdb/go-lang.c b/gdb/go-lang.c
index 21f2427..3eaee63 100644
--- a/gdb/go-lang.c
+++ b/gdb/go-lang.c
@@ -34,7 +34,7 @@
 #include "defs.h"
 #include "gdb_assert.h"
 #include "gdb_obstack.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "block.h"
 #include "symtab.h"
 #include "language.h"
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index ef1da91..bd8d25e 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -99,7 +99,7 @@
 #include "i386-tdep.h"
 #include "value.h"
 #include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "top.h"
 
 #include <stdio.h>		/* might be required for __DJGPP_MINOR__ */
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index f6dfef2..859611d 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -36,7 +36,7 @@
 #include "regcache.h"
 #include "exceptions.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #define IS_32BIT_TARGET(_gdbarch) \
 	((gdbarch_tdep (_gdbarch))->bytes_per_address == 4)
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index 31eeda8..0e52841 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "target.h"
 #include "linux-nat.h"
diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c
index 6c9ba72..10af3b9 100644
--- a/gdb/hppanbsd-tdep.c
+++ b/gdb/hppanbsd-tdep.c
@@ -26,7 +26,7 @@
 #include "tramp-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "hppa-tdep.h"
 #include "hppabsd-tdep.h"
diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c
index 0b6572a..eb82e26 100644
--- a/gdb/hppaobsd-tdep.c
+++ b/gdb/hppaobsd-tdep.c
@@ -23,7 +23,7 @@
 #include "regset.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "hppa-tdep.h"
 #include "hppabsd-tdep.h"
diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
index bb395e7..2c2207d 100644
--- a/gdb/i386-cygwin-tdep.c
+++ b/gdb/i386-cygwin-tdep.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "i386-tdep.h"
 #include "windows-tdep.h"
 #include "regset.h"
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index ca37673..e249705 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "dicos-tdep.h"
 
 static void
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 5a65ef6..4e7dca2 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -27,7 +27,7 @@
 #include "linux-nat.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "elf/common.h"
 #include <sys/uio.h>
 #include <sys/ptrace.h>
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 8475d7a..abe0c86 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -27,7 +27,7 @@
 #include "osabi.h"
 #include "reggroups.h"
 #include "dwarf2-frame.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i386-linux-tdep.h"
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index 615297f..7464318 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -26,7 +26,7 @@
 #include "target.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index 5273f52..2558276 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -21,7 +21,7 @@
 #include "value.h"
 #include "osabi.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sol2-tdep.h"
 #include "i386-tdep.h"
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index f0056be..61facc7 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -45,7 +45,7 @@
 #include "remote.h"
 #include "exceptions.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c
index a84b817..e854b55 100644
--- a/gdb/i386bsd-tdep.c
+++ b/gdb/i386bsd-tdep.c
@@ -24,7 +24,7 @@
 #include "regcache.h"
 #include "osabi.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index f15cf0c..739a150 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -26,7 +26,7 @@
 #include "gdb_assert.h"
 #include <errno.h>
 #include <stdio.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include <mach.h>
 #include <mach_error.h>
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index 2eb5553..4a87d85 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -30,7 +30,7 @@
 #include "tramp-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 9005304..67fa33d 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -32,7 +32,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 97bd5f6..f8b7666 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -29,7 +29,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c
index e1c89c4..93be459 100644
--- a/gdb/ia64-libunwind-tdep.c
+++ b/gdb/ia64-libunwind-tdep.c
@@ -34,7 +34,7 @@
 #include <dlfcn.h>
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "ia64-libunwind-tdep.h"
 
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 9b5fbf3..b3acb9e 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "target.h"
 #include "gdbcore.h"
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index ae2dd1e..cfccb86 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -25,7 +25,7 @@
 #include "symtab.h"
 #include "target.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include "inf-child.h"
 #include "gdb/fileio.h"
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 740798f..d645dab 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -27,7 +27,7 @@
 #include "regcache.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_ptrace.h"
 #include "gdb_wait.h"
 #include <signal.h>
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index 2b9e7f5..504bbae 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -31,7 +31,7 @@
 #include "target.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/mman.h>
 #include <sys/ttrace.h>
 #include <signal.h>
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 2fa1daa..9e92af3 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -30,7 +30,7 @@
 #include "objfiles.h"
 #include "gdbcmd.h"
 #include "command.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "infcall.h"
 #include "dummy-frame.h"
 #include "ada-lang.h"
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 7a08e31..fb9a84c 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "arch-utils.h"
 #include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "frame.h"
diff --git a/gdb/inflow.c b/gdb/inflow.c
index de6ee56..e76fac4 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -26,7 +26,7 @@
 #include "gdbthread.h"
 #include "observer.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <signal.h>
 #include <fcntl.h>
 #include "gdb_select.h"
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4efc2af..7812123 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "symtab.h"
 #include "frame.h"
diff --git a/gdb/interps.c b/gdb/interps.c
index 698e26e..893a4ee 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -37,7 +37,7 @@
 #include "event-top.h"
 #include "interps.h"
 #include "completer.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "top.h"		/* For command_loop.  */
 #include "exceptions.h"
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index 6ecc671..33b26d4 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -29,7 +29,7 @@
 #include "gdbtypes.h"
 #include "value.h"
 #include "dis-asm.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "arch-utils.h"
 #include "regcache.h"
 #include "osabi.h"
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 8745f22..c750406 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -30,7 +30,7 @@
 #include "regcache.h"
 #include "procfs.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/time.h>
 #include <sys/procfs.h>
 #include <setjmp.h>		/* For JB_XXX.  */
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index d0fca67..1795eca 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -36,7 +36,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 6b865dc..f790cff 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -28,7 +28,7 @@
 #include "symtab.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "c-lang.h"
 #include "jv-lang.h"
diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c
index f0d3448..80bfdbc 100644
--- a/gdb/jv-typeprint.c
+++ b/gdb/jv-typeprint.c
@@ -24,7 +24,7 @@
 #include "demangle.h"
 #include "gdb-demangle.h"
 #include "jv-lang.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "typeprint.h"
 #include "c-lang.h"
 #include "cp-abi.h"
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index d1274dd..89e6547 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -29,7 +29,7 @@
 #include "jv-lang.h"
 #include "c-lang.h"
 #include "annotate.h"
-#include "gdb_string.h"
+#include <string.h>
 
 /* Local functions */
 
diff --git a/gdb/language.c b/gdb/language.c
index 5693419..281ec95 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -31,7 +31,7 @@
 
 #include "defs.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include "symtab.h"
 #include "gdbtypes.h"
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 028fcbc..b36bc2c 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -25,7 +25,7 @@
 #include "infcall.h"
 #include "objfiles.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "linux-fork.h"
 #include "linux-nat.h"
 #include "gdbthread.h"
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 45f7e24..e39347d 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "inferior.h"
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_wait.h"
 #include "gdb_assert.h"
 #ifdef HAVE_TKILL_SYSCALL
diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c
index 725ce5b..6371686 100644
--- a/gdb/lm32-tdep.c
+++ b/gdb/lm32-tdep.c
@@ -37,7 +37,7 @@
 #include "reggroups.h"
 #include "opcodes/lm32-desc.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* Macros to extract fields from an instruction.  */
 #define LM32_OPCODE(insn)       ((insn >> 26) & 0x3f)
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 19f9c24..1e706ea 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -39,7 +39,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "expression.h"
 #include "language.h"
 #include "value.h"
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index 89be6cf..a5fd7fc 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -33,7 +33,7 @@
 #include "typeprint.h"
 #include "cp-abi.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 
 static void m2_print_bounds (struct type *type,
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index b680fa0..16ee3af 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -20,10 +20,7 @@
 #include "defs.h"
 
 #include <stdarg.h>
-
-#if defined (HAVE_STRING_H)
 #include <string.h>
-#endif
 
 #include "gdb_assert.h"
 #include "elf-bfd.h"
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 5d1defe..93a01b0 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -25,7 +25,7 @@
 #include "target.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/ptrace.h>
 #include <sys/user.h>
 #include <sys/procfs.h>
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index dce1a88..c50cd7d 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -27,7 +27,7 @@
 #include "reggroups.h"
 #include "regset.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "glibc-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c
index f74cfe3..cabafd4 100644
--- a/gdb/m32r-rom.c
+++ b/gdb/m32r-rom.c
@@ -35,7 +35,7 @@
 #include "symfile.h"		/* for generic load */
 #include <sys/time.h>
 #include <time.h>		/* for time_t */
-#include "gdb_string.h"
+#include <string.h>
 #include "objfiles.h"		/* for ALL_OBJFILES etc.  */
 #include "inferior.h"
 #include <ctype.h>
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 150b9de..a7b7b2f 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -26,7 +26,7 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "inferior.h"
 #include "symfile.h"
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 0b01387..6007d1b 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -30,7 +30,7 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "inferior.h"
 #include "dis-asm.h"  
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 0bad9ac..e474414 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -26,7 +26,7 @@
 #include "symtab.h"
 #include "gdbcore.h"
 #include "value.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "inferior.h"
 #include "regcache.h"
diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c
index aec73d4..5477af3 100644
--- a/gdb/m68kbsd-tdep.c
+++ b/gdb/m68kbsd-tdep.c
@@ -28,7 +28,7 @@
 #include "gdbtypes.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "m68k-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 3be7c14..eaf8e62 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -22,7 +22,7 @@
 #include "inferior.h"
 #include "language.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "regcache.h"
 #include "target.h"
 #include "linux-nat.h"
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index d6dc3ee..273935f 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -24,7 +24,7 @@
 #include "floatformat.h"
 #include "frame.h"
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbtypes.h"
 #include "osabi.h"
 #include "regcache.h"
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
index c4c3266..bd7ed0b 100644
--- a/gdb/m88k-tdep.c
+++ b/gdb/m88k-tdep.c
@@ -32,7 +32,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "m88k-tdep.h"
 
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index a327cad..1a9f04b 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -25,7 +25,7 @@
 #include "cli/cli-utils.h"
 #include "command.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "linespec.h"
 
 \f
diff --git a/gdb/main.c b/gdb/main.c
index 923a7fe..e795a9e 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -31,7 +31,7 @@
 #include "gdb_stat.h"
 #include <ctype.h>
 
-#include "gdb_string.h"
+#include <string.h>
 #include "event-loop.h"
 #include "ui-out.h"
 
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index d1b9177..638903d 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -57,7 +57,7 @@
 #include "dictionary.h"
 #include "mdebugread.h"
 #include "gdb_stat.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "psympriv.h"
 
 #include "bfd.h"
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index bd34fb2..11814e2 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -29,7 +29,7 @@
 #include "breakpoint.h"
 #include "inferior.h"
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 
 
 /* Insert a breakpoint on targets that don't have any better
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 39c9b22..2364f9e 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -25,7 +25,7 @@
 #include "value.h"
 #include "language.h"
 #include "vec.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "breakpoint.h"
 #include "cli/cli-utils.h"
 
diff --git a/gdb/memory-map.c b/gdb/memory-map.c
index a2e2a19..adcc5aa 100644
--- a/gdb/memory-map.c
+++ b/gdb/memory-map.c
@@ -22,7 +22,7 @@
 #include "gdb_assert.h"
 #include "exceptions.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #if !defined(HAVE_LIBEXPAT)
 
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 7d00445..c505a34 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -27,7 +27,7 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "inferior.h"
 #include "dis-asm.h"
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 487d42d..b8f10cf 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -23,7 +23,7 @@
 #include "ui-out.h"
 #include "mi-out.h"
 #include "breakpoint.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "mi-getopt.h"
 #include "gdb.h"
 #include "exceptions.h"
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index b6afb08..6f4f3cf 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -23,7 +23,7 @@
 #include "value.h"
 #include "mi-cmds.h"
 #include "mi-getopt.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "ui-out.h"
 #include "disasm.h"
 
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index ebf4974..cb565de 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -31,7 +31,7 @@
 #include "ui-out.h"
 #include "top.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 
 static void env_mod_path (char *dirname, char **which_path);
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index fe3e0bf..71a9183 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -28,7 +28,7 @@
 #include "block.h"
 #include "stack.h"
 #include "dictionary.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "language.h"
 #include "valprint.h"
 #include "exceptions.h"
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index dc47bc1..6db2319 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -27,7 +27,7 @@
 #include "varobj.h"
 #include "value.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "mi-getopt.h"
 #include "gdbthread.h"
 
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 572625f..16bc0b7 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -22,7 +22,7 @@
 #include "defs.h"
 #include "top.h"
 #include "mi-cmds.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "mi-main.h"
 
 extern void _initialize_mi_cmds (void);
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index b04e65c..95737e4 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -26,7 +26,7 @@
 
 #include "defs.h"
 #include "mi-console.h"
-#include "gdb_string.h"
+#include <string.h>
 
 static ui_file_fputs_ftype mi_console_file_fputs;
 static ui_file_flush_ftype mi_console_file_flush;
diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index 3a7c6a3..ea7d79d 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "mi-getopt.h"
-#include "gdb_string.h"
+#include <string.h>
 
 int
 mi_getopt (const char *prefix,
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 993f8b0..708aa5a 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "interps.h"
 #include "event-top.h"
 #include "event-loop.h"
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 1b7d68a..01b6bb1 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -23,7 +23,7 @@
 #include "arch-utils.h"
 #include "target.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "exceptions.h"
 #include "top.h"
 #include "gdbthread.h"
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 02700c4..b067cb2 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -25,7 +25,7 @@
 #include "charset.h"
 
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 /* Like parse_escape, but leave the results as a host char, not a
    target char.  */
diff --git a/gdb/microblaze-rom.c b/gdb/microblaze-rom.c
index c713b21..52ab122 100644
--- a/gdb/microblaze-rom.c
+++ b/gdb/microblaze-rom.c
@@ -21,7 +21,7 @@
 #include "gdbcore.h"
 #include "target.h"
 #include "monitor.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "serial.h"
 #include "regcache.h"
 
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 7427912..2d86f65 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -36,7 +36,7 @@
 #include "osabi.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "target-descriptions.h"
 #include "opcodes/microblaze-opcm.h"
 #include "opcodes/microblaze-dis.h"
diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c
index ed06c56..c19f1c7 100644
--- a/gdb/mingw-hdep.c
+++ b/gdb/mingw-hdep.c
@@ -23,7 +23,7 @@
 
 #include "gdb_assert.h"
 #include "gdb_select.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "readline/readline.h"
 
 #include <windows.h>
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index a3a376c..da95489 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -38,7 +38,7 @@
 
 #include "defs.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "bfd.h"
 #include "filenames.h"
diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c
index d7ff0f0..cc90408 100644
--- a/gdb/mips-irix-tdep.c
+++ b/gdb/mips-irix-tdep.c
@@ -20,7 +20,7 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "solib.h"
 #include "solib-irix.h"
 #include "elf-bfd.h"
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 023290f..430f162 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -23,7 +23,7 @@
 #include "solib-svr4.h"
 #include "osabi.h"
 #include "mips-tdep.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "frame.h"
 #include "regcache.h"
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 8140f23..52863b9 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -21,7 +21,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "frame.h"
 #include "inferior.h"
diff --git a/gdb/mips64obsd-tdep.c b/gdb/mips64obsd-tdep.c
index 5748e91..fe5a3ac 100644
--- a/gdb/mips64obsd-tdep.c
+++ b/gdb/mips64obsd-tdep.c
@@ -26,7 +26,7 @@
 #include "tramp-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "mips-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c
index 83b2f7e..28b5129 100644
--- a/gdb/mipsnbsd-tdep.c
+++ b/gdb/mipsnbsd-tdep.c
@@ -28,7 +28,7 @@
 #include "osabi.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "nbsd-tdep.h"
 #include "mipsnbsd-tdep.h"
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 23ceece..27bc348 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -25,7 +25,7 @@
    mdebugread.c.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "bfd.h"
 #include "symtab.h"
 #include "objfiles.h"
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index f1d4733..f9bde50 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "regcache.h"
 #include "mn10300-tdep.h"
 #include "gdb_assert.h"
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index e292613..4c9a084 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -22,7 +22,7 @@
 #include "dis-asm.h"
 #include "gdbtypes.h"
 #include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "gdbcore.h"	/* For write_memory_unsigned_integer.  */
 #include "value.h"
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 850c273..95dbc09 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -43,7 +43,7 @@
 #include "exceptions.h"
 #include <signal.h>
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/types.h>
 #include "command.h"
 #include "serial.h"
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index f8a4528..01127e6 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -25,7 +25,7 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "value.h"
 #include "inferior.h"
 #include "symfile.h"
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index f45ebcf..5931028 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -27,7 +27,7 @@
 #include "dis-asm.h"
 #include "arch-utils.h"
 #include "gdbtypes.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "regcache.h"
 #include "reggroups.h"
 #include "gdbcore.h"
diff --git a/gdb/nbsd-tdep.c b/gdb/nbsd-tdep.c
index b4e152d..2b3888d 100644
--- a/gdb/nbsd-tdep.c
+++ b/gdb/nbsd-tdep.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "solib-svr4.h"
 #include "nbsd-tdep.h"
 
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index cf33a02..5713fac 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -32,7 +32,7 @@
 #include <sys/netmgr.h>
 
 #include "exceptions.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcore.h"
 #include "inferior.h"
 #include "target.h"
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index dff87bb..b8aab5e 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -21,7 +21,7 @@
 
 #include "defs.h"
 #include "gdb_stat.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "nto-tdep.h"
 #include "top.h"
 #include "inferior.h"
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index e42a03c..c60a6c6 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -33,7 +33,7 @@
 #include "value.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "gdb_string.h"		/* for strchr */
+#include <string.h>		/* for strchr */
 #include "target.h"		/* for target_has_execution */
 #include "gdbcore.h"
 #include "gdbcmd.h"
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index a1db8c6..38710b7 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -39,7 +39,7 @@
 #include "gdb_stat.h"
 #include <fcntl.h>
 #include "gdb_obstack.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "hashtab.h"
 
 #include "breakpoint.h"
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index b8fd9b7..49455ac 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbtypes.h"
 #include "symtab.h"
 #include "expression.h"
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 7f60984..418426e 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "osabi.h"
 #include "arch-utils.h"
diff --git a/gdb/osdata.c b/gdb/osdata.c
index 8776022..099ab5b 100644
--- a/gdb/osdata.c
+++ b/gdb/osdata.c
@@ -22,7 +22,7 @@
 #include "vec.h"
 #include "xml-support.h"
 #include "osdata.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "ui-out.h"
 #include "gdbcmd.h"
 
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 5d344a4..17d9c66 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -44,7 +44,7 @@
 %{
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 114efbc..4dcd8bf 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -21,7 +21,7 @@
 /* This file is derived from c-lang.c */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 9a2a0d8..0f422d4 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -31,7 +31,7 @@
 #include "p-lang.h"
 #include "typeprint.h"
 #include "gdb-demangle.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <errno.h>
 #include <ctype.h>
 
diff --git a/gdb/parse.c b/gdb/parse.c
index afe1c18..a09ca4e 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -33,7 +33,7 @@
 #include "defs.h"
 #include <ctype.h>
 #include "arch-utils.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "frame.h"
diff --git a/gdb/posix-hdep.c b/gdb/posix-hdep.c
index 793f1c6..0827230 100644
--- a/gdb/posix-hdep.c
+++ b/gdb/posix-hdep.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include "event-loop.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "gdb_select.h"
 
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index ef94a48..d201aa8 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "observer.h"
 #include "frame.h"
 #include "inferior.h"
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index a221b70..95590ef 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -24,7 +24,7 @@
 #include "inferior.h"
 #include "regcache.h"
 #include "value.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "ppc-tdep.h"
 #include "target.h"
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index d18636f..2a86beb 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -28,7 +28,7 @@
 #include "tramp-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "ppc-tdep.h"
 #include "ppcnbsd-tdep.h"
diff --git a/gdb/ppcobsd-tdep.c b/gdb/ppcobsd-tdep.c
index 878571a..6cb823d 100644
--- a/gdb/ppcobsd-tdep.c
+++ b/gdb/ppcobsd-tdep.c
@@ -29,7 +29,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "ppc-tdep.h"
 #include "ppcobsd-tdep.h"
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 7a669f1..c084b0a 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "frame.h"
 #include "symtab.h"
 #include "gdbtypes.h"
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 82c7cd0..7249bec 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -46,7 +46,7 @@
 #include <signal.h>
 #include <ctype.h>
 #include "gdb_bfd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "inflow.h"
 #include "auxv.h"
diff --git a/gdb/prologue-value.c b/gdb/prologue-value.c
index e84a103..15d8760 100644
--- a/gdb/prologue-value.c
+++ b/gdb/prologue-value.c
@@ -17,7 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "prologue-value.h"
 #include "regcache.h"
diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c
index 91bb34d..75a6dd0 100644
--- a/gdb/python/py-auto-load.c
+++ b/gdb/python/py-auto-load.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "top.h"
 #include "exceptions.h"
 #include "gdbcmd.h"
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index b5e0705..9ce74d2 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -22,7 +22,7 @@
 #include "exceptions.h"
 #include "top.h"
 #include "cli/cli-utils.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include <stddef.h>
 
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 0f9380b..5020e0a 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -26,7 +26,7 @@
 #include "command.h"
 #include "ravenscar-thread.h"
 #include "observer.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"
 #include "top.h"
 #include "regcache.h"
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 449f682..221450a 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -26,7 +26,7 @@
 #include "regcache.h"
 #include "reggroups.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"		/* For maintenanceprintlist.  */
 #include "observer.h"
 #include "exceptions.h"
diff --git a/gdb/registry.c b/gdb/registry.c
index c01929b..aeb5659 100644
--- a/gdb/registry.c
+++ b/gdb/registry.c
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "registry.h"
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 const struct registry_data *
 register_data_with_cleanup (struct registry_data_registry *registry,
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 0e3d533..7653f38 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -20,7 +20,7 @@
 /* See the GDB User Guide for details of the GDB remote protocol.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"
 #include "remote.h"
 #include "gdb/fileio.h"
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index f7addea..ce3bff4 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -26,7 +26,7 @@
 #include "inferior.h"
 #include "target.h"
 #include "regcache.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbthread.h"
 #include <ctype.h>
 #include <signal.h>
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index ff5806e..689dfa7 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -29,7 +29,7 @@
 #include "serial.h"
 #include "target.h"
 #include "exceptions.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include "gdb_usleep.h"
 #include "regcache.h"
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index e2738a8..ddb93e9 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -23,7 +23,7 @@
 #include "defs.h"
 #include "inferior.h"
 #include "value.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include <fcntl.h>
 #include <signal.h>
diff --git a/gdb/remote.c b/gdb/remote.c
index be77ad1..15f5ba4 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -20,7 +20,7 @@
 /* See the GDB User Guide for details of the GDB remote protocol.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include <fcntl.h>
 #include "inferior.h"
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 07c7de4..83a876e 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "target.h"
 #include "top.h"
 #include "cli/cli-cmds.h"
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index b4fc931..fc2d657 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -20,7 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "osabi.h"
 #include "regcache.h"
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index 287e55d..06cdf2e 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -24,7 +24,7 @@
 #include "event-loop.h"
 
 #include "gdb_select.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include <sys/time.h>
 #ifdef USE_WIN32API
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index 73f69c5..1eb0381 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -25,7 +25,7 @@
 #include "defs.h"
 #include "gdbcmd.h"
 #include "serial.h"
-#include "gdb_string.h"
+#include <string.h>
 
 
 /*
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c
index cf7c8b7..d22d24d 100644
--- a/gdb/ser-mingw.c
+++ b/gdb/ser-mingw.c
@@ -30,7 +30,7 @@
 #include <sys/types.h>
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "command.h"
 
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index 4f20cad..ce1f1a5 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -29,7 +29,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <fcntl.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include <signal.h>
 
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index d96a8e5..d5499a1 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -53,7 +53,7 @@
 #endif
 
 #include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_select.h"
 
 #ifndef HAVE_SOCKLEN_T
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 4aab7ca..463f1af 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -30,7 +30,7 @@
 #include <sys/time.h>
 
 #include "gdb_select.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"
 
 #ifdef HAVE_TERMIOS
diff --git a/gdb/serial.c b/gdb/serial.c
index 62d7fa9..60682d6 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -20,7 +20,7 @@
 #include "defs.h"
 #include <ctype.h>
 #include "serial.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbcmd.h"
 
 extern void _initialize_serial (void);
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 8592ed4..d972a56 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -32,7 +32,7 @@
 #include "value.h"
 #include "dis-asm.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "arch-utils.h"
 #include "floatformat.h"
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 5d649df..c932fec 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -32,7 +32,7 @@
 #include "value.h"
 #include "dis-asm.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "arch-utils.h"
 #include "regcache.h"
diff --git a/gdb/shnbsd-tdep.c b/gdb/shnbsd-tdep.c
index 5512b10..ee61dba 100644
--- a/gdb/shnbsd-tdep.c
+++ b/gdb/shnbsd-tdep.c
@@ -25,7 +25,7 @@
 #include "value.h"
 #include "osabi.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sh-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/skip.c b/gdb/skip.c
index 5a3fae3..1f75d0b 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -20,7 +20,7 @@
 #include "value.h"
 #include "valprint.h"
 #include "ui-out.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbcmd.h"
 #include "command.h"
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index b2c1806..fcc9ed3 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -64,7 +64,7 @@
 #include "solib.h"
 #include "symfile.h"
 #include "observer.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "procfs.h"
 
 struct target_ops sol_thread_ops;
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index 9024be2..502b4d2 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -18,7 +18,7 @@
 
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "gdbcore.h"
 #include "solib.h"
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index d259440..8ebf99a 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -18,7 +18,7 @@
 
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "gdbcore.h"
 #include "solib.h"
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index e2bb38d..1d476db 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -45,7 +45,7 @@
 
 #include <sys/types.h>
 #include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include "bfd.h"
 #include "symtab.h"
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 09a4047..5680fce 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "solib-spu.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "gdb_stat.h"
 #include "arch-utils.h"
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index b8b3806..f6013d4 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -22,7 +22,7 @@
 
 #include <sys/types.h>
 #include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/param.h>
 #include <fcntl.h>
 
diff --git a/gdb/solib-target.c b/gdb/solib-target.c
index 0f3f850..2570441 100644
--- a/gdb/solib-target.c
+++ b/gdb/solib-target.c
@@ -26,7 +26,7 @@
 #include "vec.h"
 #include "solib-target.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* Private data for each loaded library.  */
 struct lm_info
diff --git a/gdb/solib.c b/gdb/solib.c
index db3842a..a3cdc3a 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -21,7 +21,7 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "bfd.h"
 #include "symfile.h"
diff --git a/gdb/somread.c b/gdb/somread.c
index 19a15e2..0c00517 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -28,7 +28,7 @@
 #include "stabsread.h"
 #include "gdb-stabs.h"
 #include "complaints.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "demangle.h"
 #include "som.h"
 #include "libhppa.h"
diff --git a/gdb/source.c b/gdb/source.c
index 7e14fc6..07d8872 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -29,7 +29,7 @@
 #include "gdb_assert.h"
 
 #include <sys/types.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include <fcntl.h>
 #include "gdbcore.h"
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index cf36abd..e1d46e3 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -24,7 +24,7 @@
 
 #include "gdb_assert.h"
 #include <signal.h>
-#include "gdb_string.h"
+#include <string.h>
 #include <sys/ptrace.h>
 #include "gdb_wait.h"
 #ifdef HAVE_MACHINE_REG_H
diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c
index d2fc4d6..bc4a960 100644
--- a/gdb/sparc-sol2-tdep.c
+++ b/gdb/sparc-sol2-tdep.c
@@ -29,7 +29,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sol2-tdep.h"
 #include "sparc-tdep.h"
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 6da2297..4519c34 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -36,7 +36,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sparc-tdep.h"
 
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 28c9ca4..503498e 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -35,7 +35,7 @@
 #include "value.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sparc64-tdep.h"
 
diff --git a/gdb/sparc64fbsd-tdep.c b/gdb/sparc64fbsd-tdep.c
index f58e73b..77ae0ed 100644
--- a/gdb/sparc64fbsd-tdep.c
+++ b/gdb/sparc64fbsd-tdep.c
@@ -28,7 +28,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sparc64-tdep.h"
 #include "solib-svr4.h"
diff --git a/gdb/sparc64nbsd-tdep.c b/gdb/sparc64nbsd-tdep.c
index 273fb26..44c8024 100644
--- a/gdb/sparc64nbsd-tdep.c
+++ b/gdb/sparc64nbsd-tdep.c
@@ -31,7 +31,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sparc64-tdep.h"
 #include "nbsd-tdep.h"
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 9afbbcf..60940fd 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -31,7 +31,7 @@
 #include "trad-frame.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include "sparc-tdep.h"
 #include "nbsd-tdep.h"
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 1db97ce..bbab38d 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -20,7 +20,7 @@
 
 #include "defs.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "target.h"
 #include "inferior.h"
 #include "inf-child.h"
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 5ace7c5..54604ee 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -21,7 +21,7 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "gdbcmd.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "arch-utils.h"
 #include "observer.h"
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 85baf3e..879af56 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -24,7 +24,7 @@
 #include "gdbtypes.h"
 #include "gdbcmd.h"
 #include "gdbcore.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "frame.h"
 #include "frame-unwind.h"
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 1c288ee..6c51838 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -24,7 +24,7 @@
    Avoid placing any object file format specific code in this file.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "bfd.h"
 #include "gdb_obstack.h"
 #include "symtab.h"
diff --git a/gdb/stack.c b/gdb/stack.c
index b01c8f0..0287517 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -49,7 +49,7 @@
 
 #include "gdb_assert.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include "psymtab.h"
 #include "symfile.h"
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index c5b97d6..8b3c57e 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -24,7 +24,7 @@
 #include "frame.h"
 #include "gdbtypes.h"
 #include "value.h"
-#include "gdb_string.h"
+#include <string.h>
 
 
 static struct value *
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 55af541..35d818d 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -59,7 +59,7 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include <ctype.h>
 #include <time.h>
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index e9bdc24..d789311 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -37,7 +37,7 @@
 #include "dictionary.h"
 #include "typeprint.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "readline/readline.h"
 
 #include "psymtab.h"
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 65542a7..9b366eb 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -50,7 +50,7 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include <ctype.h>
 #include "cp-abi.h"
diff --git a/gdb/target.c b/gdb/target.c
index 5015e51..4df22d4 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -21,7 +21,7 @@
 
 #include "defs.h"
 #include <errno.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "target.h"
 #include "gdbcmd.h"
 #include "symtab.h"
diff --git a/gdb/thread.c b/gdb/thread.c
index 7e8eec5..70cc230 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -33,7 +33,7 @@
 #include "gdbcmd.h"
 #include "regcache.h"
 #include "gdb.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include <ctype.h>
 #include <sys/types.h>
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 23acba5..e29c7a3 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -26,7 +26,7 @@
 #include <sys/ptrace.h>
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 
 #include <sys/procfs.h>
 
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 627a470..17f49ab 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -30,7 +30,7 @@
 #include "value.h"
 #include "dis-asm.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "arch-utils.h"
 #include "floatformat.h"
diff --git a/gdb/top.c b/gdb/top.c
index 99fd5ff..22c2ac0 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -59,7 +59,7 @@
 #include <sys/types.h>
 
 #include "event-top.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_stat.h"
 #include <ctype.h>
 #include "ui-out.h"
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 912341a..57e001b 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -27,7 +27,7 @@
 #include "value.h"
 #include "target.h"
 #include "language.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "inferior.h"
 #include "breakpoint.h"
 #include "tracepoint.h"
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c
index 24aff98..4f9c672 100644
--- a/gdb/tui/tui-command.c
+++ b/gdb/tui/tui-command.c
@@ -28,7 +28,7 @@
 #include "tui/tui-command.h"
 
 #include "gdb_curses.h"
-#include "gdb_string.h"
+#include <string.h>
 
 
 /*****************************************
diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c
index 1f74b3f..7fcf3ed 100644
--- a/gdb/tui/tui-data.c
+++ b/gdb/tui/tui-data.c
@@ -25,7 +25,7 @@
 #include "tui/tui-data.h"
 #include "tui/tui-wingeneral.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_curses.h"
 
 /****************************
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index ff50841..2ee49de 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -27,7 +27,7 @@
 #include "value.h"
 #include "source.h"
 #include "disasm.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "tui/tui.h"
 #include "tui/tui-data.h"
 #include "tui/tui-win.h"
diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c
index 9efba95..b90a623 100644
--- a/gdb/tui/tui-file.c
+++ b/gdb/tui/tui-file.c
@@ -23,7 +23,7 @@
 
 #include "tui.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* A ``struct ui_file'' that is compatible with all the legacy
    code.  */
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 209817f..5b588c8 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -38,7 +38,7 @@
 #include "tui/tui-disasm.h"
 #include "tui/tui-layout.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_curses.h"
 
 /*******************************
diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c
index 87311d8..9ad3db9 100644
--- a/gdb/tui/tui-out.c
+++ b/gdb/tui/tui-out.c
@@ -25,7 +25,7 @@
 #include "ui-out.h"
 #include "cli-out.h"
 #include "tui.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 
 struct tui_ui_out_data
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 62c0fad..324d53d 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -30,7 +30,7 @@
 #include "regcache.h"
 #include "inferior.h"
 #include "target.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "tui/tui-layout.h"
 #include "tui/tui-win.h"
 #include "tui/tui-windata.h"
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 030653c..5631921 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -35,7 +35,7 @@
 #include "tui/tui-winsource.h"
 #include "tui/tui-source.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_curses.h"
 
 /* Function to display source in the source window.  */
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index 262a6bf..bdc816c 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -28,7 +28,7 @@
 #include "target.h"
 #include "top.h"
 #include "gdb-demangle.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "tui/tui.h"
 #include "tui/tui-data.h"
 #include "tui/tui-stack.h"
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index c12f036..463925e 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -46,7 +46,7 @@
 
 #include "gdb_curses.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include <ctype.h>
 #include "readline/readline.h"
 
diff --git a/gdb/tui/tui-windata.c b/gdb/tui/tui-windata.c
index 08206f8..4bbdf39 100644
--- a/gdb/tui/tui-windata.c
+++ b/gdb/tui/tui-windata.c
@@ -26,7 +26,7 @@
 #include "tui/tui-regs.h"
 #include "tui/tui-windata.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_curses.h"
 
 
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 53a45a2..a22ff0d 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -38,7 +38,7 @@
 #include "tui/tui-source.h"
 #include "tui/tui-disasm.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_curses.h"
 #include "gdb_assert.h"
 
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index cf3ba38..265c5a7 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -32,7 +32,7 @@
 #include "language.h"
 #include "cp-abi.h"
 #include "typeprint.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "exceptions.h"
 #include "valprint.h"
 #include <errno.h>
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 68089e6..af5dd11 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -22,7 +22,7 @@
 #include "defs.h"
 #include "ui-file.h"
 #include "gdb_obstack.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_select.h"
 
 #include <errno.h>
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index afd15f9..147b815 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -22,7 +22,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "expression.h"		/* For language.h */
 #include "language.h"
 #include "ui-out.h"
diff --git a/gdb/user-regs.c b/gdb/user-regs.c
index 2541aa7..e0fd25c 100644
--- a/gdb/user-regs.c
+++ b/gdb/user-regs.c
@@ -22,7 +22,7 @@
 #include "defs.h"
 #include "user-regs.h"
 #include "gdbtypes.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "frame.h"
 
diff --git a/gdb/utils.c b/gdb/utils.c
index 6026450..8e781fc 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -21,7 +21,7 @@
 #include "dyn-string.h"
 #include "gdb_assert.h"
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_wait.h"
 #include "event-top.h"
 #include "exceptions.h"
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index e374df8..2500770 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -26,7 +26,7 @@
 #include "dwarf2-frame.h"
 #include "gdbtypes.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "gdbcore.h"
 #include "arch-utils.h"
diff --git a/gdb/valarith.c b/gdb/valarith.c
index c457f4a..8ec86b0 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -25,7 +25,7 @@
 #include "expression.h"
 #include "target.h"
 #include "language.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "doublest.h"
 #include "dfp.h"
 #include <math.h>
diff --git a/gdb/valops.c b/gdb/valops.c
index 502fb0d..22d4602 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -38,7 +38,7 @@
 #include "user-regs.h"
 #include "tracepoint.h"
 #include <errno.h>
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "cp-support.h"
 #include "observer.h"
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 8fe1224..728847b 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
diff --git a/gdb/value.c b/gdb/value.c
index 2a1e1f2..56fb14c 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -19,7 +19,7 @@
 
 #include "defs.h"
 #include "arch-utils.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 6699699..7eb604e 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -26,7 +26,7 @@
 #include "valprint.h"
 
 #include "gdb_assert.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_regex.h"
 
 #include "varobj.h"
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 550b56b..6e4eb3c 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -33,7 +33,7 @@
 #include "trad-frame.h"
 #include "value.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 #include "vax-tdep.h"
 
diff --git a/gdb/vaxnbsd-tdep.c b/gdb/vaxnbsd-tdep.c
index 42712ec..324394a 100644
--- a/gdb/vaxnbsd-tdep.c
+++ b/gdb/vaxnbsd-tdep.c
@@ -24,7 +24,7 @@
 #include "vax-tdep.h"
 #include "solib-svr4.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* NetBSD ELF.  */
 
diff --git a/gdb/vaxobsd-tdep.c b/gdb/vaxobsd-tdep.c
index 55515f3..c0346a8 100644
--- a/gdb/vaxobsd-tdep.c
+++ b/gdb/vaxobsd-tdep.c
@@ -27,7 +27,7 @@
 
 #include "vax-tdep.h"
 
-#include "gdb_string.h"
+#include <string.h>
 
 /* Signal trampolines.  */
 
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 75831d8..24ef78c 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -51,7 +51,7 @@
 #include "objfiles.h"
 #include "gdb_bfd.h"
 #include "gdb_obstack.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdbthread.h"
 #include "gdbcmd.h"
 #include <sys/param.h>
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index e4d0861..6629481 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -24,7 +24,7 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <ctype.h>
-#include "gdb_string.h"
+#include <string.h>
 
 #include <sys/param.h>
 #ifdef HAVE_SYS_FILE_H
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 884b716..a789f67 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -22,7 +22,7 @@
 #include "exceptions.h"
 #include "xml-support.h"
 
-#include "gdb_string.h"
+#include <string.h>
 #include "safe-ctype.h"
 
 /* Debugging flag.  */
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index d5e315c..3591a46 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -29,7 +29,7 @@
 #include "value.h"
 #include "dis-asm.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "gdb_assert.h"
 #include "arch-utils.h"
 #include "floatformat.h"
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 4c7f0ab..e287f18 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "frame.h"
 #include "inferior.h"
 #include "gdbcore.h"
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [2/10] RFC: remove gdb_string.h
  2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
@ 2012-11-15 20:08   ` Eli Zaretskii
  2012-11-15 20:22     ` Tom Tromey
  2012-11-16  2:42   ` Joel Brobecker
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-15 20:08 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Date: Thu, 15 Nov 2012 12:20:05 -0700
> 
> This one removes gdb_string.h and pulls in various related gnulib
> modules.
> 
> The bulk of this patch is just changing "gdb_string.h" to <string.h>.

Why do we need the gnulib module?  Why not just assume the ANSI C
string.h header?


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [2/10] RFC: remove gdb_string.h
  2012-11-15 20:08   ` Eli Zaretskii
@ 2012-11-15 20:22     ` Tom Tromey
  2012-11-15 20:34       ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 20:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> Why do we need the gnulib module?  Why not just assume the ANSI C
Eli> string.h header?

For string.h maybe we could.
I don't mind dropping this module.

For strstr and strerror, it seems that gnulib fixes some actual bugs.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [10/10] RFC: remove gdb_wait.h
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (10 preceding siblings ...)
  2012-11-15 19:33 ` [9/10] RFC: remove gdb_stat.h Tom Tromey
@ 2012-11-15 20:32 ` Tom Tromey
  2012-11-15 20:54   ` Eli Zaretskii
  2012-11-16 17:28   ` Pedro Alves
  2012-11-16 17:55 ` [0/10] RFC: use gnulib more heavily + more configure fixes Pedro Alves
  12 siblings, 2 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-15 20:32 UTC (permalink / raw)
  To: gdb-patches

This replaces gdb_wait.h with the corresponding gnulib module.

Tom

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add sys_wait.
	* common/gdb_wait.h: Remove.
	* configure.ac: Don't check for sys/wait.h, wait.h.
	* config.in: Rebuild.
	* configure: Rebuild.
	* gnulib/aclocal.m4: Update.
	* gnulib/configure: Update.
	* gnulib/import/Makefile.am: Update.
	* gnulib/import/Makefile.in: Update.
	* gnulib/import/m4/gnulib-cache.m4: Update.
	* gnulib/import/m4/gnulib-comp.m4: Update.
	* gnulib/import/m4/sys_wait_h.m4: Update.
	* gnulib/import/sys_wait.in.h: Update.
	* charset.c: Update.
	* cli/cli-cmds.c: Update.
	* fork-child.c: Update.
	* gnu-nat.c: Update.
	* go32-nat.c: Update.
	* ia64-linux-nat.c: Update.
	* inf-child.c: Update.
	* inf-ptrace.c: Update.
	* infrun.c: Update.
	* linux-fork.c: Update.
	* linux-nat.c: Update.
	* ppc-linux-nat.c: Update.
	* proc-api.c: Update.
	* procfs.c: Update.
	* remote-fileio.c: Update.
	* sparc-nat.c: Update.
	* spu-linux-nat.c: Update.
	* utils.c: Update.
	* xtensa-linux-nat.c: Update.
	* common/linux-ptrace.c: Update.

	* configure.ac: Don't check for sys/wait.h.
	* config.in: Rebuild.
	* configure: Rebuild.
	* server.c: Update.
	* linux-low.c: Update.
---
 gdb/charset.c                        |    2 +-
 gdb/cli/cli-cmds.c                   |    2 +-
 gdb/common/gdb_wait.h                |  113 ---------------------------
 gdb/common/linux-ptrace.c            |    2 +-
 gdb/config.in                        |    6 --
 gdb/configure                        |    2 +-
 gdb/configure.ac                     |    2 +-
 gdb/fork-child.c                     |    2 +-
 gdb/gdbserver/config.in              |    6 --
 gdb/gdbserver/configure              |    2 +-
 gdb/gdbserver/configure.ac           |    2 +-
 gdb/gdbserver/linux-low.c            |    2 +-
 gdb/gdbserver/server.c               |    2 +-
 gdb/gnu-nat.c                        |    2 +-
 gdb/gnulib/aclocal.m4                |    1 +
 gdb/gnulib/configure                 |  141 ++++++++++++++++++++++++++++++++++
 gdb/gnulib/import/Makefile.am        |   30 +++++++-
 gdb/gnulib/import/Makefile.in        |   33 +++++++-
 gdb/gnulib/import/m4/gnulib-cache.m4 |    3 +-
 gdb/gnulib/import/m4/gnulib-comp.m4  |    5 +
 gdb/gnulib/import/m4/sys_wait_h.m4   |   36 +++++++++
 gdb/gnulib/import/sys_wait.in.h      |  129 +++++++++++++++++++++++++++++++
 gdb/gnulib/update-gnulib.sh          |    2 +-
 gdb/go32-nat.c                       |    2 +-
 gdb/ia64-linux-nat.c                 |    2 +-
 gdb/inf-child.c                      |    2 +-
 gdb/inf-ptrace.c                     |    2 +-
 gdb/infrun.c                         |    2 +-
 gdb/linux-fork.c                     |    2 +-
 gdb/linux-nat.c                      |    2 +-
 gdb/ppc-linux-nat.c                  |    2 +-
 gdb/proc-api.c                       |    2 +-
 gdb/procfs.c                         |    2 +-
 gdb/remote-fileio.c                  |    2 +-
 gdb/sparc-nat.c                      |    2 +-
 gdb/spu-linux-nat.c                  |    2 +-
 gdb/utils.c                          |    2 +-
 gdb/xtensa-linux-nat.c               |    2 +-
 38 files changed, 398 insertions(+), 159 deletions(-)
 delete mode 100644 gdb/common/gdb_wait.h
 create mode 100644 gdb/gnulib/import/m4/sys_wait_h.m4
 create mode 100644 gdb/gnulib/import/sys_wait.in.h

diff --git a/gdb/charset.c b/gdb/charset.c
index d032908..9c25f76 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -22,7 +22,7 @@
 #include "gdbcmd.h"
 #include "gdb_assert.h"
 #include "gdb_obstack.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "charset-list.h"
 #include "vec.h"
 #include "environ.h"
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 991ad00..cc3df66 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -25,7 +25,7 @@
 #include "readline/tilde.h"
 #include "completer.h"
 #include "target.h"	/* For baud_rate, remote_debug and remote_timeout.  */
-#include "gdb_wait.h"	/* For shell escape implementation.  */
+#include <sys/wait.h>	/* For shell escape implementation.  */
 #include "gdb_regex.h"	/* Used by apropos_command.  */
 #include <string.h>
 #include "gdb_vfork.h"
diff --git a/gdb/common/gdb_wait.h b/gdb/common/gdb_wait.h
deleted file mode 100644
index 1d02f37..0000000
--- a/gdb/common/gdb_wait.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Standard wait macros.
-   Copyright (C) 2000, 2007-2012 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef GDB_WAIT_H
-#define GDB_WAIT_H
-
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h> /* POSIX */
-#else
-#ifdef HAVE_WAIT_H
-#include <wait.h> /* legacy */
-#endif
-#endif
-
-/* Define how to access the int that the wait system call stores.
-   This has been compatible in all Unix systems since time immemorial,
-   but various well-meaning people have defined various different
-   words for the same old bits in the same old int (sometimes claimed
-   to be a struct).  We just know it's an int and we use these macros
-   to access the bits.  */
-
-/* The following macros are defined equivalently to their definitions
-   in POSIX.1.  We fail to define WNOHANG and WUNTRACED, which POSIX.1
-   <sys/wait.h> defines, since our code does not use waitpid() (but
-   NOTE exception for GNU/Linux below).  We also fail to declare
-   wait() and waitpid().  */
-
-#ifndef	WIFEXITED
-#define WIFEXITED(w)	(((w)&0377) == 0)
-#endif
-
-#ifndef	WIFSIGNALED
-#define WIFSIGNALED(w)	(((w)&0377) != 0177 && ((w)&~0377) == 0)
-#endif
-
-#ifndef	WIFSTOPPED
-#ifdef IBM6000
-
-/* Unfortunately, the above comment (about being compatible in all Unix 
-   systems) is not quite correct for AIX, sigh.  And AIX 3.2 can generate
-   status words like 0x57c (sigtrap received after load), and gdb would
-   choke on it.  */
-
-#define WIFSTOPPED(w)	((w)&0x40)
-
-#else
-#define WIFSTOPPED(w)	(((w)&0377) == 0177)
-#endif
-#endif
-
-#ifndef	WEXITSTATUS
-#define WEXITSTATUS(w)	(((w) >> 8) & 0377) /* same as WRETCODE */
-#endif
-
-#ifndef	WTERMSIG
-#define WTERMSIG(w)	((w) & 0177)
-#endif
-
-#ifndef	WSTOPSIG
-#define WSTOPSIG	WEXITSTATUS
-#endif
-
-/* These are not defined in POSIX, but are used by our programs.  */
-
-#ifndef	WSETEXIT
-# ifdef	W_EXITCODE
-#define	WSETEXIT(w,status) ((w) = W_EXITCODE(status,0))
-# else
-#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
-# endif
-#endif
-
-#ifndef	WSETSTOP
-# ifdef	W_STOPCODE
-#define	WSETSTOP(w,sig)    ((w) = W_STOPCODE(sig))
-# else
-#define WSETSTOP(w,sig)	   ((w) = (0177 | ((sig) << 8)))
-# endif
-#endif
-
-/* For native GNU/Linux we may use waitpid and the __WCLONE option.
-  <GRIPE> It is of course dangerous not to use the REAL header file...
-  </GRIPE>.  */
-
-/* Bits in the third argument to `waitpid'.  */
-#ifndef WNOHANG
-#define	WNOHANG		1	/* Don't block waiting.  */
-#endif
-
-#ifndef WUNTRACED
-#define	WUNTRACED	2	/* Report status of stopped children.  */
-#endif
-
-#ifndef __WCLONE
-#define __WCLONE	0x80000000 /* Wait for cloned process.  */
-#endif
-
-#endif
diff --git a/gdb/common/linux-ptrace.c b/gdb/common/linux-ptrace.c
index 22cc204..eb1d366 100644
--- a/gdb/common/linux-ptrace.c
+++ b/gdb/common/linux-ptrace.c
@@ -27,7 +27,7 @@
 #include "linux-procfs.h"
 #include "buffer.h"
 #include "gdb_assert.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 
 /* Find all possible reasons we could fail to attach PID and append these
    newline terminated reason strings to initialized BUFFER.  '\0' termination
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 644d853..6517108 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1079,7 +1079,7 @@ AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
 		  sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
 		  sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
 		  sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
-		  sys/wait.h wait.h termios.h termio.h \
+		  termios.h termio.h \
 		  sgtty.h unistd.h elf_hp.h locale.h \
 		  dlfcn.h sys/socket.h sys/un.h])
 AC_CHECK_HEADERS(link.h, [], [],
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 1e136de..5c726ed 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -25,7 +25,7 @@
 #include "inferior.h"
 #include "terminal.h"
 #include "target.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdb_vfork.h"
 #include "gdbcore.h"
 #include "terminal.h"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 5e7545e..8d00948 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -53,7 +53,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h dnl
 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
 		 errno.h fcntl.h sys/file.h malloc.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
-		 netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h)
+		 netinet/tcp.h arpa/inet.h sys/un.h)
 AC_CHECK_FUNCS(pread pwrite pread64 readlink)
 AC_REPLACE_FUNCS(vasprintf vsnprintf)
 
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index fa85413..a476031 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -21,7 +21,7 @@
 #include "linux-osdata.h"
 #include "agent.h"
 
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <stdio.h>
 #include <sys/param.h>
 #include <sys/ptrace.h>
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 427f40d..b37398d 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -23,7 +23,7 @@
 
 #include <unistd.h>
 #include <signal.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index fb042b1..95a984f 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -59,7 +59,7 @@
 #include "value.h"
 #include "language.h"
 #include "target.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdbcmd.h"
 #include "gdbcore.h"
 #include "gdbthread.h"
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index e866c87..71162cc 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,7 @@
 #     regenerate the various scripts and Makefiles are on the PATH.
 
 # The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent sys_stat"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent sys_stat sys_wait"
 
 # The gnulib commit ID to use for the update.
 GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index bd8d25e..52053ba 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -89,7 +89,7 @@
 #include "i386-nat.h"
 #include "inferior.h"
 #include "gdbthread.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdbcore.h"
 #include "command.h"
 #include "gdbcmd.h"
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index b3acb9e..d9b4f2d 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -29,7 +29,7 @@
 
 #include <signal.h>
 #include <sys/ptrace.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
 #endif
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index c42e08d..f90e4ac 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -30,7 +30,7 @@
 #include "inf-child.h"
 #include "gdb/fileio.h"
 #include "agent.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>		/* for MAXPATHLEN */
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index d645dab..ab4af04 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -29,7 +29,7 @@
 #include "gdb_assert.h"
 #include <string.h>
 #include "gdb_ptrace.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <signal.h>
 
 #include "inf-ptrace.h"
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 7812123..9bd8938 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -26,7 +26,7 @@
 #include "inferior.h"
 #include "exceptions.h"
 #include "breakpoint.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdbcore.h"
 #include "gdbcmd.h"
 #include "cli/cli-script.h"
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index d46fe84..53c6300 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -31,7 +31,7 @@
 #include "gdbthread.h"
 
 #include <sys/ptrace.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <sys/param.h>
 #include <dirent.h>
 #include <ctype.h>
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 67a6c43..89abca7 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -21,7 +21,7 @@
 #include "inferior.h"
 #include "target.h"
 #include <string.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdb_assert.h"
 #ifdef HAVE_TKILL_SYSCALL
 #include <unistd.h>
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index d201aa8..453ea4c 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -36,7 +36,7 @@
 #include <signal.h>
 #include <sys/user.h>
 #include <sys/ioctl.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <fcntl.h>
 #include <sys/procfs.h>
 #include <sys/ptrace.h>
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index 876d08c..0ef4e78 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -45,7 +45,7 @@
 #include <sys/user.h>	/* for struct user */
 #endif
 #include <fcntl.h>	/* for O_RDWR etc.  */
-#include "gdb_wait.h"
+#include <sys/wait.h>
 
 #include "proc-utils.h"
 
diff --git a/gdb/procfs.c b/gdb/procfs.c
index d7d0d50..c43373d 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -42,7 +42,7 @@
 #include <sys/syscall.h>
 #endif
 #include <sys/errno.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <signal.h>
 #include <ctype.h>
 #include "gdb_bfd.h"
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index ec981ee..2ffb392 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -24,7 +24,7 @@
 #include "gdbcmd.h"
 #include "remote.h"
 #include "gdb/fileio.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <sys/stat.h>
 #include "exceptions.h"
 #include "remote-fileio.h"
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index e1d46e3..d5b6e63 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -26,7 +26,7 @@
 #include <signal.h>
 #include <string.h>
 #include <sys/ptrace.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #ifdef HAVE_MACHINE_REG_H
 #include <machine/reg.h>
 #endif
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index bbab38d..b51ed8f 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -27,7 +27,7 @@
 #include "inf-ptrace.h"
 #include "regcache.h"
 #include "symfile.h"
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "gdbthread.h"
 #include "gdb_bfd.h"
 
diff --git a/gdb/utils.c b/gdb/utils.c
index 316cbd6..6ed0c5b 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -22,7 +22,7 @@
 #include "gdb_assert.h"
 #include <ctype.h>
 #include <string.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include "event-top.h"
 #include "exceptions.h"
 #include "gdbthread.h"
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index e287f18..a9eede0 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -33,7 +33,7 @@
 #include <signal.h>
 #include <sys/user.h>
 #include <sys/ioctl.h>
-#include "gdb_wait.h"
+#include <sys/wait.h>
 #include <fcntl.h>
 #include <sys/procfs.h>
 #include <sys/ptrace.h>
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [2/10] RFC: remove gdb_string.h
  2012-11-15 20:22     ` Tom Tromey
@ 2012-11-15 20:34       ` Eli Zaretskii
  0 siblings, 0 replies; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-15 20:34 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Thu, 15 Nov 2012 13:22:36 -0700
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> Why do we need the gnulib module?  Why not just assume the ANSI C
> Eli> string.h header?
> 
> For string.h maybe we could.
> I don't mind dropping this module.
> 
> For strstr and strerror, it seems that gnulib fixes some actual bugs.

No, my comment was only about string.h, since it looked to me that
gdb_string.h includes only stuff that should be in any ISO C compliant
compiler/library.


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
@ 2012-11-15 20:54   ` Eli Zaretskii
  2012-11-15 21:08     ` Joel Brobecker
  2012-11-16 17:28   ` Pedro Alves
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-15 20:54 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> From: Tom Tromey <tromey@redhat.com>
> Date: Thu, 15 Nov 2012 12:34:09 -0700
> 
> This replaces gdb_wait.h with the corresponding gnulib module.

This could break the MinGW build some day, or maybe even today: its
definition of WIFSIGNALED and WIFEXITED is inaccurate for Windows.

I say "some day" because it looks like we don't actually use
WIFSIGNALED in any file that is compiled on Windows (not sure about
WIFEXITED, though).


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-15 20:54   ` Eli Zaretskii
@ 2012-11-15 21:08     ` Joel Brobecker
  2012-11-16  8:18       ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Joel Brobecker @ 2012-11-15 21:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Tom Tromey, gdb-patches

> This could break the MinGW build some day, or maybe even today: its
> definition of WIFSIGNALED and WIFEXITED is inaccurate for Windows.
> 
> I say "some day" because it looks like we don't actually use
> WIFSIGNALED in any file that is compiled on Windows (not sure about
> WIFEXITED, though).

In that case, let's be proactive and contribute a patch to gnulib?
You seem to know what the problem is, so you'd be the best candidate.

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [2/10] RFC: remove gdb_string.h
  2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
  2012-11-15 20:08   ` Eli Zaretskii
@ 2012-11-16  2:42   ` Joel Brobecker
  1 sibling, 0 replies; 44+ messages in thread
From: Joel Brobecker @ 2012-11-16  2:42 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> The bulk of this patch is just changing "gdb_string.h" to <string.h>.
> 
> I dropped the auto-generated bits from this patch, but not the #include
> changes.
[...]
> 
> 	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add string,
> 	strerror, and strstr.
> 	* common/gdb_string.h: Remove.
> 	* configure.ac: Don't check for string.h, memory.h, strings.h,
> 	strerror, or strstr.
> 	* config.in: Rebuild.
> 	* configure: Rebuild.
> 	* gnulib/aclocal.m4: Update.
> 	* gnulib/configure: Update.
> 	* gnulib/import/Makefile.am: Update.
> 	* gnulib/import/Makefile.in: Update.
> 	* gnulib/import/errno.in.h: Update.
> 	* gnulib/import/intprops.h: Update.
> 	* gnulib/import/m4/errno_h.m4: Update.
> 	* gnulib/import/m4/gnulib-cache.m4: Update.
> 	* gnulib/import/m4/gnulib-comp.m4: Update.
> 	* gnulib/import/m4/strerror.m4: Update.
> 	* gnulib/import/m4/strstr.m4: Update.
> 	* gnulib/import/m4/sys_socket_h.m4: Update.
> 	* gnulib/import/strerror-override.c: Update.
> 	* gnulib/import/strerror-override.h: Update.
> 	* gnulib/import/strerror.c: Update.
> 	* gnulib/import/strstr.c: Update.
> 
> 	* ada-exp.y: Update.
> 	* ada-lang.c: Update.
> 	* ada-lex.l: Update.
> 	* ada-typeprint.c: Update.
> 	* ada-valprint.c: Update.
> 	* aix-thread.c: Update.
> 	* alpha-linux-tdep.c: Update.
> 	* alpha-mdebug-tdep.c: Update.
> 	* alpha-nat.c: Update.
> 	* alpha-osf1-tdep.c: Update.
> 	* alpha-tdep.c: Update.
> 	* alphanbsd-tdep.c: Update.
> 	* amd64-dicos-tdep.c: Update.
> 	* amd64-linux-nat.c: Update.
> 	* amd64-linux-tdep.c: Update.
> 	* amd64-nat.c: Update.
> 	* amd64-sol2-tdep.c: Update.
> 	* amd64fbsd-tdep.c: Update.
> 	* amd64obsd-tdep.c: Update.
> 	* arch-utils.c: Update.
> 	* arm-linux-nat.c: Update.
> 	* arm-linux-tdep.c: Update.
> 	* arm-tdep.c: Update.
> 	* arm-wince-tdep.c: Update.
> 	* armbsd-tdep.c: Update.
> 	* armnbsd-nat.c: Update.
> 	* armnbsd-tdep.c: Update.
> 	* armobsd-tdep.c: Update.
> 	* avr-tdep.c: Update.
> 	* ax-gdb.c: Update.
> 	* ax-general.c: Update.
> 	* bcache.c: Update.
> 	* bfin-tdep.c: Update.
> 	* breakpoint.c: Update.
> 	* buildsym.c: Update.
> 	* c-exp.y: Update.
> 	* c-lang.c: Update.
> 	* c-typeprint.c: Update.
> 	* c-valprint.c: Update.
> 	* charset.c: Update.
> 	* cli-out.c: Update.
> 	* cli/cli-cmds.c: Update.
> 	* cli/cli-decode.c: Update.
> 	* cli/cli-dump.c: Update.
> 	* cli/cli-interp.c: Update.
> 	* cli/cli-logging.c: Update.
> 	* cli/cli-script.c: Update.
> 	* cli/cli-setshow.c: Update.
> 	* cli/cli-utils.c: Update.
> 	* coffread.c: Update.
> 	* common/linux-procfs.c: Update.
> 	* common/linux-ptrace.c: Update.
> 	* common/signals.c: Update.
> 	* common/vec.h: Update.
> 	* core-regset.c: Update.
> 	* corefile.c: Update.
> 	* corelow.c: Update.
> 	* cp-abi.c: Update.
> 	* cp-support.c: Update.
> 	* cp-valprint.c: Update.
> 	* cris-tdep.c: Update.
> 	* d-lang.c: Update.
> 	* dbxread.c: Update.
> 	* dcache.c: Update.
> 	* demangle.c: Update.
> 	* dicos-tdep.c: Update.
> 	* disasm.c: Update.
> 	* doublest.c: Update.
> 	* dsrec.c: Update.
> 	* dummy-frame.c: Update.
> 	* dwarf2-frame.c: Update.
> 	* dwarf2loc.c: Update.
> 	* dwarf2read.c: Update.
> 	* elfread.c: Update.
> 	* environ.c: Update.
> 	* eval.c: Update.
> 	* event-loop.c: Update.
> 	* exceptions.c: Update.
> 	* exec.c: Update.
> 	* expprint.c: Update.
> 	* f-exp.y: Update.
> 	* f-lang.c: Update.
> 	* f-typeprint.c: Update.
> 	* f-valprint.c: Update.
> 	* fbsd-nat.c: Update.
> 	* findcmd.c: Update.
> 	* findvar.c: Update.
> 	* fork-child.c: Update.
> 	* frame.c: Update.
> 	* frv-linux-tdep.c: Update.
> 	* frv-tdep.c: Update.
> 	* gdb.c: Update.
> 	* gdb_bfd.c: Update.
> 	* gdbarch.c: Update.
> 	* gdbserver/gdbreplay.c: Update.
> 	* gdbserver/server.h: Update.
> 	* gdbtypes.c: Update.
> 	* gnu-nat.c: Update.
> 	* gnu-v2-abi.c: Update.
> 	* gnu-v3-abi.c: Update.
> 	* go-exp.y: Update.
> 	* go-lang.c: Update.
> 	* go32-nat.c: Update.
> 	* hppa-hpux-tdep.c: Update.
> 	* hppa-linux-nat.c: Update.
> 	* hppanbsd-tdep.c: Update.
> 	* hppaobsd-tdep.c: Update.
> 	* i386-cygwin-tdep.c: Update.
> 	* i386-dicos-tdep.c: Update.
> 	* i386-linux-nat.c: Update.
> 	* i386-linux-tdep.c: Update.
> 	* i386-nto-tdep.c: Update.
> 	* i386-sol2-tdep.c: Update.
> 	* i386-tdep.c: Update.
> 	* i386bsd-tdep.c: Update.
> 	* i386gnu-nat.c: Update.
> 	* i386nbsd-tdep.c: Update.
> 	* i386obsd-tdep.c: Update.
> 	* i387-tdep.c: Update.
> 	* ia64-libunwind-tdep.c: Update.
> 	* ia64-linux-nat.c: Update.
> 	* inf-child.c: Update.
> 	* inf-ptrace.c: Update.
> 	* inf-ttrace.c: Update.
> 	* infcall.c: Update.
> 	* infcmd.c: Update.
> 	* inflow.c: Update.
> 	* infrun.c: Update.
> 	* interps.c: Update.
> 	* iq2000-tdep.c: Update.
> 	* irix5-nat.c: Update.
> 	* jv-exp.y: Update.
> 	* jv-lang.c: Update.
> 	* jv-typeprint.c: Update.
> 	* jv-valprint.c: Update.
> 	* language.c: Update.
> 	* linux-fork.c: Update.
> 	* linux-nat.c: Update.
> 	* lm32-tdep.c: Update.
> 	* m2-exp.y: Update.
> 	* m2-typeprint.c: Update.
> 	* m32c-tdep.c: Update.
> 	* m32r-linux-nat.c: Update.
> 	* m32r-linux-tdep.c: Update.
> 	* m32r-rom.c: Update.
> 	* m32r-tdep.c: Update.
> 	* m68hc11-tdep.c: Update.
> 	* m68k-tdep.c: Update.
> 	* m68kbsd-tdep.c: Update.
> 	* m68klinux-nat.c: Update.
> 	* m68klinux-tdep.c: Update.
> 	* m88k-tdep.c: Update.
> 	* macrocmd.c: Update.
> 	* main.c: Update.
> 	* mdebugread.c: Update.
> 	* mem-break.c: Update.
> 	* memattr.c: Update.
> 	* memory-map.c: Update.
> 	* mep-tdep.c: Update.
> 	* mi/mi-cmd-break.c: Update.
> 	* mi/mi-cmd-disas.c: Update.
> 	* mi/mi-cmd-env.c: Update.
> 	* mi/mi-cmd-stack.c: Update.
> 	* mi/mi-cmd-var.c: Update.
> 	* mi/mi-cmds.c: Update.
> 	* mi/mi-console.c: Update.
> 	* mi/mi-getopt.c: Update.
> 	* mi/mi-interp.c: Update.
> 	* mi/mi-main.c: Update.
> 	* mi/mi-parse.c: Update.
> 	* microblaze-rom.c: Update.
> 	* microblaze-tdep.c: Update.
> 	* mingw-hdep.c: Update.
> 	* minsyms.c: Update.
> 	* mips-irix-tdep.c: Update.
> 	* mips-linux-tdep.c: Update.
> 	* mips-tdep.c: Update.
> 	* mips64obsd-tdep.c: Update.
> 	* mipsnbsd-tdep.c: Update.
> 	* mipsread.c: Update.
> 	* mn10300-linux-tdep.c: Update.
> 	* mn10300-tdep.c: Update.
> 	* monitor.c: Update.
> 	* moxie-tdep.c: Update.
> 	* mt-tdep.c: Update.
> 	* nbsd-tdep.c: Update.
> 	* nto-procfs.c: Update.
> 	* nto-tdep.c: Update.
> 	* objc-lang.c: Update.
> 	* objfiles.c: Update.
> 	* opencl-lang.c: Update.
> 	* osabi.c: Update.
> 	* osdata.c: Update.
> 	* p-exp.y: Update.
> 	* p-lang.c: Update.
> 	* p-typeprint.c: Update.
> 	* parse.c: Update.
> 	* posix-hdep.c: Update.
> 	* ppc-linux-nat.c: Update.
> 	* ppc-sysv-tdep.c: Update.
> 	* ppcnbsd-tdep.c: Update.
> 	* ppcobsd-tdep.c: Update.
> 	* printcmd.c: Update.
> 	* procfs.c: Update.
> 	* prologue-value.c: Update.
> 	* python/py-auto-load.c: Update.
> 	* python/py-gdb-readline.c: Update.
> 	* ravenscar-thread.c: Update.
> 	* regcache.c: Update.
> 	* registry.c: Update.
> 	* remote-fileio.c: Update.
> 	* remote-m32r-sdi.c: Update.
> 	* remote-mips.c: Update.
> 	* remote-sim.c: Update.
> 	* remote.c: Update.
> 	* reverse.c: Update.
> 	* rs6000-aix-tdep.c: Update.
> 	* ser-base.c: Update.
> 	* ser-go32.c: Update.
> 	* ser-mingw.c: Update.
> 	* ser-pipe.c: Update.
> 	* ser-tcp.c: Update.
> 	* ser-unix.c: Update.
> 	* serial.c: Update.
> 	* sh-tdep.c: Update.
> 	* sh64-tdep.c: Update.
> 	* shnbsd-tdep.c: Update.
> 	* skip.c: Update.
> 	* sol-thread.c: Update.
> 	* solib-dsbt.c: Update.
> 	* solib-frv.c: Update.
> 	* solib-osf.c: Update.
> 	* solib-spu.c: Update.
> 	* solib-sunos.c: Update.
> 	* solib-target.c: Update.
> 	* solib.c: Update.
> 	* somread.c: Update.
> 	* source.c: Update.
> 	* sparc-nat.c: Update.
> 	* sparc-sol2-tdep.c: Update.
> 	* sparc-tdep.c: Update.
> 	* sparc64-tdep.c: Update.
> 	* sparc64fbsd-tdep.c: Update.
> 	* sparc64nbsd-tdep.c: Update.
> 	* sparcnbsd-tdep.c: Update.
> 	* spu-linux-nat.c: Update.
> 	* spu-multiarch.c: Update.
> 	* spu-tdep.c: Update.
> 	* stabsread.c: Update.
> 	* stack.c: Update.
> 	* std-regs.c: Update.
> 	* symfile.c: Update.
> 	* symmisc.c: Update.
> 	* symtab.c: Update.
> 	* target.c: Update.
> 	* thread.c: Update.
> 	* tilegx-linux-nat.c: Update.
> 	* tilegx-tdep.c: Update.
> 	* top.c: Update.
> 	* tracepoint.c: Update.
> 	* tui/tui-command.c: Update.
> 	* tui/tui-data.c: Update.
> 	* tui/tui-disasm.c: Update.
> 	* tui/tui-file.c: Update.
> 	* tui/tui-layout.c: Update.
> 	* tui/tui-out.c: Update.
> 	* tui/tui-regs.c: Update.
> 	* tui/tui-source.c: Update.
> 	* tui/tui-stack.c: Update.
> 	* tui/tui-win.c: Update.
> 	* tui/tui-windata.c: Update.
> 	* tui/tui-winsource.c: Update.
> 	* typeprint.c: Update.
> 	* ui-file.c: Update.
> 	* ui-out.c: Update.
> 	* user-regs.c: Update.
> 	* utils.c: Update.
> 	* v850-tdep.c: Update.
> 	* valarith.c: Update.
> 	* valops.c: Update.
> 	* valprint.c: Update.
> 	* value.c: Update.
> 	* varobj.c: Update.
> 	* vax-tdep.c: Update.
> 	* vaxnbsd-tdep.c: Update.
> 	* vaxobsd-tdep.c: Update.
> 	* windows-nat.c: Update.
> 	* xcoffread.c: Update.
> 	* xml-support.c: Update.
> 	* xstormy16-tdep.c: Update.
> 	* xtensa-linux-nat.c: Update.
> 
> 	* configure.ac: Don't check for string.h, strerror, strstr.
> 	* config.in: Rebuild.
> 	* configure: Rebuild.

Thanks again for doing that, Tom.

FWIW: I went through the patch, and it looks good to me. If it was
tested independintly of the rest of the patch series, it can go in
on its own.

Just one note: It does seem to me as if the strerror and strstr
changes could each have been submitted independently, no? It's
hardly worth the effort now, so not to worry. It would have made
the review of these specific bits a little easier, though, as
these patches would have been pretty small, I think.

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [3/10] RFC: remove gdb_dirent.h
  2012-11-15 19:22 ` [3/10] RFC: remove gdb_dirent.h Tom Tromey
@ 2012-11-16  2:46   ` Joel Brobecker
  2012-11-27 20:11     ` Tom Tromey
  0 siblings, 1 reply; 44+ messages in thread
From: Joel Brobecker @ 2012-11-16  2:46 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

> 	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirent.
> 	* common/gdb_dirent.h: Remove.
> 	* common/linux-osdata.c: Use <dirent.h>.
> 	(NAMELEN): Define.
> 	* config.in: Rebuild.
> 	* configure: Rebuild.
> 	* configure.ac: Don't call AC_HEADER_DIRENT.
> 	* gnulib/aclocal.m4: Update.
> 	* gnulib/configure: Update.
> 	* gnulib/import/Makefile.am: Update.
> 	* gnulib/import/Makefile.in: Update.
> 	* gnulib/import/dirent.in.h: Update.
> 	* gnulib/import/m4/dirent_h.m4: Update.
> 	* gnulib/import/m4/gnulib-cache.m4: Update.
> 	* gnulib/import/m4/gnulib-comp.m4: Update.
> 	* gnulib/import/m4/unistd_h.m4: Update.
> 	* linux-fork.c: Update.
> 	* linux-nat.c: Update.
> 	* nto-procfs.c: Update.
> 	* procfs.c: Update.
> 
> 	* Makefile.in (linux-osdata.o): Don't reference gdb_dirent.h.
> 	* config.in: Rebuild.
> 	* configure: Rebuild.
> 	* configure.ac: Don't call AC_HEADER_DIRENT.

Looks good to me.

> -linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h
> +linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h)

Outch! I had forgotten about that. I had slowly and quietly convinced
myself that gdbserver also tracked dependencies automatically... :-/

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-15 21:08     ` Joel Brobecker
@ 2012-11-16  8:18       ` Eli Zaretskii
  2012-11-16 14:45         ` Joel Brobecker
  0 siblings, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-16  8:18 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: tromey, gdb-patches

> Date: Thu, 15 Nov 2012 13:08:28 -0800
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
> 
> > This could break the MinGW build some day, or maybe even today: its
> > definition of WIFSIGNALED and WIFEXITED is inaccurate for Windows.
> > 
> > I say "some day" because it looks like we don't actually use
> > WIFSIGNALED in any file that is compiled on Windows (not sure about
> > WIFEXITED, though).
> 
> In that case, let's be proactive and contribute a patch to gnulib?
> You seem to know what the problem is, so you'd be the best candidate.

With my previous Windows-related contribution to gnulib collecting
dust since January, without any reason (the RM agreed that the code
was correct and should be admitted), why would I bother to submit
another one?

The problem is that the definition of WIFSIGNALED is naive and
incorrect for most Windows programs.  It will cause any program that
does "exit(3);" be considered as exited due to a signal SIGTERM.  And
WIFEXITED, being defined as everything but WIFSIGNALED, is
consequently also incorrect.

The truth is described in the MSDN documentation of
GetExitCodeProcess:

  If the process has terminated and the function succeeds, the status
  returned is one of the following values:

    . The exit value specified in the ExitProcess or TerminateProcess
      function.
    . The return value from the main or WinMain function of the process.
    . The exception value for an unhandled exception that caused the
      process to terminate.

This is how I translated this documentation in my port of GNU
Findutils:

  #define WEXITSTATUS(w)  ((w) & ~0xC0000000)
  #define WIFEXITED(w)    (((w) & 0xC0000000) == 0)
  #define WTERMSIG(w)     (w)
  #define WIFSIGNALED(w)  (((w) & 0xC0000000) != 0)
  #define WIFSTOPPED(w)   (0)

To produce a human-readable description of WTERMSIG, one then needs to
compare its value with the EXCEPTION_* macros defined on winbase.h
header in the w32 API headers, or convert them to Posix signals like
what handle_exception in windows-nat.c and in win32-low.c do.  E.g.,
the value 0xc0000005 means Access Violation, a.k.a. "SIGSEGV".


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16  8:18       ` Eli Zaretskii
@ 2012-11-16 14:45         ` Joel Brobecker
  2012-11-16 15:39           ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Joel Brobecker @ 2012-11-16 14:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, gdb-patches

> With my previous Windows-related contribution to gnulib collecting
> dust since January, without any reason (the RM agreed that the code
> was correct and should be admitted), why would I bother to submit
> another one?

I'm very sorry to hear that you've had problems submitting one patch.
But I hope you're not going to let that discourage you. We are not
without our own hicups too, and hopefully they are only occasional,
and can be taken care of with a few pings.

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16 14:45         ` Joel Brobecker
@ 2012-11-16 15:39           ` Eli Zaretskii
  0 siblings, 0 replies; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-16 15:39 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: tromey, gdb-patches

> Date: Fri, 16 Nov 2012 06:45:23 -0800
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: tromey@redhat.com, gdb-patches@sourceware.org
> 
> > With my previous Windows-related contribution to gnulib collecting
> > dust since January, without any reason (the RM agreed that the code
> > was correct and should be admitted), why would I bother to submit
> > another one?
> 
> I'm very sorry to hear that you've had problems submitting one patch.
> But I hope you're not going to let that discourage you.

I'm waiting for the patch to be committed, at which time I will decide
if I'm discouraged enough to continue submitting to gnulib.

> We are not without our own hicups too, and hopefully they are only
> occasional, and can be taken care of with a few pings.

You can see my pings here:

  http://lists.gnu.org/archive/html/bug-gnulib/2012-06/msg00222.html
  http://lists.gnu.org/archive/html/bug-gnulib/2012-07/msg00004.html

Sorry, I cannot consider this a "hiccup".


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [4/10] RFC: unconditionally include signal.h
  2012-11-15 19:25 ` [4/10] RFC: unconditionally include signal.h Tom Tromey
@ 2012-11-16 17:18   ` Pedro Alves
  2012-11-17  1:25     ` Joel Brobecker
  2012-11-27 20:14     ` Tom Tromey
  0 siblings, 2 replies; 44+ messages in thread
From: Pedro Alves @ 2012-11-16 17:18 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 15-11-2012 19:24, Tom Tromey wrote:
> I think that checking for signal.h is pointless, because gdb already
> includes it unconditionally in various places -- e.g., utils.c.

It's not pointless in gdbserver.  The HAVE_SIGNAL_H checks were added for
the WinCE port.  See fe7cf52e.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
  2012-11-15 20:54   ` Eli Zaretskii
@ 2012-11-16 17:28   ` Pedro Alves
  2012-11-16 17:52     ` Eli Zaretskii
  2012-11-17  2:30     ` Joel Brobecker
  1 sibling, 2 replies; 44+ messages in thread
From: Pedro Alves @ 2012-11-16 17:28 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Assuming sys/wait.h doesn't get replaced on older GNU/Linux systems,
this loses these bits:

/* For native GNU/Linux we may use waitpid and the __WCLONE option.
  <GRIPE> It is of course dangerous not to use the REAL header file...
  </GRIPE>.  */

/* Bits in the third argument to `waitpid'.  */
#ifndef WNOHANG
#define WNOHANG         1       /* Don't block waiting.  */
#endif

#ifndef WUNTRACED
#define WUNTRACED       2       /* Report status of stopped children.  */
#endif

#ifndef __WCLONE
#define __WCLONE        0x80000000 /* Wait for cloned process.  */
#endif

I'm not sure whether we still encounter systems without these, and
if gdb works on them at all.  Waiting for build failure reports would
be an option.

We could move them to say, common/linux-ptrace.h.  __WALL is already there.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16 17:28   ` Pedro Alves
@ 2012-11-16 17:52     ` Eli Zaretskii
  2012-11-16 18:10       ` Pedro Alves
  2012-11-17  2:30     ` Joel Brobecker
  1 sibling, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-16 17:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: tromey, gdb-patches

> Date: Fri, 16 Nov 2012 17:27:51 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gdb-patches@sourceware.org
> 
> Assuming sys/wait.h doesn't get replaced on older GNU/Linux systems,
> this loses these bits:
> 
> /* For native GNU/Linux we may use waitpid and the __WCLONE option.
>   <GRIPE> It is of course dangerous not to use the REAL header file...
>   </GRIPE>.  */
> 
> /* Bits in the third argument to `waitpid'.  */
> #ifndef WNOHANG
> #define WNOHANG         1       /* Don't block waiting.  */
> #endif
> 
> #ifndef WUNTRACED
> #define WUNTRACED       2       /* Report status of stopped children.  */
> #endif
> 
> #ifndef __WCLONE
> #define __WCLONE        0x80000000 /* Wait for cloned process.  */
> #endif
> 
> I'm not sure whether we still encounter systems without these, and
> if gdb works on them at all.

AFAIU, the first 2 are already available on every Posix platform, see
this discussion on the emacs-devel list:

  http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-11/msg00446.html

The 3rd one seems to be used only on Linux, so perhaps we could
depend on its being in sys/wait.h?

> We could move them to say, common/linux-ptrace.h.  __WALL is already there.

That's another option.

Coincidentally, I didn't really object to including the gnulib module,
I was just saying that it might need to be fixed to DTRT on Windows.


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
                   ` (11 preceding siblings ...)
  2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
@ 2012-11-16 17:55 ` Pedro Alves
  2012-11-27 21:24   ` Tom Tromey
  12 siblings, 1 reply; 44+ messages in thread
From: Pedro Alves @ 2012-11-16 17:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 15-11-2012 19:09, Tom Tromey wrote:
> Here's the patch series to rely more heavily on gnulib.
> 
> Some of these patches move to using a gnulib module and delete some
> corresponding gdb_*.h file.
> 
> Others just remove useless configury junk.
> 
> I tested by building each patch (cumulatively; while they are
> conceptually independent, in practice if you try to rearrange them you
> will get conflicts) on an x86-64 Fedora 16 box.  Of course, this is the
> machine least likely to show any problems, but that's what I've got.

Fedora bundles mingw toolchains (just a yum install away).  It should be
easy to confirm that --host=i686-pc-mingw32 doesn't break that way.  Last
I tried, the resulting gdbserver even works under Wine.  Don't recall if
GDB itself works.

Putting the series on an accessible git branch would make it easier
to call for testers, I think.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16 17:52     ` Eli Zaretskii
@ 2012-11-16 18:10       ` Pedro Alves
  2012-11-16 18:26         ` Eli Zaretskii
  0 siblings, 1 reply; 44+ messages in thread
From: Pedro Alves @ 2012-11-16 18:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: tromey, gdb-patches

On 16-11-2012 17:51, Eli Zaretskii wrote:
>> Date: Fri, 16 Nov 2012 17:27:51 +0000
>> From: Pedro Alves <palves@redhat.com>
>> CC: gdb-patches@sourceware.org

> AFAIU, the first 2 are already available on every Posix platform, see
> this discussion on the emacs-devel list:
> 
>   http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-11/msg00446.html
> 
> The 3rd one seems to be used only on Linux, 

Yeah, it's the third one that many me notice this.  It's Linux/NPTL specific.
Only old systems won't have it.  I'm not even sure how good our support for
LinuxThreads is nowadays.  I occasionally hear about it, but I suppose
maybe even those targets stuck in LinuxThreads already have up-to-date headers.

> so perhaps we could depend on its being in sys/wait.h?

If gnulib replaces it, then it won't be there.  If it doesn't, then the
fallback would be necessary for old systems.  I'd be totally fine with
waiting to hear if someone actually stumbles on this, as the fix is quite
trivial.  I just mention it so it doesn't pass up as an inadvertent change.

>> We could move them to say, common/linux-ptrace.h.  __WALL is already there.
> 
> That's another option.
> 
> Coincidentally, I didn't really object to including the gnulib module,
> I was just saying that it might need to be fixed to DTRT on Windows.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16 18:10       ` Pedro Alves
@ 2012-11-16 18:26         ` Eli Zaretskii
  0 siblings, 0 replies; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-16 18:26 UTC (permalink / raw)
  To: Pedro Alves; +Cc: tromey, gdb-patches

> Date: Fri, 16 Nov 2012 18:09:57 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: tromey@redhat.com, gdb-patches@sourceware.org
> 
> > so perhaps we could depend on its being in sys/wait.h?
> 
> If gnulib replaces it, then it won't be there.

Actually, now that I looked at the latest sys_wait.in.h in gnulib, I
don't see it there at all.  So maybe I was confused and didn't
understand what Tom was saying.


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [4/10] RFC: unconditionally include signal.h
  2012-11-16 17:18   ` Pedro Alves
@ 2012-11-17  1:25     ` Joel Brobecker
  2012-11-17  8:15       ` Eli Zaretskii
  2012-11-27 20:14     ` Tom Tromey
  1 sibling, 1 reply; 44+ messages in thread
From: Joel Brobecker @ 2012-11-17  1:25 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches

> > I think that checking for signal.h is pointless, because gdb already
> > includes it unconditionally in various places -- e.g., utils.c.
> 
> It's not pointless in gdbserver.  The HAVE_SIGNAL_H checks were added for
> the WinCE port.  See fe7cf52e.

Should we consider using gnulib's signal.h?

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-16 17:28   ` Pedro Alves
  2012-11-16 17:52     ` Eli Zaretskii
@ 2012-11-17  2:30     ` Joel Brobecker
  2012-11-19 15:09       ` Pedro Alves
  1 sibling, 1 reply; 44+ messages in thread
From: Joel Brobecker @ 2012-11-17  2:30 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches

> #ifndef __WCLONE
> #define __WCLONE        0x80000000 /* Wait for cloned process.  */
> #endif
> 
> I'm not sure whether we still encounter systems without these, and
> if gdb works on them at all.  Waiting for build failure reports would
> be an option.
> 
> We could move them to say, common/linux-ptrace.h.  __WALL is already there.

I normally suggest that we wait for build failure reports, but your
suggestion seems so simple that I'd just play it safe, and add it
there. Given the flag value, I'd even venture that if __WALL is
defined, I'm guessing __WCLONE should be too?

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [4/10] RFC: unconditionally include signal.h
  2012-11-17  1:25     ` Joel Brobecker
@ 2012-11-17  8:15       ` Eli Zaretskii
  2012-11-19 15:05         ` Pedro Alves
  0 siblings, 1 reply; 44+ messages in thread
From: Eli Zaretskii @ 2012-11-17  8:15 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: palves, tromey, gdb-patches

> Date: Fri, 16 Nov 2012 17:25:09 -0800
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
> 
> > > I think that checking for signal.h is pointless, because gdb already
> > > includes it unconditionally in various places -- e.g., utils.c.
> > 
> > It's not pointless in gdbserver.  The HAVE_SIGNAL_H checks were added for
> > the WinCE port.  See fe7cf52e.
> 
> Should we consider using gnulib's signal.h?

In 2 out of 3 files in gdb/gdbserver/ that use HAVE_SIGNAL_H, the
references to signal facilities are already in code not compiled if
USE_WIN32API is defined.  So instead of using HAVE_SIGNAL_H, it
strikes me as better and more correct to use USE_WIN32API when
including signal.h -- this tells more clearly and honestly what is the
reason for not including signal.h and on what platforms.

The 3rd file (server.c) could use the same condition for including
signal.h -- the rest of the code that needs signals is carefully
conditioned on the respective signals being defined.

By contrast, gnulib's signal.h defines gobs of functions and macros
that we don't necessarily need, and could potentially mean more
trouble for WinCE, because (AFAIK) that platform is not supported by
gnulib anyway.


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [4/10] RFC: unconditionally include signal.h
  2012-11-17  8:15       ` Eli Zaretskii
@ 2012-11-19 15:05         ` Pedro Alves
  0 siblings, 0 replies; 44+ messages in thread
From: Pedro Alves @ 2012-11-19 15:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joel Brobecker, tromey, gdb-patches

On 11/17/2012 08:14 AM, Eli Zaretskii wrote:
>> Date: Fri, 16 Nov 2012 17:25:09 -0800
>> From: Joel Brobecker <brobecker@adacore.com>
>> Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
>>
>>>> I think that checking for signal.h is pointless, because gdb already
>>>> includes it unconditionally in various places -- e.g., utils.c.
>>>
>>> It's not pointless in gdbserver.  The HAVE_SIGNAL_H checks were added for
>>> the WinCE port.  See fe7cf52e.
>>
>> Should we consider using gnulib's signal.h?
> 
> In 2 out of 3 files in gdb/gdbserver/ that use HAVE_SIGNAL_H, the
> references to signal facilities are already in code not compiled if
> USE_WIN32API is defined.  So instead of using HAVE_SIGNAL_H, it
> strikes me as better and more correct to use USE_WIN32API when
> including signal.h -- this tells more clearly and honestly what is the
> reason for not including signal.h and on what platforms.

I agree.

> 
> The 3rd file (server.c) could use the same condition for including
> signal.h -- the rest of the code that needs signals is carefully
> conditioned on the respective signals being defined.

I agree.

Unlike non-CE Windows, CE doesn't really have any traces of signal numbers or
functions in its C runtime.  I still looks to me that guarding common/signals.c's
inclusion of signal.h with HAVE_SIGNAL_H describes the real issue in that case better
(unless we wanted to resort to platform checks, like #ifdef _WIN32_WCE, which we tend to
avoid). Replacing signal.h with a gnulib signal.h replacement that defines signals and
kill/signal/etc. from that perspective would kind of miss the point of
common/signals.c, which is to map host signals to gdb signals.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [10/10] RFC: remove gdb_wait.h
  2012-11-17  2:30     ` Joel Brobecker
@ 2012-11-19 15:09       ` Pedro Alves
  0 siblings, 0 replies; 44+ messages in thread
From: Pedro Alves @ 2012-11-19 15:09 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Tom Tromey, gdb-patches

On 11/17/2012 02:30 AM, Joel Brobecker wrote:
>> #ifndef __WCLONE
>> #define __WCLONE        0x80000000 /* Wait for cloned process.  */
>> #endif
>>
>> I'm not sure whether we still encounter systems without these, and
>> if gdb works on them at all.  Waiting for build failure reports would
>> be an option.
>>
>> We could move them to say, common/linux-ptrace.h.  __WALL is already there.
> 
> I normally suggest that we wait for build failure reports, but your
> suggestion seems so simple that I'd just play it safe, and add it
> there. Given the flag value, I'd even venture that if __WALL is
> defined, I'm guessing __WCLONE should be too?

I don't know whether they were added at the same time or not.
Probably were, yes.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [3/10] RFC: remove gdb_dirent.h
  2012-11-16  2:46   ` Joel Brobecker
@ 2012-11-27 20:11     ` Tom Tromey
  0 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-27 20:11 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> Outch! I had forgotten about that. I had slowly and quietly convinced
Joel> myself that gdbserver also tracked dependencies automatically... :-/

Yeah.  I looked at resurrecting my automake-for-gdbserver patch, but it
is kind of a pain.  Still, I'm most of the way there... I'll give it
another shot soon.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [4/10] RFC: unconditionally include signal.h
  2012-11-16 17:18   ` Pedro Alves
  2012-11-17  1:25     ` Joel Brobecker
@ 2012-11-27 20:14     ` Tom Tromey
  1 sibling, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-11-27 20:14 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 15-11-2012 19:24, Tom Tromey wrote:
>> I think that checking for signal.h is pointless, because gdb already
>> includes it unconditionally in various places -- e.g., utils.c.

Pedro> It's not pointless in gdbserver.  The HAVE_SIGNAL_H checks were added for
Pedro> the WinCE port.  See fe7cf52e.

Thanks.
I think I will just drop this patch from the series.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-11-16 17:55 ` [0/10] RFC: use gnulib more heavily + more configure fixes Pedro Alves
@ 2012-11-27 21:24   ` Tom Tromey
  2012-12-10 20:41     ` Tom Tromey
  0 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2012-11-27 21:24 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> Fedora bundles mingw toolchains (just a yum install away).  It
Pedro> should be easy to confirm that --host=i686-pc-mingw32 doesn't
Pedro> break that way.

Thanks, I did this and it showed a bug -- we weren't linking gdbreplay
against gnulib.  I've fixed this.

I do wonder now if this will still build on WinCE.  For example,
gdbreplay defines its own strerror, surely that will clash.

Pedro> Putting the series on an accessible git branch would make it easier
Pedro> to call for testers, I think.

It is now in archer.git as archer-tromey-gnulib.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-11-27 21:24   ` Tom Tromey
@ 2012-12-10 20:41     ` Tom Tromey
  2012-12-11  3:11       ` Joel Brobecker
                         ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Tom Tromey @ 2012-12-10 20:41 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Pedro> Putting the series on an accessible git branch would make it easier
Pedro> to call for testers, I think.

Tom> It is now in archer.git as archer-tromey-gnulib.

I wonder whether anybody has tried it.

In the absence of comments I think I will go ahead and put it all in.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-12-10 20:41     ` Tom Tromey
@ 2012-12-11  3:11       ` Joel Brobecker
  2012-12-11 10:53       ` Pedro Alves
  2013-01-03 18:25       ` Tom Tromey
  2 siblings, 0 replies; 44+ messages in thread
From: Joel Brobecker @ 2012-12-11  3:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Pedro Alves, gdb-patches

> I wonder whether anybody has tried it.

I can try a few platforms, if you like. But I have so many platforms
to test that what I usually do is let the automatic builders, which
run nightly, tell me if there any problems on some of our platforms.
(that's one way of saying that I deal with the problems after the
fact).

> In the absence of comments I think I will go ahead and put it all in.

I'd go ahead. I think there were comments about some of them, though
(IIRC?).

-- 
Joel


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-12-10 20:41     ` Tom Tromey
  2012-12-11  3:11       ` Joel Brobecker
@ 2012-12-11 10:53       ` Pedro Alves
  2012-12-17 19:39         ` Tom Tromey
  2013-01-03 18:25       ` Tom Tromey
  2 siblings, 1 reply; 44+ messages in thread
From: Pedro Alves @ 2012-12-11 10:53 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 12/10/2012 08:41 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
> 
> Pedro> Putting the series on an accessible git branch would make it easier
> Pedro> to call for testers, I think.
> 
> Tom> It is now in archer.git as archer-tromey-gnulib.
> 
> I wonder whether anybody has tried it.

Sorry, I was under the impression that there'd be v2 series, but I see
now that what's in git isn't the exact same series as posted.

I tried the branch now, but that'd hardly useful, as it was just x86_64 Fedora 17.

> In the absence of comments I think I will go ahead and put it all in.

That's fine with me.  Did we reach conclusion on the sys/wait.h one?
I was under the impression we'd be moving the __WCLONE define
to common/linux-ptrace.h, next to __WALL.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-12-11 10:53       ` Pedro Alves
@ 2012-12-17 19:39         ` Tom Tromey
  0 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2012-12-17 19:39 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> That's fine with me.  Did we reach conclusion on the sys/wait.h one?
Pedro> I was under the impression we'd be moving the __WCLONE define
Pedro> to common/linux-ptrace.h, next to __WALL.

Yeah.  I had thought not, but I looked it up again just now and I see
that I misread Joel's email.

I'll make this change and push it.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2012-12-10 20:41     ` Tom Tromey
  2012-12-11  3:11       ` Joel Brobecker
  2012-12-11 10:53       ` Pedro Alves
@ 2013-01-03 18:25       ` Tom Tromey
  2013-01-03 18:42         ` Tom Tromey
  2 siblings, 1 reply; 44+ messages in thread
From: Tom Tromey @ 2013-01-03 18:25 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Tom> In the absence of comments I think I will go ahead and put it all in.

I am going to check this series in now.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [0/10] RFC: use gnulib more heavily + more configure fixes
  2013-01-03 18:25       ` Tom Tromey
@ 2013-01-03 18:42         ` Tom Tromey
  0 siblings, 0 replies; 44+ messages in thread
From: Tom Tromey @ 2013-01-03 18:42 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Tom> I am going to check this series in now.

Actually, I looked and it seems that this patch pulls in the gnulib
errno module via a dependency.  And, since this was recently backed out,
I think I am going to postpone this series until that issue is worked
out.

Tom


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2013-01-03 18:42 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
2012-11-15 19:11 ` Tom Tromey
2012-11-15 19:14 ` [1/10] RFC: update gnulib Tom Tromey
2012-11-15 19:19   ` Joel Brobecker
2012-11-15 19:15 ` [0/10] RFC: use gnulib more heavily + more configure fixes Eli Zaretskii
2012-11-15 19:22 ` [3/10] RFC: remove gdb_dirent.h Tom Tromey
2012-11-16  2:46   ` Joel Brobecker
2012-11-27 20:11     ` Tom Tromey
2012-11-15 19:25 ` [4/10] RFC: unconditionally include signal.h Tom Tromey
2012-11-16 17:18   ` Pedro Alves
2012-11-17  1:25     ` Joel Brobecker
2012-11-17  8:15       ` Eli Zaretskii
2012-11-19 15:05         ` Pedro Alves
2012-11-27 20:14     ` Tom Tromey
2012-11-15 19:26 ` [5/10] RFC: don't check for stddef.h Tom Tromey
2012-11-15 19:28 ` [6/10] RFC: don't check for stdlib.h Tom Tromey
2012-11-15 19:29 ` [7/10] RFC: don't check for unistd.h Tom Tromey
2012-11-15 19:31 ` [8/10] RFC: don't check for sys/types.h Tom Tromey
2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
2012-11-15 20:08   ` Eli Zaretskii
2012-11-15 20:22     ` Tom Tromey
2012-11-15 20:34       ` Eli Zaretskii
2012-11-16  2:42   ` Joel Brobecker
2012-11-15 19:33 ` [9/10] RFC: remove gdb_stat.h Tom Tromey
2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
2012-11-15 20:54   ` Eli Zaretskii
2012-11-15 21:08     ` Joel Brobecker
2012-11-16  8:18       ` Eli Zaretskii
2012-11-16 14:45         ` Joel Brobecker
2012-11-16 15:39           ` Eli Zaretskii
2012-11-16 17:28   ` Pedro Alves
2012-11-16 17:52     ` Eli Zaretskii
2012-11-16 18:10       ` Pedro Alves
2012-11-16 18:26         ` Eli Zaretskii
2012-11-17  2:30     ` Joel Brobecker
2012-11-19 15:09       ` Pedro Alves
2012-11-16 17:55 ` [0/10] RFC: use gnulib more heavily + more configure fixes Pedro Alves
2012-11-27 21:24   ` Tom Tromey
2012-12-10 20:41     ` Tom Tromey
2012-12-11  3:11       ` Joel Brobecker
2012-12-11 10:53       ` Pedro Alves
2012-12-17 19:39         ` Tom Tromey
2013-01-03 18:25       ` Tom Tromey
2013-01-03 18:42         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox