From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 525 invoked by alias); 23 Jul 2008 07:48:57 -0000 Received: (qmail 497 invoked by uid 22791); 23 Jul 2008 07:48:55 -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, 23 Jul 2008 07:48:33 +0000 Received: (qmail 28319 invoked from network); 23 Jul 2008 07:48:32 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Jul 2008 07:48:32 -0000 From: Vladimir Prus To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [MI non-stop 06/11, RFA/RFC] Report non-stop availability, and allow to enable everything with one command. Date: Wed, 23 Jul 2008 07:48:00 -0000 User-Agent: KMail/1.9.9 References: <200806282054.03092.vladimir@codesourcery.com> <200807111434.18119.pedro@codesourcery.com> In-Reply-To: <200807111434.18119.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807231148.27184.vladimir@codesourcery.com> 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-07/txt/msg00409.txt.bz2 On Friday 11 July 2008 17:34:17 you wrote: > A Saturday 28 June 2008 17:54:03, Vladimir Prus wrote: > > This patch allows MI frontend to query for non-stop support, like this: > > > Another issue is direct poking at linux async support. I do think that > > we need global 'async' variable to implement this cleanly. > > Yeah, I think so too. Shouldn't be hard to do. > > > Comments? > > > > Since you're adding a target method, let's think a bit about this > issue: > > What happens in these cases: > > GDB build as native linux debugger, we don't support non-stop in remote yet: > > (gdb) set non-stop 1 > OK, the default run target supports non-stop. > > (gdb) tar rem foo:9999 > OK, connected > > Is the non_stop global on now? The debug session will be badly broken if > so. > > ---- > > Fast forward a couple of weeks, when non-stop in the remote target > is committed, > > GDB built as mingw32 native debugger, > > (gdb) set non-stop 1 > failure, the default run target doesn't support > non-stop. > > (gdb) tar rem foo:9999 > OK, connected in all-stop. > > (gdb) set non-stop 1 > Error, target has execution. > > Basically, no way to enable non-stop in this case. :-( Gah; I've forgotten that presently, you cannot change to non-stop when target has execution. I assumed the frontend would first select a target (or implicitly select the default one), then set non-stop, and never touch the target again. I think we have two possible approaches now: 1. Make 'non-stop' variable mean 'I want non-stop, from all targets that support it'. Then, the internal 'non_stop' variable will be true when the current target does support non-stop, and the user-level non-stop variable will correspond to some non_stop_request variable, which will be consulted each time we change targets. There should be a way to query if the target really supports non-stop. 2. Make 'set non-stop 1' work even if the target has execution. I actually not sure why the error is emitted currently. If the target is fully stopped when we do "target remote foo:9999", then changing non-stop setting should not have any bad effect. We'd have to reset non-stop back to 0 when pushing targets -- either unconditionally, or when the new target is not non-stop capable. What do you think? (2) seems more clear to me. - Volodya