From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id D223C3858D28 for ; Fri, 1 Nov 2024 14:26:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D223C3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D223C3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730471165; cv=none; b=m5TPkuf2Fw3bvJ8zafCNsKB7s6jsCArmRWgcOv3GPqBaRhZvh4u3pJr5XfWaAb5a/XBQONSIW+u1Mwh6P4vZd3Bs8CyIL7K5s74xXVIqzzgngXPRKUOPTBPXay4uZBmsDy2J/yLtmwEqPq7ldXxn8s1iCjsjFcohLnfU8kKkq8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730471165; c=relaxed/simple; bh=ushAyH7pz2XoNGZVU6D6d1Xb0WeiXXsmWO2yfDsOK/I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cAQAgll4a21U0JAGXz9Ed74gdVK9EeP6A2Elmn0EBYf8g4WJBgKU90zfCUhDyRtwB4cx8m/Yi5rPoLY/j/xl0Vxn8nOtzGsqxUSduOg3Yqvbmwx2Mv9j/j5GWlEsHGvIXYoGshHVVn9Vduyr+o8t6/y2yYJ7jp4BBye1dw6H3Qs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5008a.ext.cloudfilter.net ([10.0.29.246]) by cmsmtp with ESMTPS id 6YQgtoGtovH7l6sb9tvjTN; Fri, 01 Nov 2024 14:26:00 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 6sb8tSCanQsN56sb9tfyge; Fri, 01 Nov 2024 14:25:59 +0000 X-Authority-Analysis: v=2.4 cv=SsGW6uO0 c=1 sm=1 tr=0 ts=6724e4f7 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=VlfZXiiP6vEA:10 a=ItBw4LHWJt0A:10 a=awEjtrBf7JOc8ZpCzMkA:9 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Ks/024Ditm6ovp71/sPI5KWZ+fgJLkOPlr7OasrKFVU=; b=JsmCSm+yPElY8XRkbBQwGcJOqX gqC06/I3IhzdVPti+ijVAQ4yTvqGmBfvNa5HjRaJ639t5/D1BhPoOHHIdcf19BHp2jocGebFP/yBx DkeUVnL5BhlgaI1F43ZIZGutc; Received: from 97-122-113-155.hlrn.qwest.net ([97.122.113.155]:39700 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1t6sb8-003XGN-1D; Fri, 01 Nov 2024 08:25:58 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/tdep] Use std::array in amd64-windows-tdep.c In-Reply-To: <20241029114925.5582-1-tdevries@suse.de> (Tom de Vries's message of "Tue, 29 Oct 2024 12:49:25 +0100") References: <20241029114925.5582-1-tdevries@suse.de> X-Attribution: Tom Date: Fri, 01 Nov 2024 08:25:57 -0600 Message-ID: <87ed3v6ney.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.113.155 X-Source-L: No X-Exim-ID: 1t6sb8-003XGN-1D X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-113-155.hlrn.qwest.net (murgatroyd) [97.122.113.155]:39700 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAPNokgSNxO9zkoBpC5MMUksc0WwndLc7wy+ds31X26nEOJH4kccJgj1ToSr/DnyfpwHUBWhAkfADAHgJuPmfLvJealqHWHQt5seeyfsOTQb19qK1SEC omrTeJC23o7rxDsspFTlhJdobqh/bABblPC0H7zyjDMLdu1r+LAYbui91FHclECcfvb03dld+LZ4h9sbzSFbDqJUkyDwJemN5SQ= X-Spam-Status: No, score=-3013.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries writes: Tom> + std::array buf; Tom> gdb_assert (type->length () <= 8); Tom> - memset (buf, 0, sizeof buf); Tom> - memcpy (buf, valbuf, std::min (type->length (), (ULONGEST) 8)); Tom> + memset (buf.data (), 0, buf.size ()); Tom> + memcpy (buf.data (), valbuf, std::min (type->length (), (ULONGEST) 8)); Maybe buf can be value-initialized rather than using memset, like 'std::array<..> buf {}' Tom> + write_memory (sp, buf.data (), buf.size ()); Tom> + if (target_read_memory (pc + 1, buf.data (), buf.size ()) == 0) I guess at some point we could have some more overloads accepting an array_view. Tom