From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3I8DJM76lGlVaj8AWB0awg (envelope-from ) for ; Tue, 17 Feb 2026 18:33:34 -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=ZPoLa4X0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 78D1E1E0BA; Tue, 17 Feb 2026 18:33:34 -0500 (EST) 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=ham 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 884301E08D for ; Tue, 17 Feb 2026 18:33:33 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id F14244BA23D7 for ; Tue, 17 Feb 2026 23:33:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F14244BA23D7 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=ZPoLa4X0 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 09D724BA2E0A for ; Tue, 17 Feb 2026 23:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09D724BA2E0A 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 09D724BA2E0A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771371188; cv=none; b=TL9tiXvhDH/8l0glNA0wmFzUB+64wV9teJWaUEL5Nea6A7jWolNeb/SZJiGjPSLiXoYVsCpHr2NkQjcIrP8iqHJQd8A5m5FGHtgneGbsjUqf3gI89nn7bytVZbiUrBM5maIlYd5dWS+mJ9aVJVcIkcWEC5TJJiHi6k0DPGyrel0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771371188; c=relaxed/simple; bh=1bnlI15Rk5GQrATGwyEeqI/l8DyvYRyOFrBBMRDX9gg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=MvEi7dpwGxYi91FlmOfV9jai9sN1kdAS3bmTKCtTAoUsFr8R8YGYcPBbEwUjae75YJWa2SRwjUzuOTgbb8eoiaFujZ0/CW7sq9YYjTH4vQwRgBFqHDGLi44czuDv6E35X3xtePorNHyDynmYyZMLYCqY0o7iC9H5H6Mzmj/IGP0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09D724BA2E0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771371187; 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=I0YEtrnPz/w+Xhx8219M5z3MV2foqJ2FpWCLUxZ206I=; b=ZPoLa4X0LkP2rZSk/CE+gvIHvoOHtbYvqbpDUPywiEenlvkb6zqV9VnfAVp8Pb3VhVQ+v2 dcpQOIUqdVCV1fknvMtDiQCcDD7eYSjJc2J7bTHa2nxpwABOAzyLSt2GuIe/waX4nHpb88 F3MYlA5tXMo27pTSie/UqcerlXScqWM= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-286-RNNTCWNnN-KgHi_FGXx_IA-1; Tue, 17 Feb 2026 18:32:58 -0500 X-MC-Unique: RNNTCWNnN-KgHi_FGXx_IA-1 X-Mimecast-MFC-AGG-ID: RNNTCWNnN-KgHi_FGXx_IA_1771371177 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C85618004A9; Tue, 17 Feb 2026 23:32:57 +0000 (UTC) Received: from f42-zbm-amd (unknown [10.22.80.38]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 572371956095; Tue, 17 Feb 2026 23:32:56 +0000 (UTC) Date: Tue, 17 Feb 2026 16:32:53 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: simon.marchi@polymtl.ca, Simon Marchi Subject: Re: [PATCH] gdb/solib-frv: remove manual memory management Message-ID: <20260217163253.0a8f635e@f42-zbm-amd> In-Reply-To: <20260217211650.3999842-1-simon.marchi@polymtl.ca> References: <20260217211650.3999842-1-simon.marchi@polymtl.ca> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ieoQSU18U7bMxKGbZlX-zJRwdAl2GFPW44lw6dWVdpg_1771371177 X-Mimecast-Originator: redhat.com 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 On Tue, 17 Feb 2026 16:16:44 -0500 simon.marchi@polymtl.ca wrote: > From: Simon Marchi > > - Make fetch_loadmap return a unique pointer, adjust callers > - Make fetch_loadmap use a unique pointer for ext_ldmbuf > - Replace some fields of lm_info_frv to be unique pointers > - Make main_executable_lm_info a unique pointer > > I can only build-test this. I haven't had access to an FR-V machine in a long, long time, so I can't properly test it either. I found a comment that should be updated... > @@ -102,19 +105,20 @@ struct int_elf32_fdpic_loadmap { > struct int_elf32_fdpic_loadseg segs[1 /* nsegs, actually */]; > }; > > +using int_elf32_fdpic_loadmap_up > + = gdb::unique_xmalloc_ptr; > + > /* Given address LDMADDR, fetch and decode the loadmap at that address. > Return NULL if there is a problem reading the target memory or if > there doesn't appear to be a loadmap at the given address. The > allocated space (representing the loadmap) returned by this > function may be freed via a single call to xfree(). */ The remark about xfree should be removed and NULL should be replaced with nullptr. > -static struct int_elf32_fdpic_loadmap * > +static int_elf32_fdpic_loadmap_up > fetch_loadmap (CORE_ADDR ldmaddr) [Above lines included for context.] Okay with that comment fixed... Approved-by: Kevin Buettner