From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uZy5LXqQ+Wkp5hQAWB0awg (envelope-from ) for ; Tue, 05 May 2026 02:38:50 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WpKDwTHo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B0D8D1E0BA; Tue, 05 May 2026 02:38:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 BAA891E093 for ; Tue, 05 May 2026 02:38:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 308B64BA23C5 for ; Tue, 5 May 2026 06:38:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 308B64BA23C5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WpKDwTHo Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by sourceware.org (Postfix) with ESMTPS id A32DA4BA2E1F for ; Tue, 5 May 2026 06:38:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A32DA4BA2E1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A32DA4BA2E1F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777963094; cv=none; b=iARh5ct94RwRQueSsdI0CPbIBgPytYz2xFziLHU5UvpBj0NFoEctagNZo1FtUnfA5iJeynpYi8wof4pjdZQFGnrPfoM60DpqvOAjTP50H/gCRlxyx6xYNjqcwUES2rySUz1Cot0vc9WobqRGapGaiJz3CB5zyyGP8uhYFvvR3is= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777963094; c=relaxed/simple; bh=tpNtjsaarwkRS/u9CHqoyHS8MocUfkLoMssQ0TqkB7k=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=mZ4vcx0MIqOCC/SIhKKjgMH7PsJVwrCQIQVVRwtBu55A/oPmudhnrXHBoP4OLO375UdSNAbImLN1eUMVmCekHCVnnnrRRHAfI98F3/FnnmSai3l6+Tiy1AWEha+/DC6PpkNq4sXrKgsmFXFQcQDuFIQNmAkvEOzDUJBSjmP1Pqo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A32DA4BA2E1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777963094; x=1809499094; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tpNtjsaarwkRS/u9CHqoyHS8MocUfkLoMssQ0TqkB7k=; b=WpKDwTHo6W9B7EIs9n6B0Al1vSdClE0MS3U5zo4jtQqOv0auvpPqzJp2 jAAmBx4QVBf3XvPnmlGPj93AleF1JuJKM6MUBII2IaLU2R89/T0Tc/Sz/ wA8oBkHjKkpAcDH1KKX7LEMtnOyt2bz0xSg6DVOAQF3vvhfmXmqLLB4yd tfcsSRpMmfPQBn00GjRV+UjulstpACDpTiPp0BpoDRfkavQXFpbGJM3Zl q2JywsqQIHKg5QyvOb6KABmeJzIC0olLGpJ9IUwOI6t07tDTf18n38Kzf ZW964KTHqH/lmQ4sd7doJB6yw28EA0O02iSkUI/6zsKM6JAZlWlK2uIZw A==; X-CSE-ConnectionGUID: EX98BHYwTJe4JE69nM9JnQ== X-CSE-MsgGUID: G7EIfpywR+uOytmQP6Xxmw== X-IronPort-AV: E=McAfee;i="6800,10657,11776"; a="79017547" X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="79017547" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2026 23:38:12 -0700 X-CSE-ConnectionGUID: F8oVAs11TMyjgX1lx9C+7g== X-CSE-MsgGUID: 8gkO0SL9RcaXLntEFvNzuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,217,1770624000"; d="scan'208";a="231146246" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2026 23:38:11 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Cc: Tankut Baris Aktemur , Simon Marchi Subject: [PATCH v2] gdb: update store_integer's comment Date: Tue, 5 May 2026 06:38:09 +0000 Message-Id: <20260505063809.1821415-1-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 From: Tankut Baris Aktemur 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 --- 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 void store_integer (gdb::array_view 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. */ +/* Take a host-format integer VAL and store it as a target-format + integer at DST. */ template> extern void store_integer (gdb::array_view dst, bfd_endian byte_order, T val); +/* Take a host-format integer VAL and store it as a target-format integer + at ADDR which is LEN bytes long. */ template static inline void store_integer (gdb_byte *addr, int len, bfd_endian byte_order, T val) @@ -70,6 +75,8 @@ store_integer (gdb_byte *addr, int len, bfd_endian byte_order, T val) return store_integer (gdb::make_array_view (addr, len), byte_order, val); } +/* Take a host-format signed integer VAL and store it as a target-format + integer at DST. */ static inline void store_signed_integer (gdb::array_view dst, bfd_endian byte_order, LONGEST val) @@ -77,6 +84,8 @@ store_signed_integer (gdb::array_view dst, bfd_endian byte_order, return store_integer (dst, byte_order, val); } +/* Take a host-format signed integer VAL and store it as a target-format + integer at ADDR which is LEN bytes long. */ static inline void store_signed_integer (gdb_byte *addr, int len, bfd_endian byte_order, LONGEST val) @@ -85,6 +94,8 @@ store_signed_integer (gdb_byte *addr, int len, bfd_endian byte_order, val); } +/* Take a host-format unsigned integer VAL and store it as a target-format + integer at DST. */ static inline void store_unsigned_integer (gdb::array_view dst, bfd_endian byte_order, ULONGEST val) @@ -92,6 +103,8 @@ store_unsigned_integer (gdb::array_view dst, bfd_endian byte_order, return store_integer (dst, byte_order, val); } +/* Take a host-format unsigned integer VAL and store it as a target-format + integer at ADDR which is LEN bytes long. */ static inline void store_unsigned_integer (gdb_byte *addr, int len, bfd_endian byte_order, ULONGEST val) -- 2.34.1 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928