From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12048 invoked by alias); 30 Apr 2008 14:59:57 -0000 Received: (qmail 12038 invoked by uid 22791); 30 Apr 2008 14:59:56 -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; Wed, 30 Apr 2008 14:59:38 +0000 Received: (qmail 20236 invoked from network); 30 Apr 2008 14:59:36 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Apr 2008 14:59:36 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: continuations and breakpoint commands Date: Wed, 30 Apr 2008 18:25:00 -0000 User-Agent: KMail/1.9.9 Cc: "Pierre Muller" References: <200804292221.52239.pedro@codesourcery.com> <200804301416.19459.pedro@codesourcery.com> <000001c8aad0$4d7cc080$e8764180$@u-strasbg.fr> In-Reply-To: <000001c8aad0$4d7cc080$e8764180$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804301559.34896.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-04/txt/msg00706.txt.bz2 A Wednesday 30 April 2008 15:41:40, Pierre Muller wrote: > >> Just a minor gotcha: > >> > >> - /* If the continuation did not start the target again, > >> - prepare for interation with the user. */ > >> + /* If no breakpoint command resumed the inferior, prepare for > >> + >>interation<< with the user. */ > >> > >> Is "interation" supposed to be "interaction"? > > > >Yep. Thanks for spotting that. We're going to display the prompt > >so the user can enter commands, that's what it means. > > > >-- > >Pedro Alves > > Hi Pedro, > > I am confused, but it is probably because I didn't > have time and courage to read the whole non-stop threads. > > What happens if the user is currently typing some > commands on prompt? When the target supports async execution, and the exec command was a background exec command (that is, continue& vs continue; step& vs step), the user will be able to type commands while the inferior is running. If the target supports async execution, but the exec command was a foreground exec command (continue, next, step -- without an appended &), GDB will fake sync execution by disabling stdin, transfering the terminal to the inferior and not printing the prompt. When the inferior stops, it needs to print the prompt. The user gets the same effect as in a GDB where the target does not support async execution like so: >/home/pedro/gdb/nonstop_head/build-32/gdb/gdb -ex "maint set linux-async" ./threads32 (gdb) r Starting program: /home/pedro/gdb/tests/threads32 [Thread debugging using libthread_db enabled] [New Thread 0xf7e27b90 (LWP 27641)] [New Thread 0xf7626b90 (LWP 27642)] any typed char is ignored by gdb << enter really << enter << ^C Program received signal SIGINT, Interrupt. [Switching to Thread 0x7f60629c96e0 (LWP 27505)] 0x00007f60625ba796 in pthread_join () from /lib/libpthread.so.0 (gdb) >/home/pedro/gdb/nonstop_head/build-32/gdb/gdb -ex "maint set linux-async" ./threads32 (gdb) r& Starting program: /home/pedro/gdb/tests/threads32 (gdb) [Thread debugging using libthread_db enabled] [New Thread 0xf7d60b90 (LWP 27708)] [New Thread 0xf755fb90 (LWP 27709)] << inferior is running, start typing, (gdb) any char is ignored << enter Undefined command: "any". Try "help". (gdb) > Are there two different prompts to let the > user know if we are running or stopped? No. > 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. -- Pedro Alves