This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[9/10] RFC: remove gdb_stat.h
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 15 Nov 2012 12:32:51 -0700
- Subject: [9/10] RFC: remove gdb_stat.h
- References: <87obiyzns7.fsf@fleche.redhat.com>
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