From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yVwxK01cmGmztwIAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 08:06:21 -0500 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=IN44JsYh; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9695F1E0BA; Fri, 20 Feb 2026 08:06:21 -0500 (EST) 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 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 C0E5A1E089 for ; Fri, 20 Feb 2026 08:06:20 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id C914B4B9DB71 for ; Fri, 20 Feb 2026 13:06:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C914B4B9DB71 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=IN44JsYh Received: from us-smtp-delivery-114.mimecast.com (us-smtp-delivery-114.mimecast.com [170.10.129.114]) by sourceware.org (Postfix) with ESMTP id DECC84B9DB40 for ; Fri, 20 Feb 2026 13:03:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DECC84B9DB40 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 DECC84B9DB40 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.114 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771592629; cv=none; b=bC/3XIug0bGJfku5m1pjZ3HSyY+3DEMj+5C3fNWtB77KTGDVAp9PBJdZfMF78OK0VSYyV9jzl6NGLxkU0ZBVD06EgkFDxIR+OYKTqE996uR5ySq4KxJY6dqZf8Gr6H+VS6g+cM2KIsnDwvsSljkNeVx9DPqEpOzzhiQcYKZYnZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771592629; c=relaxed/simple; bh=fKGeo8ex3oH6sGl/a5MZZdLCHx8K08nEJfrA2v2PZZg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=inD5YT/rGYXwLpL6jXWMSmaYntWxDPrHIlcR948vjQP/TJRiLv+AtEpIEf1XAG34c/yAyLX40PVJLezmLxPbmTkP4D6QtY8DWjh6YvsRcA2pRjX4lDybrLwRi0X4+iS1/i0Ii/Nnj2anqHp6BO344utRzHhW4qIWq7qUGsIbLkY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DECC84B9DB40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labware.com; s=mimecast20220511; t=1771592628; 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=fKGeo8ex3oH6sGl/a5MZZdLCHx8K08nEJfrA2v2PZZg=; b=IN44JsYh+dlQuRgc9pRD0MhjYGAQDlyw8oX8OocfFDsMjkJ1ZHrMp/iv2enD1YY/1aJ2oL SipFqH/pTzW2DjZkqaReIiBaYt8pGT6kYhutpxKyBXmRXGCLvKpjuSdrOgvzBatR9F/iIJ DlE6xJ/25a2NDHezqJ17YhSxqxWVVGk= Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11022136.outbound.protection.outlook.com [52.101.53.136]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-yOsHcv9YMTq-0TZV1XDoPg-1; Fri, 20 Feb 2026 08:03:47 -0500 X-MC-Unique: yOsHcv9YMTq-0TZV1XDoPg-1 X-Mimecast-MFC-AGG-ID: yOsHcv9YMTq-0TZV1XDoPg_1771592626 Received: from CO1PR17MB5369.namprd17.prod.outlook.com (2603:10b6:303:e8::10) by DS4PR17MB7806.namprd17.prod.outlook.com (2603:10b6:8:328::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.14; Fri, 20 Feb 2026 13:03:45 +0000 Received: from CO1PR17MB5369.namprd17.prod.outlook.com ([fe80::c9b4:108c:cf02:e200]) by CO1PR17MB5369.namprd17.prod.outlook.com ([fe80::c9b4:108c:cf02:e200%5]) with mapi id 15.20.9632.017; Fri, 20 Feb 2026 13:03:45 +0000 From: =?iso-8859-15?Q?Jan_Vran=FD?= To: "tom@tromey.com" CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH 5/7] gdb: update blockvector::lookup to handle non-contiguous blocks Thread-Topic: [PATCH 5/7] gdb: update blockvector::lookup to handle non-contiguous blocks Thread-Index: AQHcodGwsY8oa50AXEqdYjGHVk81GrWKdt4vgAEYLIA= Date: Fri, 20 Feb 2026 13:03:45 +0000 Message-ID: <809ee2577c174ff8134955d3d77d4b8fdd42f897.camel@labware.com> References: <20260219185638.360694-1-jan.vrany@labware.com> <20260219185638.360694-6-jan.vrany@labware.com> <87wm0832p4.fsf@tromey.com> In-Reply-To: <87wm0832p4.fsf@tromey.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR17MB5369:EE_|DS4PR17MB7806:EE_ x-ms-office365-filtering-correlation-id: 045bced5-19b4-4119-95e4-08de70807ac8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700021 x-microsoft-antispam-message-info: =?iso-8859-15?Q?S6yXijKpgIHWt2bPxaNybuo8si1hRMpvrKGX0w/7CvMYJHUbxNzMGHYK8?= =?iso-8859-15?Q?HTGUxJsrrsUF+M+pztqbBdRojDIT/E/hjKCiC+P9TrNJVGtN3M7CPWw2H?= =?iso-8859-15?Q?CCeiaLjSNxrsbhe4KaFzKT2OsONgyCBo4T2LslPVOL3CeN0swyLKW73X7?= =?iso-8859-15?Q?sEID2pMGYQlUpAbOZJf/tItcQP9xQIciyXl9qkhAeh+n0OTFPwKOQq2xC?= =?iso-8859-15?Q?pGozaBTwxbend9RvUkEUYNYv4l8mKojImzgdA7efz3cGp+M2wnSTnT8sP?= =?iso-8859-15?Q?4Dx5OvKsn9aUiKRKe3zg/L0iS/hZXRbKskCbBDjWCeRMgfCGoaMwdfC56?= =?iso-8859-15?Q?6D80hbiyi+dBXZv8Edupq8m+F13T98SwF/+jo524ZzaLlX2iEqnkmeG2S?= =?iso-8859-15?Q?z6yI/mToliWr3NKjI1dH9yYCPRas5Tk1hvqAalgrcWJ1q1Kd/Fdbvojkd?= =?iso-8859-15?Q?zP0qWJzK7XsPRYoR/Z4rXIj4COBn9bAOrl+McIezesJUBuOiK4FAWVIyG?= =?iso-8859-15?Q?/vPmaps8XIEfWbfF7eRK1sOuG5rl5kMVHQhDLdLobXIufUtMkbTlI9VIH?= =?iso-8859-15?Q?JoE+Zdo3jbC2Teb3WmaScjAWemK0L2qT0A2vP4bhzDtqellKGrpRVA5mf?= =?iso-8859-15?Q?8cdGJpTWegOTamSUDLxFF13tu5ox2A0MTojA66RAsR/YhFObm5+yKh5vG?= =?iso-8859-15?Q?+H0JGK+sFlip/lnclKSk5ytdM1KMMPGRCnu7e1WQYexL0z3JWtul99Ne4?= =?iso-8859-15?Q?5vNqCxgAMtECxfkCI5sk84EuQU7GlnGZOW2uYznuCSBup6fx1r16H79VE?= =?iso-8859-15?Q?wIlgFn1R39aZ+8056Nc0FwGwmHfM1yyZuiUu67iZ2FTYg/srpW47B4Yps?= =?iso-8859-15?Q?5UVYcbzSkrzMol4uaNk/6HsgHcJguOXCpdl9nWziphAqP3SpLK1fXKLYM?= =?iso-8859-15?Q?zvC7lY3UUdzmd/dJ4H893dvmZgB3CE5ZXEhcIYmrClzsDF4kXcXFMcWvk?= =?iso-8859-15?Q?Aw7TP1PQJD3c688K47yKwDk3hK0ICtN3ghCUgiyX3vTUJwnssMEVoAhd8?= =?iso-8859-15?Q?snVwtUBtAoGAmRyGbJqXSNLuomdm0wbpX80dt0SHntz3RXtyXRuVo07pl?= =?iso-8859-15?Q?wnfM91EMg8yqxSmGs9NwzGYTQZdlniKm9oxorkLGHxnpvsOaKeJGXo6V9?= =?iso-8859-15?Q?Dfec8b9qxraNzT7QRJKa8Ym3AYzzTyVfcPoZK82TltC01+axYJsIWVoaA?= =?iso-8859-15?Q?e+c4hD1zIUPL4WA9y5bsvPaep0oR17ozO7xHY70ytvUv3V5zPV/EkMJbT?= =?iso-8859-15?Q?pYWs5qyqPV6XJBAtY1YaqHYXUaatbHM/EQK6BCN6Z5nnNjCsZHTehO9+6?= =?iso-8859-15?Q?oPar/LD7kEZOxELTtCCirD+lR1il54HYr1RPQsh67psAQkqUAWrjKZl9j?= =?iso-8859-15?Q?I/f3I5YEN3xUgUd4vVYKa+3qNwcDT2XBdA5nw5rs7DsC7B0aKoK2ElnYH?= =?iso-8859-15?Q?09MveaYv/AbxN+I8woKNnVzhrUrTVJiCNpqeYxqfwXlG5a3kAdq/HAE6U?= =?iso-8859-15?Q?h14hf6XL682saC8ZHdsVUlTiLHg4BPGZmaKHbXi16uNDNTZ5DEQlpHpK2?= =?iso-8859-15?Q?Cfx9DlBqL9KL58qHbdvk0pR0UN1S/2lUDI+rwK3AlAl1f7K/rZmUCkI1C?= =?iso-8859-15?Q?wPlekEAKfftuc7vmDEz2Lwv4AnBYKxWTvr5WC1c600L5Mq8=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR17MB5369.namprd17.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700021); DIR:OUT; SFP:1102 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-15?Q?Tz0DL9f3TPhjXIgr8j86zDTJkYfPFQbRSUT2qNi07vSOjx1zCrV9uM37E?= =?iso-8859-15?Q?1YDhbUczLwWMrbxlH15eT3YYgKp6nGJejaHuxV5LlIbvdqP+D2paNw7Wp?= =?iso-8859-15?Q?qqxVRN4L5MebYM95jE7e7oZOQqDpvRJoG2UKLF11jW7jj5Bjq9h6JHaar?= =?iso-8859-15?Q?YRf6PR50x+VQHosaxKAMMpiJ2HOpNcZ+PlBk+LOsVwLSTLOH22F2gdWzM?= =?iso-8859-15?Q?hE6/F82OT4u8HxjPI2qFdAMHrt3e6DCqC9XU5LPcAiLGgI5zvm5VeUzyW?= =?iso-8859-15?Q?s8l53dmfW8DRPA1IeaNBibOl7chD03wfKcqmXJr3GS/k1kyWiLf6ngDMa?= =?iso-8859-15?Q?9cW6DnKYizIfQMz+sWjGX0JLwbiv2oalB0OBVIeKo8ScevHidsjkDFcQy?= =?iso-8859-15?Q?E1QvA2y5ICgC1NnuMGZSLrKmQdaZwcil9qTkebT3vGthWiDlSggaB+v6m?= =?iso-8859-15?Q?NlZeI5KqVWgfNGcn/I03P7gIRV2l5KDgThNWQiC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1N910frT30Gm+j1m0x26I4NOVVWBk/qzMvTKdjr0tVngl8/?= =?iso-8859-15?Q?M2egPjDQKm24qlEA/Kldnz1JC/FxIGL9IOVQU7vEdpH+fh8hnSccXshlk?= =?iso-8859-15?Q?wjm/Tsaa6yIdtMf2AnTWqijnZL8c/ZJwK9pIryD5gkumRMGhDXsUeeqG7?= =?iso-8859-15?Q?qnztnO3Ze2VRssNLuk8LdseC/4NnlNdaM22TWqkFXAwHi6m0SwASQdrzA?= =?iso-8859-15?Q?DoW+NAUeH2g8kPztT3mCgY8rugirtCPvns2ACGrorV0/mv6XkjUJfJ020?= =?iso-8859-15?Q?Ga/73OOgD9aNmk/avWQgnWMUAtWVcC4qUvTkjdQrPCM3i2wX5Hc+mrSwS?= =?iso-8859-15?Q?YVzsOOPFtV1rh4ITCwaW2uydcysCKdvdPweWI0jsDD/SxvkCEyNz6iQW5?= =?iso-8859-15?Q?2aJLRDMn/u+DCl65/CrsgJodRv4zBVhZdEr1fTJA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: labware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR17MB5369.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 045bced5-19b4-4119-95e4-08de70807ac8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2026 13:03:45.1106 (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: vQ5K5ogJKTyzJLqpfnvZwVn+mOAZOM9hAftjelD2ypzUoLAuHSdRT0nLi6i5MwdEkSCcbSu8qxppQYSJaUsQOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR17MB7806 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fXfwJhdG1yIEr8VtQZylgr3fYytqz9xiDfK55dxL02Q_1771592626 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 Thu, 2026-02-19 at 13:20 -0700, Tom Tromey wrote: > > > > > > "Jan" =3D=3D Jan Vrany writes: >=20 > Jan> This commit updates blockvector::lookup to handle non-contiguous wit= hout > Jan> help of addrmap. It introduces a new method, block::contains(CORE_AD= DR), > Jan> to check whether given block contains given address. This new method= is > Jan> then used in blockvector::lookup instead of simply using block's > Jan> start and end addresses. >=20 > Jan> A unit test for non-contiguous blocks will come later in this series= . >=20 > Jan> On Debian x86_64 I see no regressions except >=20 > Jan>=A0=A0=A0=A0 FAIL: gdb.dwarf2/debug-names.exp: print _start >=20 > Jan> This is caused by discrepancy between the debug info and the debug n= ames > Jan> and will be eventually fixed in a separate patch. >=20 > I glossed over this before but is this patch in this series? No, this is the patch "Fix debug_names function visibility" from your=20 branch you said you'll check in [1]. I can include it if you prefer. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=3D33829#c12 >=20 > Jan> +bool > Jan> +block::contains (const CORE_ADDR addr) const > Jan> +{ > Jan> +=A0 if (addr >=3D start () && addr < end ()) > Jan> +=A0=A0=A0 { > Jan> +=A0=A0=A0=A0=A0 if (is_contiguous ()) > Jan> +=09return true; > Jan> + > Jan> +=A0=A0=A0=A0=A0 for (auto range : ranges ()) > Jan> +=09{ > Jan> +=09=A0 if (range.start () <=3D addr && addr < range.end ()) > Jan> +=09=A0=A0=A0 return true; >=20 > It took me a long time to understand that this patch was doing the real > work in this series... >=20 > For this method I guess there is an invariant that the block's start is > the minimum of the range minima and the block's end is the maximum of > the range maxima. >=20 > It seems to me that since this is an important feature, it ought to be > enforced by an assert, if necessary adding checks in the reader to > ensure that bad DWARF doesn't cause an assertion failure. Yes. I originally had these assertions there, thinking that blocks's start is first range's start and end is last range's end but it turned out there'= s no defined ordering (and DWARF5 spec does not say IIUC). So I'd have to iterate over ranges to find min/max to use in asserts. I did= not do it in the end, but doing it in block::set_ranges probably won't hurt muc= h.=20 I'll do that in v2. Other option I was thinking was to change make_blockranges to always sort t= hen, then the assertions in set_ranges would be trivial and in block::contains o= ne can binary-search block ranges too (though for up to ~4 ranges perhaps not = worth). >=20 > Jan> @@ -857,7 +876,10 @@ blockvector::lookup (CORE_ADDR addr) const > Jan>=A0=A0=A0=A0=A0=A0=A0 if (b->start () > addr) > Jan>=A0=A0=09return nullptr; > Jan>=A0=A0=A0=A0=A0=A0=A0 if (b->end () > addr) > Jan> -=09return b; > Jan> +=09{ > Jan> +=09=A0 if (b->contains (addr)) > Jan> +=09=A0=A0=A0 return b; > Jan> +=09} > Jan>=A0=A0=A0=A0=A0=A0=A0 bot--; > Jan>=A0=A0=A0=A0=A0 } > =A0 > The heart of the series. >=20 > I wonder about the efficiency of this.=A0 Like how many blocks can we > expect to see in the linear phase? >=20 > I don't know what a representative program might be here. TBH I have no idea. How common is this, how many ranges blocks have, nor how to force compiler to produce such binary. Maybe torturing the compiler with -O3 and PGO? Jan >=20 > Tom