This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: Make gdbserver use async I/O on Linux
- To: gdb-patches at sources dot redhat dot com
- Subject: PATCH: Make gdbserver use async I/O on Linux
- From: Daniel Jacobowitz <dmj+ at andrew dot cmu dot edu>
- Date: Wed, 6 Jun 2001 14:03:22 -0700
The only problem I can think of that this might cause is if F_SETOWN is less
portable than FASYNC. Apparently you need to do that explicitly on a Linux
target before SIGIO will be sent.
This lets C-c on the host be properly handled, stopping the target.
--
Daniel Jacobowitz Debian GNU/Linux Developer
Monta Vista Software Debian Security Team
--- gdb-5.0/gdb/gdbserver/remote-utils.c.orig Wed Jun 6 11:07:04 2001
+++ gdb-5.0/gdb/gdbserver/remote-utils.c Wed Jun 6 13:53:09 2001
@@ -155,6 +155,7 @@
#if defined(F_SETFL) && defined (FASYNC)
save_fcntl_flags = fcntl (remote_desc, F_GETFL, 0);
fcntl (remote_desc, F_SETFL, save_fcntl_flags | FASYNC);
+ fcntl (remote_desc, F_SETOWN, getpid());
disable_async_io ();
#endif /* FASYNC */
fprintf (stderr, "Remote debugging using %s\n", name);
--- gdb-5.0/gdb/gdbserver/low-linux.c.orig Wed Jun 6 10:53:10 2001
+++ gdb-5.0/gdb/gdbserver/low-linux.c Wed Jun 6 10:53:31 2001
@@ -132,7 +132,9 @@
int pid;
union wait w;
+ enable_async_io ();
pid = wait (&w);
+ disable_async_io ();
if (pid != inferior_pid)
perror_with_name ("wait");