Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: ensure binary objects opened in binary mode
Date: Wed, 22 Feb 2006 05:52:00 -0000	[thread overview]
Message-ID: <43FBF706.9030604@cwilson.fastmail.fm> (raw)
In-Reply-To: <umzgoga7s.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 9336 bytes --]

Eli Zaretskii wrote:
>> Date: Sat, 18 Feb 2006 12:18:58 +0100 (CET)
>> From: Mark Kettenis <mark.kettenis@xs4all.nl>
>> CC: gdb-patches@sourceware.org, cygwin@cwilson.fastmail.fm
>>
>>> Agreed.  I think defs.h is a good place, do you agree?
>>>
>> Problem is that right now defs.h doesn't include <fcntl.h> (where I
>> expect O_BINARY to be defined on systems that have it).  So we should
>> move that into fcntl.h as well
> 
> You mean, include <fcntl.h> from defs.h, right?  If so, I agree.

Okay, I've attached two patches that hopefully address all the issues 
raised in this thread.  Both are against gdb-6.4.50-20060131 but should 
apply cleanly to HEAD.  The first one is all that is *strictly* 
necessary to correct the bug:

  defs.h  |    8 ++++++++
  solib.c |   13 ++++++-------
  2 files changed, 14 insertions(+), 7 deletions(-)

ChangeLog (patch 1):

2006-02-21  Charles Wilson  <cygwin@...>

	* gdb/defs.h: unconditionally include <fcntl.h>, and
	ensure that O_BINARY is defined.
	* gdb/solib.c(solib_open): ensure solib files are opened in
	binary mode. Remove <fcntl.h>.

I believe this patch still counts as "trivial" by FSF guidelines: 4 
non-blank/non-comment line additions to defs.h and 7 non-blank line 
changes to solib.c (and six of those are identical).  However...

+++++++++++++++++++++++++++++++++++++

The second patch does the following (filenames below are relative to the 
src/gdb/ directory):

===============
(1) for every file that #includes both defs.h AND <fcntl.h>, remove the 
<fcntl.h> inclusion.  This is a one-line change to each of the following 
48 files:

auxv.c                          inflow.c            rs6000-nat.c
bsd-kvm.c                       inftarg.c           ser-pipe.c
cli/cli-cmds.c                  linux-nat.c         ser-unix.c
core-regset.c                   m68klinux-nat.c     sol-thread.c
corefile.c                      nto-procfs.c        solib-aix5.c
corelow.c                       objfiles.c          solib-sunos.c
dbxread.c                       ocd.c               source.c
dwarf2read.c                    ppc-bdm.c           symfile.c
dwarfread.c                     ppc-linux-nat.c     symtab.c
exec.c                          proc-api.c          tui/tui-hooks.c
gdbtk/generic/gdbtk-cmds.c      procfs.c            tui/tui-io.c
gdbtk/generic/gdbtk-hooks.c     remote-fileio.c     tui/tui.c
gdbtk/generic/gdbtk.c           remote-rdp.c        uw-thread.c
go32-nat.c                      remote-sds.c        win32-nat.c
hpux-thread.c                   remote-sim.c        wince.c
i386v-nat.c                     remote.c            xcoffread.c

These changes were automatically performed using the following silly 
script, executed from the src/gdb directory:

#!/bin/bash
## execute from src/gdb directory
##
(for fn in `find . -type f | xargs grep -l fcntl.h` ; do
   grep -l defs.h $fn;
done) |\
   sed -e '/ChangeLog/d' -e '/Makefile/d' -e '/configure/d' |\
   (while read LN ; do
      echo "Fixing ${LN}"
      cat "${LN}" | sed -e '/#include <fcntl.h>.*/d' > "${LN}.new"
      if [ -e "${LN}.new" ] ; then
        mv "${LN}" "${LN}.old"
        mv "${LN}.new" "${LN}"
      fi
   done)
find . -name "*.old" | xargs rm -f

===============
(2) Further, for every file that contains the #ifndef...#define 
O_BINARY...#endif stanza (all of which #include defs.h), that stanza is 
removed (3 line change to each of 5 files)

corelow.c    exec.c    remote-rdp.c    source.c    symfile.c

These changes, too, were done via the following silly script executed 
from the src/gdb directory:

#!/bin/bash
## execute from src/gdb directory.
##
## note: the line which begins with /^#ifndef should have no
## linebreaks until the $/d    Plus, in that line there is no
## whitespace between ]* and define[ 	]
## Finally, each [ 	] in that line contains a space and a tab.
for fn in corelow.c exec.c remote-rdp.c source.c symfile.c ; do
   echo "Fixing ${fn}"
   cat "${fn}" | sed -e ': more
      $!N
      s/\n/&/2;
      t enough
      $!b more
      : enough
      /^#ifndef[ 	]\+O_BINARY[ 	]*[^\n]*\n#[ 	]*
