From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id B9A1F3858C27 for ; Tue, 3 Oct 2023 19:13:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9A1F3858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTP id njd1qWdJoNWIenkpPqEuw9; Tue, 03 Oct 2023 19:13:07 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id nkpOqFeaU7MctnkpOqVWFM; Tue, 03 Oct 2023 19:13:06 +0000 X-Authority-Analysis: v=2.4 cv=BZjLb5h2 c=1 sm=1 tr=0 ts=651c67c2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=bhdUkHdE2iEA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=C3vWAc22sETZK3wYZyMA:9 a=ul9cdbp4aOFLsgKbc677: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:In-Reply-To:Date:References :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=zZQshVgec+ZDSY+P/GJP7+qVqe3LmXKPFd8OmlKfnx8=; b=SDivneWgJe417XsFfcghxXJAOK FGWeW1GmZkTcg8OY2lU3s4bKhpMTCrU/U9/fv2FKoD+OfN5S8ZO2CPMbjFR0EhethWgITKzwwoNcq sfXMnqq0XaTtqRTIG9PmPRAcn; Received: from 71-211-130-31.hlrn.qwest.net ([71.211.130.31]:56500 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qnkpO-002mhE-0X; Tue, 03 Oct 2023 13:13:06 -0600 From: Tom Tromey To: Andrew Burgess via Gdb-patches Cc: Andrew Burgess , Andreas Schwab Subject: Re: [PATCHv2 4/5] gdbserver: cleanup in handle_v_run References: <2b98ca58e47638b4760d86bd6e1fa9a9a79fa2ad.1695817255.git.aburgess@redhat.com> <101de2688bc146244f0ae89477cfd4adf3606551.1695835626.git.aburgess@redhat.com> X-Attribution: Tom Date: Tue, 03 Oct 2023 13:13:05 -0600 In-Reply-To: <101de2688bc146244f0ae89477cfd4adf3606551.1695835626.git.aburgess@redhat.com> (Andrew Burgess via Gdb-patches's message of "Wed, 27 Sep 2023 18:27:57 +0100") Message-ID: <87y1gjy0xq.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 71.211.130.31 X-Source-L: No X-Exim-ID: 1qnkpO-002mhE-0X X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-130-31.hlrn.qwest.net (murgatroyd) [71.211.130.31]:56500 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNAq1upj7EBL4448jqIklWlhk0Px0vWwUh25X3ve8DoJU2Rns8QGr9JkDz4eLp1ibQHAgiQ3YJK/ptyiYQO2JcFagYoI/c2nM7WCVi0WMW/5CeA0+sv2 u5FeAzkO3W1Mh4ZjKmRYXGqW/rCbsCwmM6SQoSmNUZwgBon84Pg4MKySlC4BW6a8mJ06G7+13I7aM3bfh8hYolswjnile5tCs78= X-Spam-Status: No, score=-3019.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Andrew" == Andrew Burgess via Gdb-patches writes: Andrew> After the previous commit there is now a redundant string copy in Andrew> handle_v_run, this commit cleans that up. Andrew> + /* Buffer to decode the argument into. */ Andrew> char *arg = (char *) xmalloc (len + 1); ... Andrew> hex2bin (p, (gdb_byte *) arg, len); Andrew> arg[len] = '\0'; Not really your problem, but since you're changing it anyway, using the byte_vector form of hex2bin would remove some manual memory management here. Tom