Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA] defs.h _WIN32 defined by Win98, too
       [not found] <Pine.GSO.4.33.0107311445130.28966-100000@makita.cygnus.com>
@ 2001-08-01  1:49 ` Eli Zaretskii
  2001-08-01  7:48   ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2001-08-01  1:49 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

On Tue, 31 Jul 2001, Keith Seitz wrote:

> As a result of this change:
> 
> 2001-06-13  Eli Zaretskii  <eliz@is.elta.co.il>
> 
>         * config/i386/xm-go32.h (SLASH_P, ROOTED_P, SLASH_CHAR)
>         (SLASH_STRING): Remove unised definitions.
>         * config/i386/xm-cygwin.h: Likewise.
> 
> Win98 no longer works under cygwin:
> 
> (gdb) file gdb.exe
> Loading symbols from gdb.exe...done
> (gdb) run
> `/home/keiths/sources/insight/gdb\gdb.exe' has disappeared; keeping its
> symbols.
> 
> Starting program: /home/keiths/sources/insight/gdb\gdb.exe
> Error creating process /home/keiths/sources/insight/gdb\gdb.exe (error 2)
> [often crashes here]
> 
> Apparently, Win98 defines _WIN32 somewhere...

So perhaps there's a bug in Cygwin ;-)

Anyway, didn't Chris say that _WIN32 should be removed from GDB
everywhere?  If that's so, the ifdef _WIN32 should be simply deleted,
instead of lumping more ifdefs on top of it.  For SLASH_STRING in
particular, this shouldn't be a problem at all, since Windows supports
forward slashes as well as backslashes, even if GDB is built with MS 
run-time DLLs.


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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-01  1:49 ` [RFA] defs.h _WIN32 defined by Win98, too Eli Zaretskii
@ 2001-08-01  7:48   ` Keith Seitz
  2001-08-01  8:23     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2001-08-01  7:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Wed, 1 Aug 2001, Eli Zaretskii wrote:

> > Win98 no longer works under cygwin:
> >
> > (gdb) file gdb.exe
> > Loading symbols from gdb.exe...done
> > (gdb) run
> > `/home/keiths/sources/insight/gdb\gdb.exe' has disappeared; keeping its
> > symbols.
> >
> > Starting program: /home/keiths/sources/insight/gdb\gdb.exe
> > Error creating process /home/keiths/sources/insight/gdb\gdb.exe (error 2)
> > [often crashes here]
> >
> > Apparently, Win98 defines _WIN32 somewhere...
>
> So perhaps there's a bug in Cygwin ;-)

Nope. Works fine on Win2000 using EXACTLY the same environment.

> Anyway, didn't Chris say that _WIN32 should be removed from GDB
> everywhere?  If that's so, the ifdef _WIN32 should be simply deleted,
> instead of lumping more ifdefs on top of it.  For SLASH_STRING in
> particular, this shouldn't be a problem at all, since Windows supports
> forward slashes as well as backslashes, even if GDB is built with MS
> run-time DLLs.

Windows does NOT support both forward and backward slashes in this
context. Or perhaps more correctly, cygwin does not support both. I don't
know (and frankly don't care) who is to blame. Gdb doesn't work on Win98.

As for eliminating SLASH_STRING, well, that's a much bigger and riskier
change than the simple, pragmatic approach I've taken. However, if people
want me to just assume that SLASH_STRING is "/", I'm more than happy to
whack all the bits with SLASH_STRING in them (defs.h, cli/cli-cmds.c,
defs.h, and source.c).

Just let me know, and it shall be done! I appreciate the expediant reply.
Keith




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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-01  7:48   ` Keith Seitz
@ 2001-08-01  8:23     ` Eli Zaretskii
  2001-08-01  8:32       ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2001-08-01  8:23 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

On Wed, 1 Aug 2001, Keith Seitz wrote:

> > > `/home/keiths/sources/insight/gdb\gdb.exe' has disappeared; keeping its
> > > symbols.
> > >
> > > Starting program: /home/keiths/sources/insight/gdb\gdb.exe
> > > Error creating process /home/keiths/sources/insight/gdb\gdb.exe (error 2)
> > > [often crashes here]
> > >
> > > Apparently, Win98 defines _WIN32 somewhere...
> >
> > So perhaps there's a bug in Cygwin ;-)
> 
> Nope. Works fine on Win2000 using EXACTLY the same environment.

So you are saying that the same version of Cygwin defines _WIN32 on 
Windows 98, but not on W2K?  isn't that strange?

