From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0x5CN4bo8WrRZToAWB0awg (envelope-from ) for ; Mon, 09 Nov 2026 10:36:38 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NiZ9GdX8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D16BD378002; Mon, 09 Nov 2026 10:36:38 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 128061E023 for ; Mon, 09 Nov 2026 10:36:38 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D46244BA23FB for ; Mon, 9 Nov 2026 15:36:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D46244BA23FB Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NiZ9GdX8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id C3B814BA23F8 for ; Mon, 9 Nov 2026 15:36:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C3B814BA23F8 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C3B814BA23F8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794238561; cv=none; b=K+4CxRQn+LNP2hKourjNQPRAQ+QaIjY+0mxNGmer0epb1ORhsqHXahPUVoKG1QZoTPUhbWAYFBhbvAAmnDJIU3OLJpoi7yvNJLcwLF80s2+WFxpvLTPhUHgl47qKlYxLW0Y20bpiY4Eu//S/BnlYIDySglXKBNlxkI2xE/4sdjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794238561; c=relaxed/simple; bh=KOp5lTvYjwLnDpUgpjXCMiNZzKnjws/mRvv91obxSTo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=oRiP69vPLBSGKHo+N7naGjAKP1cSWJgvuXszHALkzRBBJMG1vgLlOD94MNTucflv2xfJMFTcqJhyeaS5HUAXTRNzqrUDC5KcZwhpP48KNiASDUAYn5ZTlQzsIzz7n5xBQH4yjmLDjuEJHmZ5ZuC/LDddiZwh1sCLrG05wnyRyDQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NiZ9GdX8 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3B814BA23F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794238561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4lelEtUVmNGy8abCIENs/qkRWRDKQSpFZrqWCIwAQjM=; b=NiZ9GdX8xmHJVbE31PqOM2yMiEENXlJQY+Ohf0gN4Hh1wF6Vo5gw6Cc6Fd9TclI6hhcapx CohnctxVJ2PW8w5AzMkiqjP8njVv1IN/Y0rSw+5PIafuiHz8V7uG3Ey7eCqTKGfNyFBAVp 8m3T3dF1hQ9g2KEpS1vtyYpAQ+zPXsI= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-426-EXLokPV0NlWXabVXVHtzHw-1; Mon, 09 Nov 2026 10:35:59 -0500 X-MC-Unique: EXLokPV0NlWXabVXVHtzHw-1 X-Mimecast-MFC-AGG-ID: EXLokPV0NlWXabVXVHtzHw_1794238559 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4b0a307487aso5150005e9.1 for ; Mon, 09 Nov 2026 07:35:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794238558; x=1794843358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=4lelEtUVmNGy8abCIENs/qkRWRDKQSpFZrqWCIwAQjM=; b=BXADRg6Ue6j37XuJKpCWTRqjNmtDI+sRLaIsHMDd2YjrvlMg/woBoUy5eYX5lSHnNS OWyDp1tw9Ju4F6Aqrh2399tsU+wxUqC04IAGOAq1ryWM+aqxp40MvH53iAqSwyOUA1Ju rOx8/Cb7uHozzq6O9qDocU7mSATYZjXPiW6SXj3hDq5VpfKLFOtXQgNarl7jIugSos6b aefMFqcnf++M5dSaurH87nafSIhHlqimnkl7dKJCk6COiAXndLwXfRVP1jKGK0p8mHb8 qKoF7jHl1aSaeN+PfnezsvvPsa4EkVLZAYRlS2mQNzpMsZ2mpWrL41n4bkYz/KkBRKIZ ipWw== X-Gm-Message-State: APuU4Z8MD68PGQBKwGBzTxm1hTULhtF0AMVw0HCvSRdPRBoojUkcnp1R yJ1kqcdxMu53eV3iUwTCUuG/Kv3K0F4ys/sM6u8skLczg/feuVCqShJt7Vs6NvfBhgqrol3i/vB 8H1JM5Nx+V73xFah2FkNkmU0w2Y9L9gwuroIroqw3DmcrEcq+U6g/NtOHsjF7PRuBCstsVqMill 76hhgPV4p0Eu0gUtbDhLLd6m/lf3QeMF5eBhn8/XbeKmdGZ6s= X-Gm-Gg: AYBFou2qD8iBnwQggyyxMzVSh/T+0GD22afacvUXLT7ocQbelYcf89LSj/NFRwkPbdt KU+L4zYs2GDZgviWhehT0HgLltorCx3t/98rIRpLnSGOmf0ch+uG31BB1r6Oidimx81f+IrWe2m /BM0HTaanatDpDgd0LiONVbLHucKyyYUfKvQv3nz9BRM2Hhe5L1cSG6Md+0DzCURS09Qh98cZVU WDEFNl8fzaYlbcss81EeMuf5THe0z76FF0zkhGHiVrIhD09AI7+4IyNMQUpf24hQcUmRjo28feA 2VNGM3e2GykuqEBVx0gasY2UrtbqdOpHHB0U6zidvdsReepTB/NYxZyDz5C0Buym85JvDLHkJVr hdrEnyLgv3MTRJNk/25yZs1ovGbc3V0J9rxZE45YSfl7j X-Received: by 2002:a05:600c:4f13:b0:4af:9cae:df63 with SMTP id 5b1f17b1804b1-4b963c91294mr101681115e9.31.1794238558584; Mon, 09 Nov 2026 07:35:58 -0800 (PST) X-Received: by 2002:a05:600c:4f13:b0:4af:9cae:df63 with SMTP id 5b1f17b1804b1-4b963c91294mr101680625e9.31.1794238558076; Mon, 09 Nov 2026 07:35:58 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b7d54d6f93sm395899685e9.0.2026.11.09.07.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2026 07:35:57 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/3] gdbsupport: update comment on hex2bin Date: Mon, 9 Nov 2026 15:35:50 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wktIceWNZ9AOMkK7V5yXr966UDXljpjxdx5bK8rT620_1794238559 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org 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