From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EUDfKqu17miifjIAWB0awg (envelope-from ) for ; Tue, 14 Oct 2025 16:42:19 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=labware.com header.i=@labware.com header.a=rsa-sha256 header.s=mimecast20220511 header.b=ewzpsWNG; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A94F81E0BA; Tue, 14 Oct 2025 16:42:19 -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 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 319A81E047 for ; Tue, 14 Oct 2025 16:42:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4517385843B for ; Tue, 14 Oct 2025 20:42:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4517385843B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=labware.com header.i=@labware.com header.a=rsa-sha256 header.s=mimecast20220511 header.b=ewzpsWNG Received: from us-smtp-delivery-114.mimecast.com (us-smtp-delivery-114.mimecast.com [170.10.133.114]) by sourceware.org (Postfix) with ESMTP id 74DFA3858291 for ; Tue, 14 Oct 2025 20:41:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 74DFA3858291 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=labware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=labware.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 74DFA3858291 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.114 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760474462; cv=none; b=rTuj8LUCZCtbl5J7QVVymYRhYzStZ4WijRdpmMkWW0zNv7pey4g4O2WbncmdFSAIZHqGSsV8kmldZmcC6sCX5CULP4Pmy2Tf+KxyrW2Qnr2R0jrP33vWD605HjUhNkv/yIafIYASB04PBFxNGJ5x2WxtYRufKwv0KqRX16poJBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760474462; c=relaxed/simple; bh=0KT6gJLFDOH1jhiiY5OFsTkrbSD7MzkiW5/el/rMoVk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oTGyNriDVgWqqxUv4T5tiqUeWlljVWRXF6FUjfyYuc+i2O5rTce5IwI2rXPs/X2i4Q+6AS+2coxvaWsf9IfbEg9IrzRUSdkhx4yd1siYSddDuNQESGz5wPTqIsH2mLm9ebSnHOYfVGuUFGadXcE3yJZ9YJ7POS/ehkXzmtbMPms= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74DFA3858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labware.com; s=mimecast20220511; t=1760474462; 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=0KT6gJLFDOH1jhiiY5OFsTkrbSD7MzkiW5/el/rMoVk=; b=ewzpsWNGcHSh8W9zeTbQqodLQbpTsqMeeEdl6HZNpLFfdkY8cy2PSC7idVp6r5lx8NZD4n F9BJGzyHnafv78VmwUqbOO3T8uyFNSErK06qoaL0ECc9QmIQx5y/v8hEjl868eCj4/F9q6 O/rKIcO19UF/uJ4d4edSyfUdpspPDfc= Received: from MW6PR02CU001.outbound.protection.outlook.com (mail-westus2azon11022093.outbound.protection.outlook.com [52.101.48.93]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-524-M450HLGTObKWuGGFfseZ3g-1; Tue, 14 Oct 2025 16:41:00 -0400 X-MC-Unique: M450HLGTObKWuGGFfseZ3g-1 X-Mimecast-MFC-AGG-ID: M450HLGTObKWuGGFfseZ3g_1760474459 Received: from SA1PR17MB5365.namprd17.prod.outlook.com (2603:10b6:806:1d8::11) by CH2PR17MB3896.namprd17.prod.outlook.com (2603:10b6:610:5f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9203.9; Tue, 14 Oct 2025 20:40:54 +0000 Received: from SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::9a:538a:fa42:730e]) by SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::9a:538a:fa42:730e%3]) with mapi id 15.20.9228.005; Tue, 14 Oct 2025 20:40:53 +0000 From: =?iso-8859-15?Q?Jan_Vran=FD?= To: "simark@simark.ca" , "tom@tromey.com" CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH 2/2] gdb: use std::vector<> to hold on blocks in struct blockvector Thread-Topic: [PATCH 2/2] gdb: use std::vector<> to hold on blocks in struct blockvector Thread-Index: AQHcPG6Ellw1Hk1rakOVS9eqt310wrTCCOoAgAAJ+R+AAAPPAIAABhoA Date: Tue, 14 Oct 2025 20:40:53 +0000 Message-ID: <86e1dd07aea13acd5e7ded0217f053a0db64c63d.camel@labware.com> 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> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR17MB5365:EE_|CH2PR17MB3896:EE_ x-ms-office365-filtering-correlation-id: 26b1d957-80e1-429f-2fac-08de0b61f84e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700021 x-microsoft-antispam-message-info: =?iso-8859-15?Q?s4yyabtssELcyot5T3cyq9pfsJwwsrlRbuyf1wOc4nXCCZnMqOQzk3xGj?= =?iso-8859-15?Q?wve/d4BzUnBNZ+OgWyGcuzcAbQVmza78XjUeR0XZ1uKIHXCUqNWs+z3Fp?= =?iso-8859-15?Q?duZJ3J6DgFbUPEsk7XwsHEILMaYHSlz8jPLRgW0TMdVO+pRZRXgzcBhWM?= =?iso-8859-15?Q?o19KkraDnbFsE0SfKbwHNyGPGu00Aa0LyJHAszNgiV71sKUXn9u9rgEIT?= =?iso-8859-15?Q?Npn0tX9U1pEywrThQsfjsmhKuO6xQ7Ew7095oNz0zUcnPO8OYUZdEPNkc?= =?iso-8859-15?Q?Ig/9kzhhOPtGZNe0lWe3qyXdLwFIeWefu2hAfnESZ98hUoffgTXBbbM+I?= =?iso-8859-15?Q?CE7QPZmHc0Nqyx4snn7IdiZLF6S2jsHxEdwN5WVHR9wvi+Iy8SpNBuCmm?= =?iso-8859-15?Q?DEU2NBRYxr3dikgrhF6iHpal7/vAdFXxgO/TxZtq45K67p4zZopCrm3kh?= =?iso-8859-15?Q?zDTb0xopnQ5Kr4rcu5lutsjF2RyD+oyuXpKTyi+U7oxCuHi3fY4Kz7MHr?= =?iso-8859-15?Q?uRiOkvlg/x0U1UM7LBSdhvdgCv3VdQeFP1LiWUlQb5sroGHN2ODW4dS/C?= =?iso-8859-15?Q?pbsj03oUcx4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8859-15?Q?Eb2Hb/io0SzVV4JlNi6ymxftj6eo+NoEkF4McJC+FYRg+ukHfJwSldydI?= =?iso-8859-15?Q?opEOhLb2dLTrr0hpm10RoYmTuFlRn6YilOyVPTGnjet50BHFQU5JiX?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR17MB5365.namprd17.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700021); DIR:OUT; SFP:1102 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-15?Q?BA7m6MHArPN6VNQbP/yzFs2n9anMSgxczzUC+3eOKPhukKHHkP7c5s+u5?= =?iso-8859-15?Q?OYoXPfedCTNuDjEQGb7FBajFqCN7eDtujeUlDSdcZKEwesn8+EWXraaPL?= =?iso-8859-15?Q?CE7LatanS7pmSBEMRW67Hye0riDedkBN9YVlZREeUnGZdQ5yDJbvgUpjO?= =?iso-8859-15?Q?ANVrRiwJ7HpqfOfqdte/4DBFuCNxCWe6OWChgZ6vdo0QlhKrvAdwmGNpE?= =?iso-8859-15?Q?kUBBoQxW49GzjcsEr/i/5tNJw4X5e88HU85Ms9k4P3YdefTHzUfIeMlwO?= =?iso-8859-15?Q?A87FJJm8QwtT3epCGUCqJUi9e9jyg0+A8bCcr+BfvMMVX62WDGpXzsMcL?= =?iso-8859-15?Q?Ke39eDNU3tlIelnqedApawER1ojrdQuISornd8PPfDCxDJrunSEPl+5dL?= =?iso-8859-15?Q?vN7lNE/Xtla6U6NiDSzRsIdRKQ8bF0u9BJO0lOozIESCXCniSZyYzqyXV?= =?iso-8859-15?Q?1IVjRhAMoSuILQsVQqi1ZeBPUZ9Z3Kr3fY985LOMFSwJ/0Grk8uCddAm5?= =?iso-8859-15?Q?dmSiX6vYL8JBzowzAO7P6N0RwbETjQIrEFReQsIDg1Uf5T3YBteHyV2A3?= =?iso-8859-15?Q?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zCRTelfNZNA?= =?iso-8859-15?Q?WndVqACqyvv/0TLRx4iJpQ0jaFQM3AqkkC1IP4SIyejicweldbdTkRfG0?= =?iso-8859-15?Q?4H9t+UPVneQTlpg2X5/Aq+0aer6zslqMhzsxrJnRv+tQdmr12CDKxk55W?= =?iso-8859-15?Q?QDCl1nCWBDhsO906+xsl5/N7g7v+gQccxvE1Q1QplqkBObVqM54hMq+BB?= =?iso-8859-15?Q?yUfYZk5ENzVY5bpjLXoToBS4Ww=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: labware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR17MB5365.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26b1d957-80e1-429f-2fac-08de0b61f84e X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2025 20:40:53.8263 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b5db0322-1aa0-4c0a-859c-ad0f96966f4c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GrdifT4gfTBBTdfjAQ4/H9/Ih92tznQJLNBldIesFvSeUy5n85V4ZG5meVKPdQOtFSTsdZqT85YDjr9ZqaB11Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR17MB3896 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: n3TwNJ_cACPAMk_y3NAA0XtdxZPzb1LXE29L6oztjug_1760474459 X-Mimecast-Originator: labware.com Content-Language: en-US Content-Type: text/plain; charset=ISO-8859-15 Content-ID: Content-Transfer-Encoding: quoted-printable 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, 2025-10-14 at 16:19 -0400, Simon Marchi wrote: > On 10/14/25 4:05 PM, Tom Tromey wrote: > > > > > > > "Simon" =3D=3D Simon Marchi writes: > >=20 > > 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.= =A0 The > > Simon> users of the set_block method are buildsym and jit.=A0 From what= i saw, > > Simon> they could both very well prepare an std::vector with their bloc= ks and > > Simon> std::move that vector into a blockvector constructor.=A0 That co= nstructor > > Simon> could assert that the blocks are correctly ordered, or to the so= rt > > Simon> itself (something that both buildsym and jit do already).=A0 bui= ldsym > > Simon> starts with a singly-linked list (m_pending_blocks), moves the b= locks to a > > Simon> temporary vector (in end_compunit_symtab_get_static_block), sort= s that > > Simon> vector, builds a singly-linked list again, and then traverses th= at list > > Simon> to insert the blocks into the blockvector.=A0 I think that could= all be > > Simon> simplified by making m_pending_blocks an std::vector fr= om the > > Simon> start. > >=20 > > Are you proposing that Jan do this in this patch?=A0 Or is this just a > > future-looking comment?=A0 It wasn't clear to me. > >=20 > > Tom >=20 > Sorry about that.=A0 I would not ask Jan to refactor or clean up > everything in buildsym and jit.=A0 But perhaps we can agree on what a goo= d > (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.=A0 We can > then do some cleanups later to remove some unnecessary steps in buildsym > and jit. At the moment it seems to me that the first step is to drop add_block(), add append_block() and common ordering predicate and take it from there. I'll try to have a look tomorrow. Thanks!=20 Jan >=20 > Simon