From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Bmg7ATqx7mhLczIAWB0awg (envelope-from ) for ; Tue, 14 Oct 2025 16:23:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1760473401; bh=CZcKYr082uFdPdsD5fukhtDlbquBPmc9zfwszn7AODo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j4oFD/mtHmPcJFJlQ1stTXer6b06BvPRx7/0yY/2gre3/2Q4BowK90xiZDFN3XL6O E9Nrf6hTn7DWp+4eUCOecYbXcKDRTGHACthRaA4LTgIjw8vB2iDpsUchscQ3MrVXhc ixYRl4PLgD07b/DjLicE1ysG3XSBQ5048q/b99xg= Received: by simark.ca (Postfix, from userid 112) id E308F1E047; Tue, 14 Oct 2025 16:23:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 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=OulTIZEB; 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 CB9161E047 for ; Tue, 14 Oct 2025 16:23:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 583EB3858433 for ; Tue, 14 Oct 2025 20:23:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 583EB3858433 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=OulTIZEB Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CBA3F3858415 for ; Tue, 14 Oct 2025 20:19:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBA3F3858415 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 CBA3F3858415 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=1760473142; cv=none; b=kVNK4oz9mJF53AK/tt48hMFpM3CJJHg2uBmKlUdZSsvXNWY0lH2r95WdxcLwSbLFbABTiYqHfkvgIWmjYun0LiqGtRK+URGslAHkDTViu3gQZYsvypA9c1bGIgY5XOKZUBLJnsr0Cs3GOOHKepKqRcdR2jMgNmFA3R83mY6AVis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760473142; c=relaxed/simple; bh=CZcKYr082uFdPdsD5fukhtDlbquBPmc9zfwszn7AODo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=tzGfMzlFJwWR1rJg5v/QLpexBCTD6TbHK9i2Oa2czaOyxd1bMkmURFIzfHC9l+IR02KlovbJlwk1kBxJ7PkWapbEfSWewE4imMBzHz3gyjjwX82lyqPrDXrn1c0rX55K0ObHJ1KkkUfS3mbQyv4sLSDQGyyDUTIoEyBZ61xQs9c= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBA3F3858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1760473142; bh=CZcKYr082uFdPdsD5fukhtDlbquBPmc9zfwszn7AODo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OulTIZEBSyJJ0RIJiW7ES1xtgKtbQ54WwfQK0HvIymkC0Q/QojPpNrEL3gd0EhGFE wO9+yebYiIWJKcYIcnNC7SKBV88bc3rgwniGwl0lgdUsLkcuzkloh4Z5NxKEDRlYyz 1XHMrEQN4L0255HtZ7bsiy0wNaOBw0G0qQIpG83o= Received: by simark.ca (Postfix) id 6D4571E047; Tue, 14 Oct 2025 16:19:02 -0400 (EDT) Message-ID: Date: Tue, 14 Oct 2025 16:19:02 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] gdb: use std::vector<> to hold on blocks in struct blockvector To: Tom Tromey Cc: Jan Vrany , gdb-patches@sourceware.org References: <20251013182318.1045138-1-jan.vrany@labware.com> <20251013182318.1045138-3-jan.vrany@labware.com> <706dd0b5-a1f0-4cdb-bd41-b3b1a2bbac3a@simark.ca> <87qzv5tfkd.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87qzv5tfkd.fsf@tromey.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 10/14/25 4:05 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> I also wish we could avoid having a "set_block" method, because it > Simon> requires having the blockvector in an invalid state (some blocks slots > Simon> set to nullptr) while we build it, which could be error prone. The > Simon> users of the set_block method are buildsym and jit. From what i saw, > Simon> they could both very well prepare an std::vector with their blocks and > Simon> std::move that vector into a blockvector constructor. That constructor > Simon> could assert that the blocks are correctly ordered, or to the sort > Simon> itself (something that both buildsym and jit do already). buildsym > Simon> starts with a singly-linked list (m_pending_blocks), moves the blocks to a > Simon> temporary vector (in end_compunit_symtab_get_static_block), sorts that > Simon> vector, builds a singly-linked list again, and then traverses that list > Simon> to insert the blocks into the blockvector. I think that could all be > Simon> simplified by making m_pending_blocks an std::vector from the > Simon> start. > > Are you proposing that Jan do this in this patch? Or is this just a > future-looking comment? It wasn't clear to me. > > Tom Sorry about that. I would not ask Jan to refactor or clean up everything in buildsym and jit. But perhaps we can agree on what a good (easy to use, hard to mis-use) API for blockvector is, and then Jan can do the bare minimum to wire up buildsym and jit to that API. We can then do some cleanups later to remove some unnecessary steps in buildsym and jit. Simon