From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75779 invoked by alias); 6 Jul 2019 10:54:43 -0000 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 Received: (qmail 75745 invoked by uid 89); 6 Jul 2019 10:54:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=clarify X-HELO: mailsec101.isp.belgacom.be Received: from mailsec101.isp.belgacom.be (HELO mailsec101.isp.belgacom.be) (195.238.20.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 06 Jul 2019 10:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1562410481; x=1593946481; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=9vvVMbUIhb9JUMIIBxkKVwCHsi9Wh6q3I51emCbX7wg=; b=Z/AGrMhah4vyw1drdOtty0DL8Q7BMXpnQAqhcputiMGMudTQW/Vhwi9h 3lzf+Wov0b5GYZ0qV+U4Yrr7AICF6Q==; Received: from 96.218-128-109.adsl-dyn.isp.belgacom.be (HELO md) ([109.128.218.96]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 06 Jul 2019 12:54:39 +0200 Message-ID: <1562410479.1521.1.camel@skynet.be> Subject: Re: [RFAv2 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting. From: Philippe Waroquiers To: Eli Zaretskii Cc: gdb-patches@sourceware.org Date: Sat, 06 Jul 2019 10:54:00 -0000 In-Reply-To: <83ftnjadge.fsf@gnu.org> References: <20190705195823.3472-1-philippe.waroquiers@skynet.be> <20190705195823.3472-4-philippe.waroquiers@skynet.be> <83ftnjadge.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00192.txt.bz2 Thanks for the comments, I have just sent a v3 that handles them. (note that v2 did not change anything compared to v1, as I forgot to commit the changes before sending the mail). Some more feedback below. On Sat, 2019-07-06 at 09:23 +0300, Eli Zaretskii wrote: > > From: Philippe Waroquiers > > Cc: Philippe Waroquiers > > Date: Fri, 5 Jul 2019 21:58:23 +0200 > > > > +@item $_gdb_setting (@var{setting}) > > +@findex $_gdb_setting@r{, convenience function} > > +Return the value of the @value{GDBN} @var{setting} as a string. > > +@var{setting} is any setting that can be used in a @code{set} or > > +@code{show} command (@pxref{Controlling GDB}). > > After reading the description of $_gdb_int_setting, a question I have > about this function is whether it works for settings whose values are > integers. The examples answer that question, but I think the text > should be explicit about that. I have tried to clarify this in the description in RFAv3. > > > +@item $_gdb_int_setting (@var{setting}) > > +@findex $_gdb_int_setting@r{, convenience function} > > +Return the value of the @value{GDBN} @var{setting} as an integer. > > +This only works for boolean, auto boolean and integer settings. > > +The boolean values @code{on} and @code{off} are converted to > > +the integer values @code{0} and @code{1}. > > The correspondence of ON and OFF to zero and 1 respectively surprised > me. Why not the other way around? That was an error in the doc, fixed in RFAv3. It now describes that 0 is off and 1 is on. > > > The value @code{auto} is > > +converted to the value @code{2}. > > +Some integer settings accepts an @code{unlimited} value. > > +Depending on the setting, the unlimited value is converted to a @code{0} > > +or a @code{-1} value. > > The last part begs a question how to know whether 'unlimited' will > yield zero or -1? Can't we always return -1? I think it is better to keep the same convention as what is accepted by the "set" command: some settings are using 0 to mean unlimited and some are using -1. I have tried to describe this in the doc RFAv3. > > Markup-wise, please use @code{@minus{}1}, it will look better in print. > > Btw, do we have a way of determining whether a given convenience > function exists in the current GDB? For variables, one can use > $_isvoid, I think, but what about functions? I do not know of any way to see if a user defined function or convenience function is defined. For the GDB convenience function, the GDB major/minor can be used to determine what is available. Philippe