define[ 	]\+O_BINARY[ 	]*[^\n]*\n#endif[ 	]*$/d
      P;D' > "${fn}.new"
   if [ -e "${fn}.new" ] ; then
     mv "${fn}" "${fn}.old"
     mv "${fn}.new" "${fn}"
   fi
done
find . -name "*.old" | xargs rm -f

===============

My point: while the concept in the second patch is extremely simple (so 
simple that a pair of automated scripts can create it), it still ends up 
modifying 48 different files, deleting 1 (or 4) lines from each.  I'm 
not sure that the FSF guidelines permit you to accept that patch from 
me, as I do not have an assignment on file for the gdb project.  This 
second patch is trivial in concept and obvious in implementation, but 
changes a LOT more than a dozen lines.

However, I release the two scripts above to the public domain, and they 
can be used by anyone for any purpose.  Have fun.

  auxv.c                      |    1 -
  bsd-kvm.c                   |    1 -
  cli/cli-cmds.c              |    1 -
  core-regset.c               |    1 -
  corefile.c                  |    1 -
  corelow.c                   |    4 ----
  dbxread.c                   |    1 -
  dwarf2read.c                |    1 -
  dwarfread.c                 |    1 -
  exec.c                      |    4 ----
  gdbtk/generic/gdbtk-cmds.c  |    1 -
  gdbtk/generic/gdbtk-hooks.c |    1 -
  gdbtk/generic/gdbtk.c       |    1 -
  go32-nat.c                  |    1 -
  hpux-thread.c               |    1 -
  i386v-nat.c                 |    1 -
  inflow.c                    |    1 -
  inftarg.c                   |    1 -
  linux-nat.c                 |    1 -
  m68klinux-nat.c             |    1 -
  nto-procfs.c                |    1 -
  objfiles.c                  |    1 -
  ocd.c                       |    1 -
  ppc-bdm.c                   |    1 -
  ppc-linux-nat.c             |    1 -
  proc-api.c                  |    1 -
  procfs.c                    |    1 -
  remote-fileio.c             |    1 -
  remote-rdp.c                |    4 ----
  remote-sds.c                |    1 -
  remote-sim.c                |    1 -
  remote.c                    |    1 -
  rs6000-nat.c                |    1 -
  ser-pipe.c                  |    1 -
  ser-unix.c                  |    1 -
  sol-thread.c                |    1 -
  solib-aix5.c                |    1 -
  solib-sunos.c               |    1 -
  source.c                    |    4 ----
  symfile.c                   |    4 ----
  symtab.c                    |    1 -
  tui/tui-hooks.c             |    1 -
  tui/tui-io.c                |    1 -
  tui/tui.c                   |    1 -
  uw-thread.c                 |    1 -
  win32-nat.c                 |    1 -
  wince.c                     |    1 -
  xcoffread.c                 |    1 -
  48 files changed, 63 deletions(-)

2006-02-21  Charles Wilson  <cygwin@...>

	* gdb/auxv.c: Remove <fcntl.h>
	* gdb/bsd-kvm.c: Remove <fcntl.h>
	* gdb/cli/cli-cmds.c: Remove <fcntl.h>
	* gdb/core-regset.c: Remove <fcntl.h>
	* gdb/corefile.c: Remove <fcntl.h>
	* gdb/corelow.c: Remove <fcntl.h>. Remove O_BINARY
	macro definition.
	* gdb/dbxread.c: Remove <fcntl.h>
	* gdb/dwarf2read.c: Remove <fcntl.h>
	* gdb/dwarfread.c: Remove <fcntl.h>
	* gdb/exec.c: Remove <fcntl.h>. Remove O_BINARY macro
	definition
	* gdb/gdbtk/generic/gdbtk-cmds.c: Remove <fcntl.h>
	* gdb/gdbtk/generic/gdbtk-hooks.c: Remove <fcntl.h>
	* gdb/gdbtk/generic/gdbtk.c: Remove <fcntl.h>
	* gdb/go32-nat.c: Remove <fcntl.h>
	* gdb/hpux-thread.c: Remove <fcntl.h>
	* gdb/i386v-nat.c: Remove <fcntl.h>
	* gdb/inflow.c: Remove <fcntl.h>
	* gdb/inftarg.c: Remove <fcntl.h>
	* gdb/linux-nat.c: Remove <fcntl.h>
	* gdb/m68klinux-nat.c: Remove <fcntl.h>
	* gdb/nto-procfs.c: Remove <fcntl.h>
	* gdb/objfiles.c: Remove <fcntl.h>
	* gdb/ocd.c: Remove <fcntl.h>
	* gdb/ppc-bdm.c: Remove <fcntl.h>
	* gdb/ppc-linux-nat.c: Remove <fcntl.h>
	* gdb/proc-api.c: Remove <fcntl.h>
	* gdb/procfs.c: Remove <fcntl.h>
	* gdb/remote-fileio.c: Remove <fcntl.h>
	* gdb/remote-rdp.c: Remove <fcntl.h>. Remove O_BINARY
	macro definition
	* gdb/remote-sds.c: Remove <fcntl.h>
	* gdb/remote-sim.c: Remove <fcntl.h>
	* gdb/remote.c: Remove <fcntl.h>
	* gdb/rs6000-nat.c: Remove <fcntl.h>
	* gdb/ser-pipe.c: Remove <fcntl.h>
	* gdb/ser-unix.c: Remove <fcntl.h>
	* gdb/sol-thread.c: Remove <fcntl.h>
	* gdb/solib-aix5.c: Remove <fcntl.h>
	* gdb/solib-sunos.c: Remove <fcntl.h>
	* gdb/source.c: Remove <fcntl.h>. Remove O_BINARY
	macro definition
	* gdb/symfile.c: Remove <fcntl.h>. Remove O_BINARY
	macro definition
	* gdb/symtab.c: Remove <fcntl.h>
	* gdb/tui/tui-hooks.c: Remove <fcntl.h>
	* gdb/tui/tui-io.c: Remove <fcntl.h>
	* gdb/tui/tui.c: Remove <fcntl.h>
	* gdb/uw-thread.c: Remove <fcntl.h>
	* gdb/win32-nat.c: Remove <fcntl.h>
	* gdb/wince.c: Remove <fcntl.h>
	* gdb/xcoffread.c: Remove <fcntl.h>

