From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26892 invoked by alias); 4 Dec 2006 12:17:07 -0000 Received: (qmail 26883 invoked by uid 22791); 4 Dec 2006 12:17:06 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 04 Dec 2006 12:16:56 +0000 Received: from fra-out-03.spheriq.net (fra-out-03.spheriq.net [195.46.51.131]) by fra-del-04.spheriq.net with ESMTP id kB4CGpjZ031723 for ; Mon, 4 Dec 2006 12:16:51 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-03.spheriq.net with ESMTP id kB4CGpjr019396 for ; Mon, 4 Dec 2006 12:16:51 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id kB4CGmRd031168 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 4 Dec 2006 12:16:50 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DEA79DC8D for ; Mon, 4 Dec 2006 12:01:46 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1905147328 for ; Mon, 4 Dec 2006 12:01:45 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CIG87611 (AUTH stubbsa); Mon, 4 Dec 2006 12:01:44 GMT Message-ID: <45740E27.6000907@st.com> Date: Mon, 04 Dec 2006 12:17:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: GDB Patches Subject: Re: [PATCH] Ctrl-D References: <456ED831.6000308@st.com> In-Reply-To: <456ED831.6000308@st.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00023.txt.bz2 Any chance of getting this nice-to-have into 6.6? I'm away from Friday onwards. Andrew STUBBS wrote: > Hi, > > In response to the recent discussion of Ctrl-D behaviour on the GDB > list, here is a patch which attempts to address the issues identified. > > This example shows two presses of Crtl-D: > > Old behaviour: > > (gdb) The program is running. Exit anyway? (y or n) bash$ > > New behaviour: > > (gdb) quit > The program is running. Exit anyway? (y or n) Y > bash$ > > > In addition to these cosmetic changes, in have adjusted the code such > that hook-quit will work, as will trace-commands: > > (gdb) define hook-quit > Type commands for definition of "hook-quit". > End with a line saying just "end". > >set confirm 0 > >end > (gdb) set trace-commands on > (gdb) quit > +quit > ++set confirm 0 > bash$ > > > :ADDPATCH CLI: > > Andrew Stubbs > > > ------------------------------------------------------------------------ > > 2006-11-30 Andrew Stubbs > > * event-top.c (command_handler): On EOF, print 'quit' and run quit > command via execute_command such that hooks and trace work. > * utils.c (defaulted_query): On EOF, print default answer and newline. > > Index: src/gdb/event-top.c > =================================================================== > --- src.orig/gdb/event-top.c 2006-07-21 15:46:53.000000000 +0100 > +++ src/gdb/event-top.c 2006-11-30 12:51:46.000000000 +0000 > @@ -501,7 +501,10 @@ command_handler (char *command) > but GDB is still alive. In such a case, we just quit gdb > killing the inferior program too. */ > if (command == 0) > - quit_command ((char *) 0, stdin == instream); > + { > + printf_unfiltered ("quit\n"); > + execute_command ("quit", stdin == instream); > + } > > time_at_cmd_start = get_run_time (); > > Index: src/gdb/utils.c > =================================================================== > --- src.orig/gdb/utils.c 2006-11-30 12:23:34.000000000 +0000 > +++ src/gdb/utils.c 2006-11-30 12:24:09.000000000 +0000 > @@ -1230,6 +1230,7 @@ defaulted_query (const char *ctlstr, con > clearerr (stdin); /* in case of C-d */ > if (answer == EOF) /* C-d */ > { > + printf_filtered ("%c\n", def_answer); > retval = def_value; > break; > }