From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Wm2/Me34/2gghgwAWB0awg (envelope-from ) for ; Mon, 27 Oct 2025 18:57:49 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=M56pZuuQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B98611E057; Mon, 27 Oct 2025 18:57:49 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 E12B71E057 for ; Mon, 27 Oct 2025 18:57:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 743523858D2A for ; Mon, 27 Oct 2025 22:57:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 743523858D2A Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=M56pZuuQ Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 5BB733858C60 for ; Mon, 27 Oct 2025 22:56:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BB733858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5BB733858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761605811; cv=none; b=xLMMIycj2yDLQfMBjEsA6trK+uvCZpC0iGzquWyjz16pH4KodmrxcFiOergHMkcnMDVp3sna6l6kqnuK1G0x6YDL2EP2Iw/ZP7jJlxnegbmqRFj/9xJD+lIAYhO/Y0e2Ocz8mzGDVrwOB87f2QMmJOUAov+1RB8Nv9d4ctOlWB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761605811; c=relaxed/simple; bh=qINFY3Sry6rEn/8hmrD16FC/Wf7Hn1c8uD5zL94vHM8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wMCeoWNt4Txp1h4uHm6zTEoRZAoOXqkVUfZvQQPAEP2cVV91Tu7xpv0KEnpL04XhB26Hr9OykQb3aZu5kMtcu6ntgWGqRrccGlT078HjLg3GIYBKS3WFwwKr/nXP3wPrP7C2Vv4NZaK/9Ly5tlyFL6RWn5skPaWgo2Xu5Jsr+Tk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BB733858C60 Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id DUJyvxAFUaPqLDW8wvr4iH; Mon, 27 Oct 2025 22:56:50 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id DW8uvggdHHjyIDW8uvViq4; Mon, 27 Oct 2025 22:56:48 +0000 X-Authority-Analysis: v=2.4 cv=Ys4PR5YX c=1 sm=1 tr=0 ts=68fff8b2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=x6icFKpwvdMA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=zstS-IiYAAAA:8 a=asim2fK3iPpHqw6k3-cA:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=VS4QxaUSPT0UtbFnIvSC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Uem2fHzQPYxy7gwJCxoBWffvAwzpbSh9nQ39Z8Z3hxQ=; b=M56pZuuQfSB6wG6M+L/kKOrGjm rd+POfY0vKWYPLPPtUcEpUgCFsrQdiFPefvUD4DGx+tutgjl6/tPNuW6O/BcY14O0yArGsHXaQCWt SYiYOStNxG9JZ8ymvrKYNhyNW; Received: from 97-122-110-68.hlrn.qwest.net ([97.122.110.68]:43456 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vDW8t-00000003hwD-37fp; Mon, 27 Oct 2025 16:56:47 -0600 From: Tom Tromey To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCHv3 5/7] gdb: create address map after parsing all DIE In-Reply-To: (Andrew Burgess's message of "Thu, 16 Oct 2025 18:49:51 +0100") References: X-Attribution: Tom Date: Mon, 27 Oct 2025 16:56:46 -0600 Message-ID: <87ikg09cnl.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.110.68 X-Source-L: No X-Exim-ID: 1vDW8t-00000003hwD-37fp X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-68.hlrn.qwest.net (prentzel) [97.122.110.68]:43456 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfGgEcE+AZF9s7Wu/7zAgmIr8tr2UtZMBbB0U5tSOoG1WqO6LkRoENmdQx9cQ8R5JIcHOG3qC0NUrX6TzaCFdM2PNsjiSMj9ZBoGxHHjg94XZ9BZ08/C+ PC3kwSWJpZRpI3LVGlDlf5SmKpPypjYkdZoaxdlGJiQk6503+WXvuRrVteITn1+W8L5RPv55Q9dSynfJcZHoeC93TkPBTZN9su0= 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 >>>>> "Andrew" == Andrew Burgess writes: Andrew> Continuing the work done in the last two commits, this commit defers Andrew> building the addrmap for a blockvector until after all the DIE have Andrew> been read, and the line table processed. Andrew> The benefit of this is that any changes to a block's ranges done Andrew> during line table processing (see the next commit) will be reflected Andrew> in the blockvector's addrmap. Andrew> The alternative to this is to build the addrmap as we initially see Andrew> each block, but then adjust the addrmap if we later decide to modify a Andrew> block. I think defering the addrmap creation is cleaner, and is less Andrew> work overall. Andrew> The addrmap requires that we add the most inner blocks first. I Andrew> achieve this by walking the blockvector backward, as we always add Andrew> parent blocks before their more inner child blocks. I wonder if this is guaranteed to be correct. Like, does gdb cope properly if a compiler happens to emit multiple lexical scopes that each have non-contiguous ranges, and then where the ranges happen to overlap. However I think your patch probably does not make gdb worse in this regard. Andrew> @@ -410,8 +410,6 @@ buildsym_compunit::record_block_range (struct block *block, Andrew> if (start != block->start () Andrew> || end_inclusive + 1 != block->end ()) Andrew> m_pending_addrmap_interesting = true; Andrew> - Andrew> - m_pending_addrmap.set_empty (start, end_inclusive, block); Andrew> } I think the comment before this method and the comment in the method both need to be updated, as this doesn't actually record the range any more. I wonder why buildsym even tries to see if the pending addrmap might be interesting. It seems to me that a fixed addrmap is basically the same data structure as the blockvector: it maps addresses to blocks and uses a binary search to find the correct entry. So I'm wondering if, in the longer term -- you definitely don't need to to this here -- if we should just switch to a single representation. Furthermore I was wondering if it makes sense for blocks to even track their ranges. That is, for a block with multiple ranges, could we just have multiple entries in the blockvector and get rid of block::m_ranges? FWIW I've been looking into this area a bit while experimenting with lazy CU expansion. There I think I want to make it so blockvectors are always expandable, so no fixed addrmap at least -- and mutable addrmaps have some issues with updating, so probably moving to just having a vector. Anyway this seems fine with the comment cleanup. Approved-By: Tom Tromey Tom