NOTE: the following 9 files all #include <fcntl.h> but do NOT #include 
defs.h -- so I didn't (and the scripts do not) modify them.  None of 
these 9 files use the O_BINARY symbol, either.

   gdb/terminal.h
   gdb/gdbserver/gdbreplay.c
   gdb/gdbserver/linux-low.c
   gdb/gdbserver/remote-utils.c
   gdb/gdbserver/terminal.h
   gdb/testsuite/gdb.base/bigcore.c
   gdb/testsuite/gdb.base/coremaker.c
   gdb/testsuite/gdb.base/fileio.c
   gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c

--
Chuck

[-- Attachment #2: gdb-6.4.50.20060131-cvs.solib.patch-attempt2-part1 --]
[-- Type: text/plain, Size: 3190 bytes --]

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.190
diff -u -r1.190 defs.h
--- defs.h	17 Dec 2005 22:33:59 -0000	1.190
+++ defs.h	21 Feb 2006 02:08:39 -0000
@@ -39,6 +39,8 @@
 #include <unistd.h>
 #endif
 
+#include <fcntl.h>
+
 /* First include ansidecl.h so we can use the various macro definitions
    here and in all subsequent file inclusions.  */
 
@@ -58,6 +60,12 @@
 #define SEEK_CUR 1
 #endif
 
+/* In case this is not defined in fcntl.h */
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 #include <stdarg.h>		/* For va_list.  */
 
 #include "libiberty.h"
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.83
diff -u -r1.83 solib.c
--- solib.c	21 Jan 2006 22:23:27 -0000	1.83
+++ solib.c	21 Feb 2006 02:08:47 -0000
@@ -24,7 +24,6 @@
 #include "defs.h"
 
 #include <sys/types.h>
-#include <fcntl.h>
 #include "gdb_string.h"
 #include "symtab.h"
 #include "bfd.h"
@@ -171,7 +170,7 @@
 	}
 
       /* Now see if we can open it.  */
-      found_file = open (temp_pathname, O_RDONLY, 0);
+      found_file = open (temp_pathname, O_RDONLY | O_BINARY, 0);
     }
 
   /* If the search in solib_absolute_prefix failed, and the path name is
@@ -192,32 +191,32 @@
   /* If not found, search the solib_search_path (if any).  */
   if (found_file < 0 && solib_search_path != NULL)
     found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
-			in_pathname, O_RDONLY, 0, &temp_pathname);
+			in_pathname, O_RDONLY | O_BINARY, 0, &temp_pathname);
   
   /* If not found, next search the solib_search_path (if any) for the basename
      only (ignoring the path).  This is to allow reading solibs from a path
      that differs from the opened path.  */
   if (found_file < 0 && solib_search_path != NULL)
     found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
-                        lbasename (in_pathname), O_RDONLY, 0,
+                        lbasename (in_pathname), O_RDONLY | O_BINARY, 0,
                         &temp_pathname);
 
   /* If not found, try to use target supplied solib search method */
   if (found_file < 0 && ops->find_and_open_solib)
