Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Markus Metzger <markus.t.metzger@intel.com>, gdb-patches@sourceware.org
Cc: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Subject: Re: [PATCH v2] gdb: update store_integer's comment
Date: Tue, 5 May 2026 12:05:08 -0400	[thread overview]
Message-ID: <96e73d5c-c425-4a25-8a35-ca7e5946b544@simark.ca> (raw)
In-Reply-To: <20260505063809.1821415-1-markus.t.metzger@intel.com>



On 2026-05-05 02:38, Markus Metzger wrote:
> From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
> 
> The comment of store_integer seems slightly outdated and does not
> refer to the variants that take an array view.  Update the comment.
> 
> CC: Simon Marchi <simark@simark.ca>
> ---
>  gdb/extract-store-integer.c |  3 +--
>  gdb/extract-store-integer.h | 15 ++++++++++++++-
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/extract-store-integer.c b/gdb/extract-store-integer.c
> index a7bce99362d..6749c46fb6b 100644
> --- a/gdb/extract-store-integer.c
> +++ b/gdb/extract-store-integer.c
> @@ -129,8 +129,7 @@ extract_typed_address (const gdb_byte *buf, struct type *type)
>    return gdbarch_pointer_to_address (type->arch (), type, buf);
>  }
>  
> -/* All 'store' functions accept a host-format integer and store a
> -   target-format integer at ADDR which is LEN bytes long.  */
> +/* See extract-store-integer.h.  */
>  template<typename T, typename>
>  void
>  store_integer (gdb::array_view<gdb_byte> dst, enum bfd_endian byte_order,
> diff --git a/gdb/extract-store-integer.h b/gdb/extract-store-integer.h
> index 76dfd49d62a..49799bb0953 100644
> --- a/gdb/extract-store-integer.h
> +++ b/gdb/extract-store-integer.h
> @@ -57,12 +57,17 @@ extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
>  					struct type *type);
>  
>  /* All 'store' functions accept a host-format integer and store a
> -   target-format integer at ADDR which is LEN bytes long.  */
> +   target-format integer, either at DST, which contains its size,
> +   or at ADDR, which is LEN bytes long.  */

I'd remove this "All ..." comment, the comment on each function is clear
enough.

>  
> +/* Take a host-format integer VAL and store it as a target-format
> +   integer at DST.  */

I'd use a definite form ("Take host-format integer VAL..." or "Take the host-format
integer VAL...").  We don't take about any integer, we talk about VAL
specifically.

Add an empty line between comments and functions.

With those fixed:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

      reply	other threads:[~2026-05-05 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  6:38 Markus Metzger
2026-05-05 16:05 ` Simon Marchi [this message]

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=96e73d5c-c425-4a25-8a35-ca7e5946b544@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --cc=tankut.baris.aktemur@intel.com \
    /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