Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [mingw32] stdin redirection
@ 2007-04-11 13:42 Jerome Guitton
  2007-04-11 14:45 ` Daniel Jacobowitz
  0 siblings, 1 reply; 24+ messages in thread
From: Jerome Guitton @ 2007-04-11 13:42 UTC (permalink / raw)
  To: gdb

Hi all,

We noticed that a migw32-hosted GDB would freeze if commands are sent
through stdin (e.g. gdb < send.gdb).

It appears that it keeps waiting on WaitForMultipleObjects, in
gdb_select.

We also noticed that this bug only happens if a call to PeekNamedPipe
(in fd_is_pipe, in ser-mingw.c), with the file descriptor of stdin In
this particular case, this call always return 0; so we have added the
following kludge in our sources, to "fix" this issue:


Index: ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.8
diff -u -r1.8 ser-mingw.c
--- ser-mingw.c	8 Apr 2007 15:20:07 -0000	1.8
+++ ser-mingw.c	11 Apr 2007 12:58:04 -0000
@@ -447,6 +447,7 @@
 static int
 fd_is_pipe (int fd)
 {
+  return 0;
   if (PeekNamedPipe ((HANDLE) _get_osfhandle (fd), NULL, 0, NULL, NULL, NULL))
     return 1;
   else

...and, with this patch, the problem does not appear anymore.

So: apparently, using PeekNamedPipe on a fd which is not a pipe makes
the debugger freeze on WaitForMultipleObjects. Is it a known problem?
Would anyone know how to implement fd_is_pipe in such a way that we
would avoid this "limitation"? I have not seen anything promising in
the MSDN so far (the other functions to deal with pipes bring about
the same behavior).


Thanks,
Jérôme



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

end of thread, other threads:[~2007-04-13 11:47 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-11 13:42 [mingw32] stdin redirection Jerome Guitton
2007-04-11 14:45 ` Daniel Jacobowitz
2007-04-11 14:51   ` Jerome Guitton
2007-04-11 15:12     ` Daniel Jacobowitz
2007-04-12 14:56       ` Joel Brobecker
2007-04-12 15:01         ` Dave Korn
2007-04-12 15:04         ` Dave Korn
     [not found]           ` <20070412155422.GI3886@adacore.com>
2007-04-12 15:58             ` Dave Korn
2007-04-12 16:06               ` Joel Brobecker
2007-04-12 16:09                 ` Dave Korn
2007-04-12 15:12         ` Daniel Jacobowitz
2007-04-12 15:51           ` Joel Brobecker
2007-04-12 16:02             ` Daniel Jacobowitz
2007-04-12 16:04             ` Daniel Jacobowitz
2007-04-12 16:29               ` Joel Brobecker
2007-04-12 18:23                 ` Daniel Jacobowitz
2007-04-12 18:56                   ` Daniel Jacobowitz
2007-04-13  9:07                     ` Joel Brobecker
2007-04-12 16:46           ` Joel Brobecker
2007-04-12 17:25             ` Dave Korn
2007-04-13 11:47               ` Jerome Guitton
2007-04-12 19:33             ` Eli Zaretskii
2007-04-12 19:37               ` Mark Kettenis
2007-04-12 19:51               ` Daniel Jacobowitz

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