-    found_file = ops->find_and_open_solib (in_pathname, O_RDONLY,
+    found_file = ops->find_and_open_solib (in_pathname, O_RDONLY | O_BINARY,
 					   &temp_pathname);
 
   /* If not found, next search the inferior's $PATH environment variable. */
   if (found_file < 0 && solib_absolute_prefix == NULL)
     found_file = openp (get_in_environ (inferior_environ, "PATH"),
-			OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0,
+			OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
 			&temp_pathname);
 
   /* If not found, next search the inferior's $LD_LIBRARY_PATH 
      environment variable. */
   if (found_file < 0 && solib_absolute_prefix == NULL)
     found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"),
-			OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0,
+			OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
 			&temp_pathname);
 
   /* Done.  If not found, tough luck.  Return found_file and 

[-- Attachment #3: gdb-6.4.50.20060131-cvs.solib.patch-attempt2-part2 --]
[-- Type: text/plain, Size: 21856 bytes --]

Index: auxv.c
===================================================================
RCS file: /cvs/src/src/gdb/auxv.c,v
retrieving revision 1.5
diff -u -r1.5 auxv.c
--- auxv.c	17 Dec 2005 22:33:59 -0000	1.5
+++ auxv.c	21 Feb 2006 02:08:36 -0000
@@ -31,7 +31,6 @@
 #include "elf/common.h"
 
 #include <unistd.h>
-#include <fcntl.h>
 
 
 /* This function is called like a to_xfer_partial hook,
Index: bsd-kvm.c
===================================================================
RCS file: /cvs/src/src/gdb/bsd-kvm.c,v
retrieving revision 1.16
diff -u -r1.16 bsd-kvm.c
--- bsd-kvm.c	17 Dec 2005 22:33:59 -0000	1.16
+++ bsd-kvm.c	21 Feb 2006 02:08:36 -0000
@@ -29,7 +29,6 @@
 #include "gdbcore.h"		/* for get_exec_file */
 
 #include "gdb_assert.h"
-#include <fcntl.h>
 #include <kvm.h>
 #ifdef HAVE_NLIST_H
 #include <nlist.h>
Index: core-regset.c
===================================================================
RCS file: /cvs/src/src/gdb/core-regset.c,v
retrieving revision 1.12
diff -u -r1.12 core-regset.c
--- core-regset.c	17 Dec 2005 22:33:59 -0000	1.12
+++ core-regset.c	21 Feb 2006 02:08:39 -0000
@@ -35,7 +35,6 @@
 #include "inferior.h"
 #include "target.h"
 
-#include <fcntl.h>
 #include <errno.h>
 #include "gdb_string.h"
 #include <time.h>
Index: corefile.c
===================================================================
RCS file: /cvs/src/src/gdb/corefile.c,v
retrieving revision 1.37
diff -u -r1.37 corefile.c
--- corefile.c	10 Jan 2006 23:01:44 -0000	1.37
+++ corefile.c	21 Feb 2006 02:08:39 -0000
@@ -25,7 +25,6 @@
 #include "gdb_string.h"
 #include <errno.h>
 #include <signal.h>
-#include <fcntl.h>
 #include "inferior.h"
 #include "symtab.h"
 #include "command.h"
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.54
diff -u -r1.54 corelow.c
--- corelow.c	24 Jan 2006 22:34:34 -0000	1.54
+++ corelow.c	21 Feb 2006 02:08:39 -0000
@@ -26,7 +26,6 @@
 #include "gdb_string.h"
 #include <errno.h>
 #include <signal.h>
-#include <fcntl.h>
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>		/* needed for F_OK and friends */
 #endif
@@ -47,9 +46,6 @@
 #include "exceptions.h"
 #include "solib.h"
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.81
diff -u -r1.81 dbxread.c
--- dbxread.c	17 Dec 2005 22:33:59 -0000	1.81
+++ dbxread.c	21 Feb 2006 02:08:39 -0000
@@ -39,7 +39,6 @@
 
 #if defined(__CYGNUSCLIB__)
 #include <sys/types.h>
-#include <fcntl.h>
 #endif
 
 #include "gdb_obstack.h"
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.191
diff -u -r1.191 dwarf2read.c
--- dwarf2read.c	17 Jan 2006 22:30:29 -0000	1.191
+++ dwarf2read.c	21 Feb 2006 02:08:40 -0000
@@ -49,7 +49,6 @@
 #include "command.h"
 #include "gdbcmd.h"
 
-#include <fcntl.h>
 #include "gdb_string.h"
 #include "gdb_assert.h"
 #include <sys/types.h>
Index: dwarfread.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarfread.c,v
retrieving revision 1.45
diff -u -r1.45 dwarfread.c
--- dwarfread.c	17 Dec 2005 22:33:59 -0000	1.45
+++ dwarfread.c	21 Feb 2006 02:08:40 -0000
@@ -122,7 +122,6 @@
 #include "language.h"
 #include "complaints.h"
 
-#include <fcntl.h>
 #include "gdb_string.h"
 
 /* Some macros to provide DIE info for complaints. */
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.59
diff -u -r1.59 exec.c
--- exec.c	17 Dec 2005 22:33:59 -0000	1.59
+++ exec.c	21 Feb 2006 02:08:41 -0000
@@ -34,7 +34,6 @@
 #include "exec.h"
 #include "observer.h"
 
-#include <fcntl.h>
 #include "readline/readline.h"
 #include "gdb_string.h"
 
@@ -42,9 +41,6 @@
 
 #include <ctype.h>
 #include "gdb_stat.h"
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 #include "xcoffsolib.h"
 
