From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123185 invoked by alias); 6 Jul 2019 06:23:40 -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 123177 invoked by uid 89); 6 Jul 2019 06:23:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1796 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 06 Jul 2019 06:23:38 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hje6i-0006RA-HD; Sat, 06 Jul 2019 02:23:36 -0400 Received: from [176.228.60.248] (port=2993 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hje6h-0003qP-TN; Sat, 06 Jul 2019 02:23:36 -0400 Date: Sat, 06 Jul 2019 06:23:00 -0000 Message-Id: <83ftnjadge.fsf@gnu.org> From: Eli Zaretskii To: Philippe Waroquiers CC: gdb-patches@sourceware.org In-reply-to: <20190705195823.3472-4-philippe.waroquiers@skynet.be> (message from Philippe Waroquiers on Fri, 5 Jul 2019 21:58:23 +0200) Subject: Re: [RFAv2 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting. References: <20190705195823.3472-1-philippe.waroquiers@skynet.be> <20190705195823.3472-4-philippe.waroquiers@skynet.be> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00186.txt.bz2 > 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. > +@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? > 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? 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? Thanks.