From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4290 invoked by alias); 20 Jul 2004 00:48:10 -0000 Mailing-List: contact rda-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sources.redhat.com Received: (qmail 4264 invoked from network); 20 Jul 2004 00:48:08 -0000 Date: Tue, 20 Jul 2004 00:48:00 -0000 From: Kevin Buettner To: rda@sources.redhat.com Subject: [PATCH] Force rda (for unix) to exit when debugged program exits Message-Id: <20040719174802.3820027f@saguaro> Organization: Red Hat X-Mailer: Sylpheed version 0.9.8claws30 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-q3/txt/msg00011.txt.bz2 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; } }