Index: go32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/go32-nat.c,v
retrieving revision 1.48
diff -u -r1.48 go32-nat.c
--- go32-nat.c	24 Jan 2006 22:09:28 -0000	1.48
+++ go32-nat.c	21 Feb 2006 02:08:41 -0000
@@ -20,7 +20,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-#include <fcntl.h>
 
 #include "defs.h"
 #include "inferior.h"
Index: hpux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpux-thread.c,v
retrieving revision 1.32
diff -u -r1.32 hpux-thread.c
--- hpux-thread.c	17 Dec 2005 22:34:01 -0000	1.32
+++ hpux-thread.c	21 Feb 2006 02:08:41 -0000
@@ -43,7 +43,6 @@
 #include "target.h"
 #include "inferior.h"
 #include "regcache.h"
-#include <fcntl.h>
 #include <string.h>
 #include "gdb_stat.h"
 #include "gdbcore.h"
Index: i386v-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386v-nat.c,v
retrieving revision 1.16
diff -u -r1.16 i386v-nat.c
--- i386v-nat.c	17 Dec 2005 22:34:01 -0000	1.16
+++ i386v-nat.c	21 Feb 2006 02:08:41 -0000
@@ -40,7 +40,6 @@
 #include <signal.h>
 #include <sys/user.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 
 #ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
 #include <sys/debugreg.h>
Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.31
diff -u -r1.31 inflow.c
--- inflow.c	17 Dec 2005 22:34:01 -0000	1.31
+++ inflow.c	21 Feb 2006 02:08:41 -0000
@@ -31,7 +31,6 @@
 
 #include "gdb_string.h"
 #include <signal.h>
-#include <fcntl.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
Index: inftarg.c
===================================================================
RCS file: /cvs/src/src/gdb/inftarg.c,v
retrieving revision 1.47
diff -u -r1.47 inftarg.c
--- inftarg.c	24 Jan 2006 22:34:34 -0000	1.47
+++ inftarg.c	21 Feb 2006 02:08:42 -0000
@@ -33,7 +33,6 @@
 #include "gdb_stat.h"
 #include <signal.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include "gdb_wait.h"
 #include "inflow.h"
 
Index: linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.c,v
retrieving revision 1.36
diff -u -r1.36 linux-nat.c
--- linux-nat.c	4 Jan 2006 19:34:58 -0000	1.36
+++ linux-nat.c	21 Feb 2006 02:08:42 -0000
@@ -45,7 +45,6 @@
 #include <ctype.h>		/* for isdigit */
 #include "gdbthread.h"		/* for struct thread_info etc. */
 #include "gdb_stat.h"		/* for struct stat */
-#include <fcntl.h>		/* for O_RDONLY */
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
Index: m68klinux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m68klinux-nat.c,v
retrieving revision 1.30
diff -u -r1.30 m68klinux-nat.c
--- m68klinux-nat.c	17 Dec 2005 22:34:01 -0000	1.30
+++ m68klinux-nat.c	21 Feb 2006 02:08:42 -0000
@@ -38,7 +38,6 @@
 #include <sys/ptrace.h>
 #include <sys/user.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 #include <sys/procfs.h>
 
 #ifdef HAVE_SYS_REG_H
Index: nto-procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-procfs.c,v
retrieving revision 1.17
diff -u -r1.17 nto-procfs.c
--- nto-procfs.c	24 Jan 2006 22:09:28 -0000	1.17
+++ nto-procfs.c	21 Feb 2006 02:08:42 -0000
@@ -24,7 +24,6 @@
 
 #include "defs.h"
 
-#include <fcntl.h>
 #include <spawn.h>
 #include <sys/debug.h>
 #include <sys/procfs.h>
Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.63
diff -u -r1.63 objfiles.c
--- objfiles.c	6 Jan 2006 16:23:35 -0000	1.63
+++ objfiles.c	21 Feb 2006 02:08:42 -0000
@@ -37,7 +37,6 @@
 #include "gdb_assert.h"
 #include <sys/types.h>
 #include "gdb_stat.h"
-#include <fcntl.h>
 #include "gdb_obstack.h"
 #include "gdb_string.h"
 #include "hashtab.h"
Index: ocd.c
===================================================================
RCS file: /cvs/src/src/gdb/ocd.c,v
retrieving revision 1.43
diff -u -r1.43 ocd.c
--- ocd.c	24 Jan 2006 22:09:28 -0000	1.43
+++ ocd.c	21 Feb 2006 02:08:42 -0000
@@ -23,7 +23,6 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "gdb_string.h"
-#include <fcntl.h>
 #include "frame.h"
 #include "inferior.h"
 #include "bfd.h"
