From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iVbCBCRHjmmvYTgAWB0awg (envelope-from ) for ; Thu, 12 Feb 2026 16:33:24 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=Wazuiepl; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 027A71E08D; Thu, 12 Feb 2026 16:33:23 -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 0E4071E08D for ; Thu, 12 Feb 2026 16:33:23 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A71564B9DB54 for ; Thu, 12 Feb 2026 21:33:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A71564B9DB54 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=vrany.io header.i=@vrany.io header.a=rsa-sha256 header.s=protonmail3 header.b=Wazuiepl Received: from mail-24421.protonmail.ch (mail-24421.protonmail.ch [109.224.244.21]) by sourceware.org (Postfix) with ESMTPS id 634C44BA23CB for ; Thu, 12 Feb 2026 21:32:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 634C44BA23CB Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=vrany.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrany.io ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 634C44BA23CB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=109.224.244.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770931974; cv=none; b=MbFCRcJ5Y/5azpN2RkxZ2z8ymN5SWd1A6RSYRa7kJEEjzIeePtbq+K4RalsHQkIJBKZcRd506p9EbQgm9WWgOBVPxv7susY49ZzrZ90SluYyg9EwHs9CokJXoIg7uFGs1n7sHpeyrSlPtzGZOj88KemQF8Onj4dqze9Kf86FL4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770931974; c=relaxed/simple; bh=jYrRlwFb5ODh4hAzU/E157E2qbdE0CVRPaMZcDvJe9U=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=nk3A0h9gjZd+xfp7BwnvbQMV2Vz90/bSF5QKfWshDaMoYQOvJThWebaLrA8LDen+DLpvpKn0FWra/ITkBkV0N7WG8VwFZBaLT4Sx8duxRoZB9VBbrZrH16E6AaJ3mdHa5zcsuTBHYRHIZ/sphCcELFiaClKPJot/vQ6TwPm720g= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 634C44BA23CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrany.io; s=protonmail3; t=1770931963; x=1771191163; bh=jYrRlwFb5ODh4hAzU/E157E2qbdE0CVRPaMZcDvJe9U=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=WazuieplnqxEXKFe0FDq6RPXs9JzAnj2fnzr0r7NmqlyIwPmSLwAtnFiNtF46Mqqo majpurukijxCJr7ouf1lLkW3p/UKKpA67TIpW5wZT9Yx8lE+EVtGacQLJRXIE+WZmw 9YChXhvjErW3GRqIC3ygv+kD3GzqsDJDt/ZL5y+Nn6iJL6mWZeRxUU54CRQHAyH3b0 L31cIV/QaxeR68ksmnRtmP5vCo5B04I46hRZRkh86rSRW/pm6SGS+Hztf9hfERcysD J12Btgo3R5bUasm0zzhTqGlVPaZJgatO4lmrnRCAUFjBaZYS8NqJcZC9wtvoGMQN3r Z485Sco2PvUCA== Date: Thu, 12 Feb 2026 21:32:40 +0000 To: Simon Marchi , Andrew Burgess , eliz@gnu.org, Tom Tromey , GDB Patches From: Jan Vrany Subject: Re: [PATCH RFC 1/2] Remove "readnow" support Message-ID: <93f4d52b8661574c6d7c497923a581610933f0c8.camel@vrany.io> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: 456ba38ae0ae02d4be35af324bc64183f86ee7b8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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-12 at 19:39 +0000, Simon Marchi wrote: > https://inbox.sourceware.org/gdb-patches/945d83fc-5518-4e04-8fe8-ebcca0ac= f0bd@simark.ca/ >=20 > On 2/12/26 8:29 AM, Andrew Burgess wrote: > > Eli Zaretskii writes: > >=20 > > > > From: Tom Tromey > > > > Date: Wed, 11 Feb 2026 11:49:09 -0700 > > > > Cc: Tom Tromey > > > >=20 > > > > I think the "readnow" feature should be removed. > > > >=20 > > > > "readnow" exists basically to work around potential bugs in any > > > > "partial" reader.=C2=A0 This used to work ok because gdb would scan= all the > > > > expanded symtabs in addition to using the "quick" functions.=C2= =A0 This > > > > changed with the "search via psyms" series. > > > >=20 > > > > So now, "readnow" is basically its own separate implementation.= =C2=A0 As > > > > such, I don't think it carries its weight.=C2=A0 It is very slow an= d uses a > > > > lot of memory, and can have its own bugs requiring extra work on ou= r > > > > part. > > >=20 > > > Is there any other way for the user to force GDB to read all of the > > > symbols from all of the object files?=C2=A0 If not, perhaps this > > > functionality still has its value?=C2=A0 Maybe we should make it a "m= aint" > > > command instead? > >=20 > > I second this.=C2=A0 We do run into bugs with the indexes from time to = time, > > and it's good to have some way to tell GDB to go read the full debug > > information so we can narrow the bug down.=C2=A0 Plus it offers a work = around > > in these cases. > >=20 > > Is 'maint expand-symtabs' the equivalent?=C2=A0 When someone uses -read= now > > should we maybe guide them towards the new way of doing things, even al= l > > we do is point towards a particular entry in the manual maybe? >=20 > From what I understand, "maint expand-symtabs" is not an exact > replacement for readnow.=C2=A0 With the recent changes that Tom Tromey di= d > (always search via the "quick" functions), this is how it works when > searching for a symbol: >=20 > =C2=A0- the code invokes the quick_symbol_functions::search method > =C2=A0=C2=A0 (cooked_index_functions::search for the DWARF index). > =C2=A0- if a compunit_symtab looks like it could contain said symbol, the > =C2=A0=C2=A0 quick functions' search method calls a callback, passing the > =C2=A0=C2=A0 compunit_symtab, and the core searches it > =C2=A0- if you "maint expand-symtabs" first, the search still goes throug= h > =C2=A0=C2=A0 cooked_index_functions::search.=C2=A0 So if there is a bug i= n > =C2=A0=C2=A0 cooked_index_functions::search, it won't bypass it.=C2=A0 In= other words, > =C2=A0=C2=A0 which symtabs are currently expanded should not affect a sea= rch (this > =C2=A0=C2=A0 was the point of the change, that was a source of bugs) >=20 > With readnow, the cooked index is not built.=C2=A0 Instead, compunit_symt= ab > are built from the start,=C2=A0 I'm not sure this is exactly how it works. My undestanding is that with -re= adnow, index is not build, but all_units is build. compunit_symtabs are built late= r on and lazily in dw2_instantiate_symtab. In another words, with -readnow all t= he work is done except creation of compunit_symtabs.=20 See patch=C2=A0https://inbox.sourceware.org/gdb-patches/20251124195535.2116= 845-9-jan.vrany@labware.com/ > and readnow_functions is used instead of > cooked_index_functions.=C2=A0 readnow_functions::search goes over the > all_units vector and searches all of them (I wonder if it could use > expanded_symbols_functions instead...).=C2=A0=C2=A0 It could - this is what I originally did in v1 and v2 of what then became expanded_symbol_functions (https://inbox.sourceware.org/gdb-patches/2025112= 4195535.2116845-1-jan.vrany@labware.com/) Jan > If there was a bug in > cooked_index_functions::search, then this would by pass it. >=20 > I don't know if it's really worth having a completely parallel code path > just in case there is a bug in the main path.=C2=A0 That parallel code pa= th > is a source of headaches of its own.=C2=A0 That being said, if we could i= ndeed > use expanded_symbols_functions, then keeping readnow wouldn't represent > much code I think. > Simon