From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zbyrEoWyE2kDiTcAWB0awg (envelope-from ) for ; Tue, 11 Nov 2025 17:02:45 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JnoHqwJX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3BD221E0B8; Tue, 11 Nov 2025 17:02:45 -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 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 4B00A1E04C for ; Tue, 11 Nov 2025 17:02:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1AA03858C53 for ; Tue, 11 Nov 2025 22:02:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1AA03858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1762898563; bh=4OeNcoOWY3BEkWvb9h/vCOML1MUXcH+ylb0DfzPNzg0=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JnoHqwJXT1M68NmCt6N9THpIGh/NjA2m52Ccb1RixxE+1Ijvc3L8MAIPh/SkjJGUP sHXCa4BmwjoHa3C8FEebol3DbR65Kt+pDp7e9Zktmanjdidp55roRAbEV2hvsBhDVa f4FoidZ0zWGnBfCIHz/CRrxYeFWSNIVAJUCX62TU= Received: from mail-4323.protonmail.ch (mail-4323.protonmail.ch [185.70.43.23]) by sourceware.org (Postfix) with ESMTPS id 8BFAB3858D29 for ; Tue, 11 Nov 2025 21:44:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BFAB3858D29 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8BFAB3858D29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762897483; cv=none; b=ag6CeqmCHMrvNr1uJHkfaxAemSrt5aX/+IchdpeAPavITk0XEEYr7xF9uSulzLr1vC8DSK+2p+BB0v0ur4VyruBVmWypp5g+jDei31xHBgvxut5nwo6HMx6Uwxmdbp7RDiNDhp8lgTrpk2BayKT9OW/5akoPlMuH7njWlPVPno0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762897483; c=relaxed/simple; bh=4OeNcoOWY3BEkWvb9h/vCOML1MUXcH+ylb0DfzPNzg0=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=JrInRb9MkQcGaluAEvbHHW3Qm3kO9Dbui3gjwLJI7T9CuGScuM4QaKXPHitVdPy4raJ9vw6YI0g8WDqm2KzN3e0pOcXpEq0GTgm0bBFsjuxANWcZ/02MKd3MEfkFBvnxhM8OnTcyF96YmMPrgkLydrSQh5IVyTZP48QqiM7W5rI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BFAB3858D29 Date: Tue, 11 Nov 2025 21:44:34 +0000 To: undisclosed-recipients:; Subject: Re: Internals of -readnow implementation Message-ID: <28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io> In-Reply-To: <28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io> References: <87ms4sxo7w.fsf@tromey.com> <28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: d0533bcb64fb19f5560a31dc2b426f1871cdc708 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 11 Nov 2025 22:01:51 +0000 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jan Vrany via Gdb Reply-To: Jan Vrany Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" On Tue, 2025-11-11 at 14:18 -0700, Tom Tromey wrote: > Jan> looking at how -readnow is implemented, I'm puzzled > Jan> why implementation of readnow_functions inherits/user > Jan> dwarf2_base_index_functions? >=20 > It's mostly a convenience, because that class implements some methods. I see, thanks.=20 >=20 > Jan> My understanding is that if -readnow is specified, then > Jan> all compunit symbtabs in that objfile are fully read. > Jan> It seems to me that in theory one can implement it "directly"=C2= =A0 > Jan> by traversing compunit symtabs, its blockvector and symbols=C2=A0 > Jan> (rather=C2=A0than using dwarf2_per_objfile and alike).=C2=A0 >=20 > Jan> Is that because it was just easier to implement it this way > Jan> or is there a reason why it has to go through DWARF reader > Jan> structures? >=20 > There's no deep reason. >=20 > For this bug: >=20 > =C2=A0=C2=A0=C2=A0 https://sourceware.org/bugzilla/show_bug.cgi?id=3D3355= 4 >=20 > ... I am planning to reimplement it as you say: just search things > directly without regard to the DWARF data structures. Yes! I encountered the same issue when working on Python JIT API and came to the same realization. In fact, I already started working on it and got relatively far in replacing current implementation of readnow_functions but still=C2=A0 have loose ends especially in ::search method. It seems to me that the= =C2=A0 implementations not always match its comment. Jan >=20 > -readnow is weird because it's mostly there as a debugging aid, and > sometimes a workaround for other bugs.=C2=A0 While I have recommended it = to > users, I don't really like doing so.=C2=A0 Occasionally I think about > removing it. >=20 > Tom