From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Faylor To: cygwin@cygwin.com, gdb@sources.redhat.com Subject: Re: gdb run < file Date: Fri, 29 Jun 2001 13:53:00 -0000 Message-id: <20010629165352.B8545@redhat.com> References: <20010626.234402.21347360.Takaaki.Ota@am.sony.com> <20010627025036.B20160@redhat.com> <20010627.235700.01365880.Takaaki.Ota@am.sony.com> <20010628220602.A3596@redhat.com> <2427-Fri29Jun2001101154+0300-eliz@is.elta.co.il> X-SW-Source: 2001-06/msg00247.html On Fri, Jun 29, 2001 at 10:11:54AM +0300, Eli Zaretskii wrote: >> Date: Thu, 28 Jun 2001 22:06:02 -0400 >> From: Christopher Faylor >> >> I'm sorry but I don't think that this is the correct way to deal with >> this. I think that gdb normally handles things like redirection and >> globbing by starting inferior processes via the user's shell. Then it >> uses some kind of "follow fork" method to notice when the process is >> finally started. > >I don't know anything about Windows debugging interface, but it might >be that putting a shell between the debugger and the debuggee breaks >something. > >Going through the shell also has the limitation that you buy whatever >idiosyncrasies there are in that shell. Unlike on Unix, where the >redirection behavior is quite similar between the shells, on Windows >there's a very wide disagreement. (We are fed up with that nuisance >in the Emacs-land.) So I think there's a lot of sense in having a >unified, predictable redirection support inside GDB that doesn't >depend on the queer shell the user happens to have. Since Cygwin is supposed to emulate Windows, there shouldn't be much difference between the way UNIX does it and the way Cygwin does it. All of the shells come from UNIX, anyway. So, if this is an issue then it must be an issue for UNIX as well. >FWIW, the DJGPP port of GDB does something very similar to the patch >we discuss here (except that it also has to flip redirections every >time the execution thread jumps from the debugger to the debuggee). >See go32-nat.c (the actual implementation of the redirection routines >is in the DJGPP debug support library). win32-nat.c already has a lot of gratutitous differences with the rest of the "Unix" code in gdb. I want to be moving in the direction of making the cygwin parts more unix-like. So, I would rather that the redirection follow UNIX rather than attempting to reimplement the already implemented. This is, of course, a problem for running a windows-only version of gdb but I don't know of anyone currently working on that. Maybe we need a separate option for when a complete cygwin system isn't installed. However, that would be secondary to getting something working with /bin/sh or whatever. cgf