> > Anyway, didn't Chris say that _WIN32 should be removed from GDB
> > everywhere?  If that's so, the ifdef _WIN32 should be simply deleted,
> > instead of lumping more ifdefs on top of it.  For SLASH_STRING in
> > particular, this shouldn't be a problem at all, since Windows supports
> > forward slashes as well as backslashes, even if GDB is built with MS
> > run-time DLLs.
> 
> Windows does NOT support both forward and backward slashes in this
> context. Or perhaps more correctly, cygwin does not support both.

My analysis of the problem is different; it goes like this:

  - somehow, _WIN32 got defined on Windows 98;

  - because _WIN32 is defined, GDB is compiled so as to use the
    backslash as a directory separator in file names;

  - GDB then constructs file names with a backslash, and gets 
    /home/keiths/sources/insight/gdb\gdb.exe instead of the normal 
    /home/keiths/sources/insight/gdb/gdb.exe (see the file source.c);

  - the backslash confuses Cygwin library functions which manipulate file 
    names, probably because it doesn't grok backslashes.

> I don't
> know (and frankly don't care) who is to blame. Gdb doesn't work on Win98.

I don't argue with facts; it's clear that something breaks GDB.  But I 
think we need to understand why does _WIN32 get defined on some systems, 
but not on others.

> As for eliminating SLASH_STRING, well, that's a much bigger and riskier
> change than the simple, pragmatic approach I've taken.

I didn't say eliminate SLASH_STRING, I said eliminate _WIN32.  That is, 
make SLASH_STRING always be "/", but don't replace it with a literal "/".


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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-01  8:23     ` Eli Zaretskii
@ 2001-08-01  8:32       ` Keith Seitz
  2001-08-01  8:39         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2001-08-01  8:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Wed, 1 Aug 2001, Eli Zaretskii wrote:

> So you are saying that the same version of Cygwin defines _WIN32 on
> Windows 98, but not on W2K?  isn't that strange?

Ah. I see what you're driving at. Hmmm... Ok, it certainly appears that
_WIN32 is being defined by cygwin. Nonetheless, we'll need to tweak gdb
until cygwin is fixed. (And I think we all agree about that.)

> > I don't
> > know (and frankly don't care) who is to blame. Gdb doesn't work on Win98.
>
> I don't argue with facts; it's clear that something breaks GDB.  But I
> think we need to understand why does _WIN32 get defined on some systems,
> but not on others.

I admit, I admire your enthusiasm for this sort of thing, but I have
resigned myself not to linger on about cases where Win98/95 differs from
WinNT/2000. We could be hitting some whacko WIN32 API "feature". I admit
that I am very lame in this regard. I have wasted weeks trying to sort
messes out like this before.

> > As for eliminating SLASH_STRING, well, that's a much bigger and riskier
> > change than the simple, pragmatic approach I've taken.
>
> I didn't say eliminate SLASH_STRING, I said eliminate _WIN32.  That is,
> make SLASH_STRING always be "/", but don't replace it with a literal "/".

Oh, ok, I see: just in case it is needed again, I suppose. That certainly
makes me a bit more comfortable than what I (mistakenly) thought you were
proposing.

In that case, I offer this alternative approach:

ChangeLog
2001-08-01  Keith Seitz  <keiths@redhat.com>

	* defs.h (SLASH_STRING): If not defined, set
	to "/", regardless of _WIN32, __CYGWIN__, or
	whatnot.

Patch
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.57
diff -u -p -r1.57 defs.h
--- defs.h	2001/07/07 17:19:50	1.57
+++ defs.h	2001/08/01 15:32:06
@@ -1408,11 +1408,7 @@ extern int use_windows;
 #endif

 #ifndef SLASH_STRING
-#ifdef _WIN32
-#define SLASH_STRING "\\"
-#else
 #define SLASH_STRING "/"
-#endif
 #endif

 /* Provide default definitions of PIDGET, TIDGET, and MERGEPID.

(Just wait until you see my next patch to fix gdb on win98! ;-)
Keith



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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-01  8:32       ` Keith Seitz
@ 2001-08-01  8:39         ` Eli Zaretskii
  2001-08-02 13:40           ` Christopher Faylor
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2001-08-01  8:39 UTC (permalink / raw)
  To: Keith Seitz; +Cc: gdb-patches

On Wed, 1 Aug 2001, Keith Seitz wrote:

> In that case, I offer this alternative approach:
> 
> ChangeLog
> 2001-08-01  Keith Seitz  <keiths@redhat.com>
> 
> 	* defs.h (SLASH_STRING): If not defined, set
> 	to "/", regardless of _WIN32, __CYGWIN__, or
> 	whatnot.

This should be fine, I think, but Chris should have the definitive word.


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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-01  8:39         ` Eli Zaretskii
@ 2001-08-02 13:40           ` Christopher Faylor
  2001-08-02 13:57             ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Christopher Faylor @ 2001-08-02 13:40 UTC (permalink / raw)
  To: gdb-patches

On Wed, Aug 01, 2001 at 06:40:19PM +0300, Eli Zaretskii wrote:
>
>On Wed, 1 Aug 2001, Keith Seitz wrote:
>
>> In that case, I offer this alternative approach:
>> 
>> ChangeLog
>> 2001-08-01  Keith Seitz  <keiths@redhat.com>
>> 
>> 	* defs.h (SLASH_STRING): If not defined, set
>> 	to "/", regardless of _WIN32, __CYGWIN__, or
>> 	whatnot.
>
>This should be fine, I think, but Chris should have the definitive word.

This looks fine to me, too.

Please check it in.

cgf


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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-02 13:40           ` Christopher Faylor
@ 2001-08-02 13:57             ` Keith Seitz
  2001-08-02 14:11               ` Andrew Cagney
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2001-08-02 13:57 UTC (permalink / raw)
  To: Christopher Faylor; +Cc: gdb-patches

On Thu, 2 Aug 2001, Christopher Faylor wrote:

> >> ChangeLog
> >> 2001-08-01  Keith Seitz  <keiths@redhat.com>
> >>
> >> 	* defs.h (SLASH_STRING): If not defined, set
> >> 	to "/", regardless of _WIN32, __CYGWIN__, or
> >> 	whatnot.
> >
> >This should be fine, I think, but Chris should have the definitive word.
>
> This looks fine to me, too.
>
> Please check it in.

Done. FYI officially:

2001-08-02  Keith Seitz  <keiths@redhat.com>

	* defs.h (SLASH_STRING): If not defined, set
	to "/", regardless of _WIN32, __CYGWIN__, or
	whatnot.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.61
diff -u -p -r1.61 defs.h
--- defs.h	2001/08/01 18:39:23	1.61
+++ defs.h	2001/08/02 20:53:47
@@ -1338,11 +1338,7 @@ extern int use_windows;
 #endif

 #ifndef SLASH_STRING
-#ifdef _WIN32
-#define SLASH_STRING "\\"
-#else
 #define SLASH_STRING "/"
-#endif
 #endif

 #ifdef __MSDOS__




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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-02 13:57             ` Keith Seitz
@ 2001-08-02 14:11               ` Andrew Cagney
  2001-08-02 14:37                 ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-08-02 14:11 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Christopher Faylor, gdb-patches

>>
>> This looks fine to me, too.
>>
>> Please check it in.
> 
> 
> Done. FYI officially:
> 
> 2001-08-02  Keith Seitz  <keiths@redhat.com>
> 
> * defs.h (SLASH_STRING): If not defined, set
> 	to "/", regardless of _WIN32, __CYGWIN__, or
> 	whatnot.


Keith, can you also hit the 5.1 branch with this one?

	Andrew




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

* Re: [RFA] defs.h _WIN32 defined by Win98, too
  2001-08-02 14:11               ` Andrew Cagney
@ 2001-08-02 14:37                 ` Keith Seitz
  0 siblings, 0 replies; 9+ messages in thread
From: Keith Seitz @ 2001-08-02 14:37 UTC (permalink / raw)
  To: gdb-patches

On Thu, 2 Aug 2001, Andrew Cagney wrote:

> Keith, can you also hit the 5.1 branch with this one?

Done.

Keith



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

end of thread, other threads:[~2001-08-02 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.GSO.4.33.0107311445130.28966-100000@makita.cygnus.com>
2001-08-01  1:49 ` [RFA] defs.h _WIN32 defined by Win98, too Eli Zaretskii
2001-08-01  7:48   ` Keith Seitz
2001-08-01  8:23     ` Eli Zaretskii
2001-08-01  8:32       ` Keith Seitz
2001-08-01  8:39         ` Eli Zaretskii
2001-08-02 13:40           ` Christopher Faylor
2001-08-02 13:57             ` Keith Seitz
2001-08-02 14:11               ` Andrew Cagney
2001-08-02 14:37                 ` Keith Seitz

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