This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
[PATCH] Force rda (for unix) to exit when debugged program exits
- From: Kevin Buettner <kevinb at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: Mon, 19 Jul 2004 17:48:02 -0700
- Subject: [PATCH] Force rda (for unix) to exit when debugged program exits
- Organization: Red Hat
I've just committed the patch below. I found this patch necessary to
make RDA exit when debugging via a serial connection upon which CLOCAL
had been set. CLOCAL causes the hardware modem control signals to be
ignored. As a consequence, the serial port will always appear to
be open.
* server.c (main): Set ``server_quit_p'' when debugged process
exits or terminates.
Index: server.c
===================================================================
RCS file: /cvs/src/src/rda/unix/server.c,v
retrieving revision 1.6
diff -u -p -r1.6 server.c
--- server.c 3 Jun 2004 18:29:18 -0000 1.6
+++ server.c 20 Jul 2004 00:41:10 -0000
@@ -415,9 +415,17 @@ main (int argc, char **argv)
break;
case 'X':
gdbserver.fromtarget_terminate (process);
+ server_quit_p = 1; /* See below. */
break;
case 'W':
gdbserver.fromtarget_exit (process);
+ /* If we're connected to a serial port which is not
+ observing the modem control signals (e.g. "stty
+ clocal"), then we'll never notice that the port has
+ been closed. For this reason, when we notice that
+ the target has exited or terminated, we need to set
+ ``server_quit_p'' explicitly. */
+ server_quit_p = 1;
break;
}
}