Index: ppc-bdm.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-bdm.c,v
retrieving revision 1.28
diff -u -r1.28 ppc-bdm.c
--- ppc-bdm.c	17 Dec 2005 22:34:01 -0000	1.28
+++ ppc-bdm.c	21 Feb 2006 02:08:42 -0000
@@ -23,7 +23,6 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "gdb_string.h"
-#include <fcntl.h>
 #include "frame.h"
 #include "inferior.h"
 #include "bfd.h"
Index: ppc-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v
retrieving revision 1.56
diff -u -r1.56 ppc-linux-nat.c
--- ppc-linux-nat.c	17 Dec 2005 22:34:01 -0000	1.56
+++ ppc-linux-nat.c	21 Feb 2006 02:08:42 -0000
@@ -36,7 +36,6 @@
 #include <sys/user.h>
 #include <sys/ioctl.h>
 #include "gdb_wait.h"
-#include <fcntl.h>
 #include <sys/procfs.h>
 #include <sys/ptrace.h>
 
Index: proc-api.c
===================================================================
RCS file: /cvs/src/src/gdb/proc-api.c,v
retrieving revision 1.25
diff -u -r1.25 proc-api.c
--- proc-api.c	17 Dec 2005 22:34:01 -0000	1.25
+++ proc-api.c	21 Feb 2006 02:08:43 -0000
@@ -45,7 +45,6 @@
 #ifdef HAVE_SYS_USER_H
 #include <sys/user.h>	/* for struct user */
 #endif
-#include <fcntl.h>	/* for O_RDWR etc. */
 #include "gdb_wait.h"
 
 #include "proc-utils.h"
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.68
diff -u -r1.68 procfs.c
--- procfs.c	24 Jan 2006 22:09:28 -0000	1.68
+++ procfs.c	21 Feb 2006 02:08:45 -0000
@@ -93,7 +93,6 @@
 #include "gdb_dirent.h"	/* opendir/readdir, for listing the LWP's */
 #endif
 
-#include <fcntl.h>	/* for O_RDONLY */
 #include <unistd.h>	/* for "X_OK" */
 #include "gdb_stat.h"	/* for struct stat */
 
Index: remote-fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-fileio.c,v
retrieving revision 1.17
diff -u -r1.17 remote-fileio.c
--- remote-fileio.c	17 Jan 2006 14:47:31 -0000	1.17
+++ remote-fileio.c	21 Feb 2006 02:08:45 -0000
@@ -31,7 +31,6 @@
 #include "exceptions.h"
 #include "remote-fileio.h"
 
-#include <fcntl.h>
 #include <sys/time.h>
 #ifdef __CYGWIN__
 #include <sys/cygwin.h>		/* For cygwin_conv_to_full_posix_path.  */
Index: remote-rdp.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdp.c,v
retrieving revision 1.47
diff -u -r1.47 remote-rdp.c
--- remote-rdp.c	24 Jan 2006 22:09:28 -0000	1.47
+++ remote-rdp.c	21 Feb 2006 02:08:45 -0000
@@ -44,7 +44,6 @@
 #include "gdb/callback.h"
 #include "command.h"
 #include <ctype.h>
-#include <fcntl.h>
 #include "symfile.h"
 #include "remote-utils.h"
 #include "gdb_string.h"
