This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: propagate gdb host keyboard interrupts through gdbserver


>>>>> "Greg" == Greg McGary <greg@mcgary.org> writes:
Greg> Ctrl-C on the gdb host had no effect on the inferior running on
Greg> gdbserver (at least for TCP/IP transport, though I expect serial
Greg> fails identically).

Greg> 2000-11-22  Greg McGary  <greg@mcgary.org>
Greg>
Greg> 	* remote-utils.c (remote_open): Set gdbserver as "owner" of SIGIO.
Greg> 	(input_interrupt): Don't block on read, in case we got redundant SIGIO.
Greg> 	Don't gripe about redundant SIGIO.
Greg> 	* low-linux.c (mywait): Use waitpid.  Enable SIGIO handler while 
Greg>     waiting.
Greg> 	* low-hppabsd.c (mywait): Likewise.
Greg> 	* low-nbsd.c (mywait): Likewise.
Greg> 	* low-sparc.c (mywait): Likewise.

While it appears that Stan is gdbserver maintainer, I'll add my two
cents.

The change to use fcntl(fd, F_SETOWN, getpid()) seems right to me.
I've looked at a few programs that use SIGIO (including gdb itself)
and the NetBSD and Linux manpages, and all say that the descriptor
must be set to receive SIGIO.

While we'd hope that we wouldn't get multiple SIGIO's for a single
character, you mentioned (in private) that you did.  I see that in
gdb's inflow.c:handle_sigio a select() is also used, presumably to
handle supurious SIGIOs.  I noticed that code uses a NULL ptr for the
timeout argument instead of constructing a zeroed timeval.  I'd go 
for the NULL ptr approach instead of the timeval.  It avoids problems
with those systems that don't have sys/time.h.

This change introduces select().  The only currently supported target
I have doubts about this is LynxOS.  AFAIK, support for LynxOS targets
are in a maintenance void.  Perhaps we can just do this, and fix it up
if it breaks if/when someone notices?

This change also introduces including "unistd.h".  I suspect this will
fail on SunOS 4.  Now that the gdbserver directory has been converted
to autoconf, we could add a AC_CHECK_HEADER(unistd.h) for this.

This change changes wait() to waitpid().  I think this is fine for
NetBSD and Linux.  It may break older HPUX.  And I think it breaks
SunOS 4.

Stan, it's now up to you...

        --jtc

-- 
J.T. Conklin
RedBack Networks

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]