From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12720 invoked by alias); 4 May 2008 21:34:49 -0000 Received: (qmail 12711 invoked by uid 22791); 4 May 2008 21:34:49 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 04 May 2008 21:34:32 +0000 Received: (qmail 21317 invoked from network); 4 May 2008 21:34:29 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 May 2008 21:34:29 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: continuations and breakpoint commands Date: Sun, 04 May 2008 22:49:00 -0000 User-Agent: KMail/1.9.9 Cc: Daniel Jacobowitz , Pierre Muller References: <200804292221.52239.pedro@codesourcery.com> <200804301559.34896.pedro@codesourcery.com> <20080502153655.GO29202@caradoc.them.org> In-Reply-To: <20080502153655.GO29202@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805042234.29099.pedro@codesourcery.com> 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: 2008-05/txt/msg00187.txt.bz2 Sorry, I seem to have missed this, A Friday 02 May 2008 16:36:55, Daniel Jacobowitz wrote: > On Wed, Apr 30, 2008 at 03:59:34PM +0100, Pedro Alves wrote: > > > What happens to the already typed chars in the > > > case of a prompt switch? > > > > No sure I understood that. When the inferior is running in > > sync execution, any typed character goes to the inferior, while > > in async execution the terminal stays with GDB and GDB interprets > > any command you pass to it. > > I think he's asking what happens when the program hits a breakpoint > while you're mid-typing. I assume we print some output and readline > redraws the prompt line? There's no prompt switch in async mode. The code comment in question has to do with sync_execution on top of async mode, where anything the user typed while the inferior was executing went to the inferior. In async, if some breakpoint is hit mid-typing we just print some output, and don't mess with the prompt, so whatever the user was mid-typing is unaffected. The command line does gets a bit garbled, because there's no distintion between the command line, and other output, though. With a source that looks like (line/code): 8 sleep (10); << stopped here. 9 sleep (10); << breakpoint here. (gdb) c& Continuing. (gdb) help << "enter" not pressed yet. (wait for breakpoint hit) (gdb) c& Continuing. (gdb) helpBreakpoint 3, thread1_really () at thread.cpp:9 9 in thread.cpp << press "enter" now. List of classes of commands: aliases -- Aliases of other commands breakpoints -- Making program stop at certain points data -- Examining data files -- Specifying and examining files internals -- Maintenance commands obscure -- Obscure features running -- Running the program ... Clearly, an improvement would be for the output to be: (gdb) c& Continuing. (gdb) help << "enter" not pressed yet. (wait for breakpoint hit) (gdb) c& Continuing. Breakpoint 3, thread1_really () at thread.cpp:9 9 in thread.cpp (gdb) help I suppose it may be possible to add some smartness to printf_*filtered and friends to do some dance with readline for this. There's one case where prompting may get in the way of what the user was typing. That's when due to *_filtered, pagination kicks in. We use a prompt for the query. Hey, nobody's been claiming CLI is perfect in async mode yet :-) -- Pedro Alves