@@ -791,9 +790,6 @@
 #define SWI_GenerateError               0x71
 
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 static int translate_open_mode[] =
 {
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.42
diff -u -r1.42 remote-sds.c
--- remote-sds.c	24 Jan 2006 22:09:28 -0000	1.42
+++ remote-sds.c	21 Feb 2006 02:08:45 -0000
@@ -27,7 +27,6 @@
 
 #include "defs.h"
 #include "gdb_string.h"
-#include <fcntl.h>
 #include "frame.h"
 #include "inferior.h"
 #include "exceptions.h"
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.52
diff -u -r1.52 remote-sim.c
--- remote-sim.c	24 Jan 2006 22:09:28 -0000	1.52
+++ remote-sim.c	21 Feb 2006 02:08:45 -0000
@@ -28,7 +28,6 @@
 #include "value.h"
 #include "gdb_string.h"
 #include <ctype.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <setjmp.h>
 #include <errno.h>
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.200
diff -u -r1.200 remote.c
--- remote.c	24 Jan 2006 22:34:34 -0000	1.200
+++ remote.c	21 Feb 2006 02:08:45 -0000
@@ -26,7 +26,6 @@
 #include "defs.h"
 #include "gdb_string.h"
 #include <ctype.h>
-#include <fcntl.h>
 #include "inferior.h"
 #include "bfd.h"
 #include "symfile.h"
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.60
diff -u -r1.60 rs6000-nat.c
--- rs6000-nat.c	17 Dec 2005 22:34:02 -0000	1.60
+++ rs6000-nat.c	21 Feb 2006 02:08:46 -0000
@@ -45,7 +45,6 @@
 #include <sys/user.h>
 #include <signal.h>
 #include <sys/ioctl.h>
-#include <fcntl.h>
 #include <errno.h>
 
 #include <a.out.h>
Index: ser-pipe.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-pipe.c,v
retrieving revision 1.17
diff -u -r1.17 ser-pipe.c
--- ser-pipe.c	17 Dec 2005 22:34:02 -0000	1.17
+++ ser-pipe.c	21 Feb 2006 02:08:46 -0000
@@ -30,7 +30,6 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
-#include <fcntl.h>
 #include "gdb_string.h"
 
 #include <signal.h>
Index: ser-unix.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-unix.c,v
retrieving revision 1.26
diff -u -r1.26 ser-unix.c
--- ser-unix.c	17 Dec 2005 22:34:02 -0000	1.26
+++ ser-unix.c	21 Feb 2006 02:08:46 -0000
@@ -25,7 +25,6 @@
 #include "ser-base.h"
 #include "ser-unix.h"
 
-#include <fcntl.h>
 #include <sys/types.h>
 #include "terminal.h"
 #include <sys/socket.h>
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.51
diff -u -r1.51 sol-thread.c
--- sol-thread.c	17 Dec 2005 22:34:02 -0000	1.51
+++ sol-thread.c	21 Feb 2006 02:08:46 -0000
@@ -58,7 +58,6 @@
 #include "gdbthread.h"
 #include "target.h"
 #include "inferior.h"
-#include <fcntl.h>
 #include "gdb_stat.h"
 #include <dlfcn.h>
 #include "gdbcmd.h"
Index: solib-aix5.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-aix5.c,v
retrieving revision 1.18
diff -u -r1.18 solib-aix5.c
--- solib-aix5.c	17 Dec 2005 22:34:02 -0000	1.18
+++ solib-aix5.c	21 Feb 2006 02:08:46 -0000
@@ -26,7 +26,6 @@
 #include <signal.h>
 #include "gdb_string.h"
 #include <sys/param.h>
-#include <fcntl.h>
 #include <sys/procfs.h>
 
 #include "elf/external.h"
Index: solib-sunos.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-sunos.c,v
retrieving revision 1.20
diff -u -r1.20 solib-sunos.c
--- solib-sunos.c	17 Dec 2005 22:34:02 -0000	1.20
+++ solib-sunos.c	21 Feb 2006 02:08:46 -0000
@@ -26,7 +26,6 @@
 #include <signal.h>
 #include "gdb_string.h"
 #include <sys/param.h>
-#include <fcntl.h>
 
 /* SunOS shared libs need the nlist structure.  */
 #include <a.out.h>
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.72
diff -u -r1.72 source.c
--- source.c	15 Jan 2006 19:09:30 -0000	1.72
+++ source.c	21 Feb 2006 02:08:47 -0000
@@ -33,7 +33,6 @@
 #include <sys/types.h>
 #include "gdb_string.h"
 #include "gdb_stat.h"
-#include <fcntl.h>
 #include "gdbcore.h"
 #include "gdb_regex.h"
 #include "symfile.h"
@@ -46,9 +45,6 @@
 #include "ui-out.h"
 #include "readline/readline.h"
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.165
diff -u -r1.165 symfile.c
--- symfile.c	15 Jan 2006 19:50:03 -0000	1.165
+++ symfile.c	21 Feb 2006 02:08:47 -0000
@@ -53,16 +53,12 @@
 #include "exec.h"
 
 #include <sys/types.h>
-#include <fcntl.h>
 #include "gdb_string.h"
 #include "gdb_stat.h"
 #include <ctype.h>
 #include <time.h>
 #include <sys/time.h>
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
 void (*deprecated_show_load_progress) (const char *section,
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.146
diff -u -r1.146 symtab.c
--- symtab.c	17 Dec 2005 22:34:03 -0000	1.146
+++ symtab.c	21 Feb 2006 02:08:48 -0000
@@ -50,7 +50,6 @@
 #include "dictionary.h"
 
 #include <sys/types.h>
-#include <fcntl.h>
 #include "gdb_string.h"
 #include "gdb_stat.h"
 #include <ctype.h>
Index: uw-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/uw-thread.c,v
retrieving revision 1.14
diff -u -r1.14 uw-thread.c
--- uw-thread.c	17 Dec 2005 22:34:03 -0000	1.14
+++ uw-thread.c	21 Feb 2006 02:08:48 -0000
@@ -102,7 +102,6 @@
 #include "target.h"
 #include "inferior.h"
 #include "regcache.h"
-#include <fcntl.h>
 
 /* <thread.h> includes <sys/priocntl.h>, which requires boolean_t from
    <sys/types.h>, which doesn't typedef boolean_t with gcc.  */
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.119
diff -u -r1.119 win32-nat.c
--- win32-nat.c	24 Jan 2006 22:09:28 -0000	1.119
+++ win32-nat.c	21 Feb 2006 02:08:48 -0000
@@ -39,7 +39,6 @@
 #include "top.h"
 #include <signal.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <stdlib.h>
 #include <windows.h>
 #include <imagehlp.h>
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.44
diff -u -r1.44 wince.c
--- wince.c	24 Jan 2006 22:09:28 -0000	1.44
+++ wince.c	21 Feb 2006 02:08:48 -0000
@@ -39,7 +39,6 @@
 #include "command.h"
 #include <signal.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <stdlib.h>
 
 #include <windows.h>
Index: xcoffread.c
===================================================================
RCS file: /cvs/src/src/gdb/xcoffread.c,v
retrieving revision 1.48
diff -u -r1.48 xcoffread.c
--- xcoffread.c	2 Jan 2006 04:31:57 -0000	1.48
+++ xcoffread.c	21 Feb 2006 02:08:49 -0000
@@ -26,7 +26,6 @@
 #include "bfd.h"
 
 #include <sys/types.h>
-#include <fcntl.h>
 #include <ctype.h>
 #include "gdb_string.h"
 
Index: cli/cli-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
retrieving revision 1.64
diff -u -r1.64 cli-cmds.c
--- cli/cli-cmds.c	23 Jan 2006 16:28:37 -0000	1.64
+++ cli/cli-cmds.c	21 Feb 2006 02:08:51 -0000
@@ -51,7 +51,6 @@
 #include "tui/tui.h"		/* For tui_active et.al.   */
 #endif
 
-#include <fcntl.h>
 
 /* Prototypes for local command functions */
 
Index: gdbtk/generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.91
diff -u -r1.91 gdbtk-cmds.c
--- gdbtk/generic/gdbtk-cmds.c	23 Dec 2005 18:23:15 -0000	1.91
+++ gdbtk/generic/gdbtk-cmds.c	21 Feb 2006 02:08:55 -0000
@@ -55,7 +55,6 @@
 #include "gdbtk-cmds.h"
 
 #include <signal.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/stat.h>
Index: gdbtk/generic/gdbtk-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v
retrieving revision 1.41
diff -u -r1.41 gdbtk-hooks.c
--- gdbtk/generic/gdbtk-hooks.c	23 Dec 2005 18:23:16 -0000	1.41
+++ gdbtk/generic/gdbtk-hooks.c	21 Feb 2006 02:08:55 -0000
@@ -50,7 +50,6 @@
 #include "gdbtk.h"
 
 #include <signal.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 
Index: gdbtk/generic/gdbtk.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.44
diff -u -r1.44 gdbtk.c
--- gdbtk/generic/gdbtk.c	23 Dec 2005 18:23:16 -0000	1.44
+++ gdbtk/generic/gdbtk.c	21 Feb 2006 02:08:55 -0000
@@ -47,7 +47,6 @@
 #include "guitcl.h"
 #include "gdbtk.h"
 
-#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
Index: tui/tui-hooks.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-hooks.c,v
retrieving revision 1.26
diff -u -r1.26 tui-hooks.c
--- tui/tui-hooks.c	23 Dec 2005 19:10:02 -0000	1.26
+++ tui/tui-hooks.c	21 Feb 2006 02:09:11 -0000
@@ -36,7 +36,6 @@
 #include "ui-out.h"
 #include "top.h"
 #include <unistd.h>
-#include <fcntl.h>
 
 #include "tui/tui.h"
 #include "tui/tui-hooks.h"
Index: tui/tui-io.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-io.c,v
retrieving revision 1.13
diff -u -r1.13 tui-io.c
--- tui/tui-io.c	23 Dec 2005 19:10:02 -0000	1.13
+++ tui/tui-io.c	21 Feb 2006 02:09:12 -0000
@@ -37,7 +37,6 @@
 #include "tui/tui-file.h"
 #include "ui-out.h"
 #include "cli-out.h"
-#include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
 
Index: tui/tui.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.c,v
retrieving revision 1.55
diff -u -r1.55 tui.c
--- tui/tui.c	23 Dec 2005 19:10:03 -0000	1.55
+++ tui/tui.c	21 Feb 2006 02:09:12 -0000
@@ -45,7 +45,6 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <signal.h>
-#include <fcntl.h>
 #if 0
 #include <termio.h>
 #endif

  parent reply	other threads:[~2006-02-22  5:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 22:02 Charles Wilson
2006-02-17 23:41 ` Christopher Faylor
2006-02-18 10:45   ` Eli Zaretskii
2006-02-18 11:19     ` Mark Kettenis
2006-02-18 11:47       ` Eli Zaretskii
2006-02-18 11:55         ` Mark Kettenis
2006-02-22  5:52         ` Charles Wilson [this message]
2006-02-22 17:06           ` Christopher Faylor
2006-02-22 18:50           ` Eli Zaretskii
2006-02-22 21:55             ` Daniel Jacobowitz
2006-02-24 10:37               ` Charles Wilson
2006-02-24 11:44                 ` Eli Zaretskii
2006-02-25  7:29                   ` Charles Wilson
2006-03-01 22:11             ` Michael Snyder
2006-02-18 10:50 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43FBF706.9030604@cwilson.fastmail.fm \
    --to=cygwin@cwilson.fastmail.fm \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox