Thanks Eli, On Tuesday 12 August 2008 19:17:36, Eli Zaretskii wrote: > > From: Pedro Alves > > Date: Tue, 12 Aug 2008 00:34:24 +0100 > > > > So, this patch changes the "set breakpoints always-inserted" setting to > > be a three-state. on and off, the same as before, and a new mode, > > "follow-non-stop". > > How about calling this state "auto"? I like it. > > 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. -- Pedro Alves