From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28844 invoked by alias); 12 Aug 2008 20:12:21 -0000 Received: (qmail 28835 invoked by uid 22791); 12 Aug 2008 20:12:20 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 20:11:35 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1B091983B4; Tue, 12 Aug 2008 20:11:34 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id D141898015; Tue, 12 Aug 2008 20:11:33 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KT0DN-0006eq-7x; Tue, 12 Aug 2008 16:11:33 -0400 Date: Tue, 12 Aug 2008 20:12:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: Add a third mode to "breakpoints always-inserted", and make it the default Message-ID: <20080812201133.GA25501@caradoc.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org, Eli Zaretskii References: <200808120034.25338.pedro@codesourcery.com> <200808122107.20295.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808122107.20295.pedro@codesourcery.com> User-Agent: Mutt/1.5.17 (2008-05-11) 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-08/txt/msg00327.txt.bz2 On Tue, Aug 12, 2008 at 09:07:19PM +0100, Pedro Alves wrote: > > How about calling this state "auto"? > > I like it. Me, too. > > > > In the latter mode, GDB will behave as "on", if > > > we're in non-stop mode, and as "off" if we're in all-stop mode. > > > > I think _behave_ as "on" is not a good idea. I suggest that it > > actually _set_ the option "on". That way, code elsewhere will need > > only to look at a single option, and won't need to know that if the > > value is follow-non-stop, it needs to check another flag. > > All the common code already goes through this predicate: > > +int > +breakpoints_always_inserted_mode (void) > +{ > + return (always_inserted_mode == always_inserted_on > + || (always_inserted_mode == always_inserted_follow_non_stop > + && non_stop)); > +} > -int breakpoints_always_inserted_mode (void) > -{ > - return always_inserted_mode; > -} > - > > Note that I didn't have to touch any of infrun.c, or breakpoint > management functions in breakpoint.c, where the predicate is checked. > > If I kept it as an boolean, I'd have to instead change the "set non-stop" > command implementation, which means I'd have to export a setter for the > internal breakpoint.c variable. Either way, one setting has to know > about the other. This way seemed more centralised. > > In any case, I can't seem to come up with a sentence that > describes the auto behaviour without using "behaves as". If you can > suggest any, I'd appreciate it. > > > > +This is the default mode. If gdb is controlling the inferior in > > > +non-stop mode (@pxref{Non-Stop Mode}), gdb behaves as if > > > +always-inserted mode is on. If gdb is controlling the inferior in > > > +all-stop mode, gdb behaves as if always-inserted mode is off. > > > > We don't use a literal "gdb" in the manual, we use "@value{GDBN}". > > Ooops. Fixed. > > > > > Also, it would be helpful to have an index entry here, something like > > > > @cindex non-stop mode, and @code{breakpoint always-inserted} > > Done, and done, I think. No, you added: > +@cindex non-stop mode I'm sure that one doesn't go here :-) > + if (always_inserted_mode == always_inserted_auto) > + fprintf_filtered (file, > + _("Always inserted breakpoint mode is %s (currently %s).\n"), > + value, non_stop ? "on" : "off"); I suggest calling breakpoints_always_inserted_mode here instead of checking non_stop. Otherwise, the code looks fine - though I'd like to reach an agreement with Vladimir about set non-stop first. -- Daniel Jacobowitz CodeSourcery