public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFAv2 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting.
Date: Sat, 06 Jul 2019 06:23:00 -0000	[thread overview]
Message-ID: <83ftnjadge.fsf@gnu.org> (raw)
In-Reply-To: <20190705195823.3472-4-philippe.waroquiers@skynet.be> (message	from Philippe Waroquiers on Fri, 5 Jul 2019 21:58:23 +0200)

> From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> 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.

  reply	other threads:[~2019-07-06  6:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 19:58 [RFAv2 0/3] Convenience functions $_gdb_setting/$_gdb_int_setting Philippe Waroquiers
2019-07-05 19:58 ` [RFAv2 1/3] Implement convenience functions to examine GDB settings Philippe Waroquiers
2019-07-05 19:58 ` [RFAv2 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting Philippe Waroquiers
2019-07-06  6:23   ` Eli Zaretskii [this message]
2019-07-06 10:54     ` Philippe Waroquiers
2019-07-06 11:21       ` Eli Zaretskii
2019-07-05 19:58 ` [RFAv2 2/3] Test the convenience functions " Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ftnjadge.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).