Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHv2] gdb/python: add facility to add values into the history
Date: Thu, 26 Aug 2021 10:20:02 +0100	[thread overview]
Message-ID: <20210826092002.GI2581@embecosm.com> (raw)
In-Reply-To: <83y28ptnch.fsf@gnu.org>

* Eli Zaretskii <eliz@gnu.org> [2021-08-25 21:01:50 +0300]:

> > From: Andrew Burgess <andrew.burgess@embecosm.com>
> > Date: Wed, 25 Aug 2021 18:27:19 +0100
> > 
> > +* Python API
> > +
> > +  ** New function gdb.add_history(), which takes a gdb.Value object
> > +     and adds the value to GDB's history list.  An integer, the index
>                  ^^^^^^^^^
> "its value", right?

I don't know, that doesn't sound right to me.  'its value' seems to
imply a value that belongs to someone/something, but I don't think
that's the case here.

Maybe, '...takes a gdb.Value object and adds it to GDB's history list.' ?

How about that?

> 
> > +@findex gdb.add_history
> 
> You don''t need @findex here, since @defun produces that
> automatically.

OK, thanks.

> 
> > +Append @var{value}, an instance of @code{gdb.Value} (@pxref{Values
> > +From Inferior}), to @value{GDBN}'s value history (@pxref{Value
> 
> This sounds like it appends the Python object to the history, but in
> reality it appends its value, right?

You're absolutely correct, but does the user care?  If the user tries
to get the value back from the history list in Python then they will
always get a gdb.Value object returned, though not the same object, it
will represent the same value.

I guess I'm just wondering if the extra complexity of explaining how
this works actually helps the user at all?

Anyway, here's my attempt to explain all this:

  Takes @var{value}, an instance of @code{gdb.Value} (@pxref{Values From
  Inferior}), and appends the value this object represents to
  @value{GDBN}'s value history (@pxref{Value History}) and return an
  integer, its history number.  If @var{value} is not a
  @code{gdb.Value}, it is is converted using the @code{gdb.Value}
  constructor.  If @var{value} can't be converted to a @code{gdb.Value}
  then a @code{TypeError} is raised.

Thoughts?

> 
> > +History}) and return an integer, its history number.  If @var{value}
>             ^
> Comma missing there.

OK, thanks.

Thanks,
Andrew

  reply	other threads:[~2021-08-26  9:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  8:48 [PATCH] " Andrew Burgess
2021-08-23 20:32 ` Tom Tromey
2021-08-25 17:27   ` [PATCHv2] " Andrew Burgess
2021-08-25 18:01     ` Eli Zaretskii via Gdb-patches
2021-08-26  9:20       ` Andrew Burgess [this message]
2021-08-26  9:40         ` Eli Zaretskii via Gdb-patches
2021-09-07  9:56           ` Andrew Burgess

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=20210826092002.GI2581@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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