Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 1/3] gdbsupport: update comment on hex2bin
Date: Mon,  9 Nov 2026 15:35:50 +0000	[thread overview]
Message-ID: <fcbc949ae8a7ae81637cfb7f85d0f9555b09dce9.1794238395.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1794238395.git.aburgess@redhat.com>

The comment on hex2bin says that the argument COUNT is the maximum
number of characters to convert.  I don't think this is correct, COUNT
is the maximum number of bytes to convert, with each byte being
represented by two characters.

The comment already talks about converting "pairs of hex digits", so
I've updated the comment to indicate that COUNT is the number of
character pairs to convert.

There is no functional change after this commit.
---
 gdbsupport/common-utils.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdbsupport/common-utils.h b/gdbsupport/common-utils.h
index de83a715ac4..e97aed32682 100644
--- a/gdbsupport/common-utils.h
+++ b/gdbsupport/common-utils.h
@@ -223,10 +223,11 @@ extern int fromhex (int a);
 
 /* HEX is a string of characters representing hexadecimal digits.
    Convert pairs of hex digits to bytes and store sequentially into
-   BIN.  COUNT is the maximum number of characters to convert.  This
-   will convert fewer characters if the number of hex characters
-   actually seen is odd, or if HEX terminates before COUNT characters.
-   Returns the number of characters actually converted.  */
+   BIN.  COUNT is the maximum number of character pairs (bytes) to
+   convert.  This will convert fewer characters if the number of hex
+   characters actually seen is odd, or if HEX terminates before COUNT
+   character pairs.  Returns the number of character pairs (bytes)
+   actually converted.  */
 extern int hex2bin (const char *hex, gdb_byte *bin, int count);
 
 /* Like the above, but return a gdb::byte_vector.  */
-- 
2.25.4


  reply	other threads:[~2026-11-09 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 15:35 [PATCH 0/3] gdb/remote: improve packet buffer checks for p packet Andrew Burgess
2026-11-09 15:35 ` Andrew Burgess [this message]
2026-11-09 16:49   ` [PATCH 1/3] gdbsupport: update comment on hex2bin Tom Tromey
2026-11-09 15:35 ` [PATCH 2/3] gdbserver: add support for p/P packets and flag to disable g/G packets Andrew Burgess
2026-11-09 17:16   ` Tom Tromey
2026-11-09 15:35 ` [PATCH 3/3] gdb/remote: improve error checking for 'p' packet reply Andrew Burgess
2026-11-09 17:27   ` Tom Tromey
2026-11-23 16:44     ` 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=fcbc949ae8a7ae81637cfb7f85d0f9555b09dce9.1794238395.git.aburgess@redhat.com \
    --to=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