From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 26M7Cw1tBmdFVgcAWB0awg (envelope-from ) for ; Wed, 09 Oct 2024 07:46:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728474381; bh=Zwuhe0FiyIF0JfzSI9k6siMMG/F0cheFf7AFftxucPk=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oi0GIBPPpwysuWFKg6Y8V5+ycvMgBlGbO8bsU/IH1csQ8H8OYCxZAcXreJf1h8ju+ Glphvl1FCEiZBPB2BjKyc48z6eIY5mAmuQ4qQ7Q0XziLiUHUR45gQJHjLjwMsy2sSs 0A/FkJHNzYmesavNj9vLc9Vv1NTKursEjQdQ38VI= Received: by simark.ca (Postfix, from userid 112) id 10DD01E356; Wed, 9 Oct 2024 07:46:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=unavailable autolearn_force=no version=4.0.0 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IHCFprmD; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IHCFprmD; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 575FB1E354 for ; Wed, 9 Oct 2024 07:46:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87B3338650E0 for ; Wed, 9 Oct 2024 11:46:19 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BD161385DC1E for ; Wed, 9 Oct 2024 11:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD161385DC1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD161385DC1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728474362; cv=none; b=IxdDPkXcaSJgUrf3utG5wHeUHucGRBA7UMLuJyxfRFe8H5IazH5cP/ks5c1LHNZBMHg+OLJsF4OHfeEQWktJyvbOUWXwHYmVk4gSpI5oyvcQV/unc/KUyuqPYb50MKnRCZwuM8aG431sm7mfKuTmuU3cJw17lOP5nytzp8NB3hE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728474362; c=relaxed/simple; bh=Zwuhe0FiyIF0JfzSI9k6siMMG/F0cheFf7AFftxucPk=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=K8dagfys5yWwp6Ra04ZN/NBYZ+b1xP8RFf4chrJaCz6jHnVsa2Ok+uPQWckTrRrRaDgKUEh+zjqD1t+Gab789E/c1WjtG1EzFM3yrwCP5rlIQrA5WFgpR9i/Fw9lmWibASd44XrgRd6W3E5EDUSpCsnwhMDW5qXNqvd8lFw8dkg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728474358; bh=Zwuhe0FiyIF0JfzSI9k6siMMG/F0cheFf7AFftxucPk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IHCFprmDMp+0DTCDDj2qNG7v/lJQUrsMfUPXv7ELNOIeoV5Bcoqn3XdrSm9yz8yU+ vi43g2rpM6BMX1a6MA3gJAuPLEg2/X43S1xWmtLz6ctVvc4XjVJ0CdnAP2B5szg3mm IcD36DcYtwjQB7ddH6KLVQzU2Ml/PoXi4S50y3XE= Received: by simark.ca (Postfix, from userid 112) id E636F1E356; Wed, 9 Oct 2024 07:45:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1728474358; bh=Zwuhe0FiyIF0JfzSI9k6siMMG/F0cheFf7AFftxucPk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IHCFprmDMp+0DTCDDj2qNG7v/lJQUrsMfUPXv7ELNOIeoV5Bcoqn3XdrSm9yz8yU+ vi43g2rpM6BMX1a6MA3gJAuPLEg2/X43S1xWmtLz6ctVvc4XjVJ0CdnAP2B5szg3mm IcD36DcYtwjQB7ddH6KLVQzU2Ml/PoXi4S50y3XE= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CBDF31E354; Wed, 9 Oct 2024 07:45:57 -0400 (EDT) Message-ID: <952e0e55-b99c-4c24-ae1c-7f3c502bb826@simark.ca> Date: Wed, 9 Oct 2024 07:45:57 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] gdbserver: make arch and osabi names gdb::unique_xmalloc_ptr To: Andrew Burgess , gdb-patches@sourceware.org References: <87msjdbklm.fsf@redhat.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87msjdbklm.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 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 On 2024-10-09 07:07, Andrew Burgess wrote: > Simon Marchi writes: > >> On 2024-10-06 14:37, Andrew Burgess wrote: >>> Convert target_desc::arch and target_desc::osabi from 'const char*' to >>> gdb::unique_xmalloc_ptr. This also allows us to remove the user >>> defined ~target_desc destructor. >>> >>> I doubt it ever actually occurred, but in theory at least, there was a >>> memory leak in set_tdesc_architecture and set_tdesc_osabi where the >>> member variables were assigned without freeing any previous >>> value... but I suspect that usually these fields are only set once. >>> >>> There should be no user visible changes after this commit. >> >> Could they be std::string instead? > > I considered this, but that would, I think, require wider reaching > changes as the API to add the osabi to the returned tdesc passes the > information via 'const char *'. This approach added the memory safety > without requiring any further changes. > > If you'd prefer std::string be used then let me know and I'll update > things. Up to you, I don't mind, it can be done later. Simon