public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/python: Add new gdb.Value.bytes attribute
Date: Wed, 18 Oct 2023 18:40:11 +0300	[thread overview]
Message-ID: <834jiondlw.fsf@gnu.org> (raw)
In-Reply-To: <9cefc82f3c5d6619bca1f04a783e48ea5639a841.1697641024.git.aburgess@redhat.com> (message from Andrew Burgess on Wed, 18 Oct 2023 15:57:15 +0100)

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Wed, 18 Oct 2023 15:57:15 +0100
> 
>  gdb/NEWS                              |  3 ++
>  gdb/doc/python.texi                   |  7 ++++
>  gdb/python/py-value.c                 | 35 +++++++++++++++++
>  gdb/testsuite/gdb.python/py-value.exp | 56 ++++++++++++++++++++++++++-
>  4 files changed, 100 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/NEWS b/gdb/NEWS
> index 08d779010f0..d89df5dbb45 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -11,6 +11,9 @@
>    ** New function gdb.notify_mi(NAME, DATA), that emits custom
>       GDB/MI async notification.
>  
> +  ** New attribute gdb.Value.bytes that contains a bytes object
> +     holding the contents of this value.
> +
>  *** Changes in GDB 14
>  
>  * GDB now supports the AArch64 Scalable Matrix Extension 2 (SME2), which
> diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
> index 546b4d4b962..a2db6c1b863 100644
> --- a/gdb/doc/python.texi
> +++ b/gdb/doc/python.texi
> @@ -916,6 +916,13 @@
>  method is invoked.  
>  @end defvar
>  
> +@defvar Value.bytes
> +The value of this read-only attribute is a @code{bytes} object
> +containing the bytes that make up this Value's value.  If the complete
                                          ^^^^^
I think "Value" should be in @code.

> +contents of this value are not available then accessing this attribute
> +will raise an exception.
> +@end defvar
> +

The documentation parts are okay, but I wonder: is it enough to say
"the bytes that make up this Value"?  Shouldn't we say something about
endianness, for example?  Or what are "the bytes" of a string with
non-ASCII characters in it?

  reply	other threads:[~2023-10-18 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 14:57 Andrew Burgess
2023-10-18 15:40 ` Eli Zaretskii [this message]
2023-10-20 17:21 ` Tom Tromey
2023-10-23 17:55 ` [PATCHv2] " Andrew Burgess
2023-10-23 18:46   ` Eli Zaretskii
2023-10-25 15:39   ` Tom Tromey

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=834jiondlw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).