From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i3wUALhwl2kN1AEAWB0awg (envelope-from ) for ; Thu, 19 Feb 2026 15:21:12 -0500 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=XC9F9O9W; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D53CA1E08D; Thu, 19 Feb 2026 15:21:11 -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.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 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 0BE931E08D for ; Thu, 19 Feb 2026 15:21:11 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A40E94BA23E0 for ; Thu, 19 Feb 2026 20:21:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A40E94BA23E0 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=XC9F9O9W Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 101D34BA23C0 for ; Thu, 19 Feb 2026 20:20:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 101D34BA23C0 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 101D34BA23C0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771532443; cv=none; b=cZ5PjotmmS8Re42IUndeDJ8PgT7McT4Ght+dg80YkhpT5x11nIR2i5G8ioYaGxEfnq4uYMwDGwltb0nEtGm7FM50Dw0/J1fKzFX/ubM95s5S2HG3J/e11pTZ3m0FhJ5LIb1DKWO/uVH9nfizA1+kDV9Kgw798Fiec2o1TSsj8ZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771532443; c=relaxed/simple; bh=CXGG47OrPIE2Tf9TuorYBsnucES/7k/xQPpSLrG1OIo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R4NGACn7TmFJYx4hdyrVweLrKh/QkyRN9ZeZle86Kt7/dgKi5in+c7AMy+z0gkiWLgtUcP9xBPd7bimdyUwOB34T63fnYlRU9LV63VR3yTu6+9/qQ12/Ye7GWuyf+YkyN1lDV6UO5dQ8gQDwjuCRiE66vjG2EuDkzwjIVl1MSUI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 101D34BA23C0 Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id sw8yvAGAKSkcftAVuvQ1J3; Thu, 19 Feb 2026 20:20:42 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id tAVsvADoKvXvHtAVtvz6PB; Thu, 19 Feb 2026 20:20:41 +0000 X-Authority-Analysis: v=2.4 cv=e4IGSbp/ c=1 sm=1 tr=0 ts=69977099 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=TDl5R864AAAA:8 a=h-SsN3BCJ8038zlFAQUA:9 a=4IKI_MBedZsHOhguCAbN:22 a=DCx65vhANUyCzuf5D8fC: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=9zE5pTngIgjrdCxBjvUXfyPw4Eg3qrgP0QMLZk2mFrM=; b=XC9F9O9W3UEsYhHUQlmGQ7eF9i REDkJ5bPlcy+Ro5rP4vTznX4YpdDDENyfpV4jaQQ+c1w12YXBBp9gsfkl5Z1xEypNxt/DHG+Mv5k7 f8Iokv3dbn3JzRlTTrvHTXbeT; Received: from 97-122-122-234.hlrn.qwest.net ([97.122.122.234]:44968 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vtAVs-00000004Al4-39sI; Thu, 19 Feb 2026 13:20:40 -0700 From: Tom Tromey To: Jan Vrany Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/7] gdb: update blockvector::lookup to handle non-contiguous blocks In-Reply-To: <20260219185638.360694-6-jan.vrany@labware.com> (Jan Vrany's message of "Thu, 19 Feb 2026 18:56:36 +0000") References: <20260219185638.360694-1-jan.vrany@labware.com> <20260219185638.360694-6-jan.vrany@labware.com> X-Attribution: Tom Date: Thu, 19 Feb 2026 13:20:39 -0700 Message-ID: <87wm0832p4.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.122.234 X-Source-L: No X-Exim-ID: 1vtAVs-00000004Al4-39sI X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-122-234.hlrn.qwest.net (bapiya) [97.122.122.234]:44968 X-Source-Auth: tom+tromey.com X-Email-Count: 14 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAnAXz/FXYoyTbvAkqTQb+APlMSV9NcrrC+3+yZoJlvfs8+b6ckj9VpKI3KfeiqFk0XCTCBuQ8eeKO1oh/bafbNGjg1ho1eyLZJpUFTP0jMtirK0twWW 4j2EruDXtOI5skZhPHOURTdwnyyIZXYCJvmaoRI/MAN9+zW0m1S0SeJLs+T5GFta4Fe88OMtRPMcQn6q+Gx/+fod5/U2+BKqZR4= 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 >>>>> "Jan" == Jan Vrany writes: Jan> This commit updates blockvector::lookup to handle non-contiguous without Jan> help of addrmap. It introduces a new method, block::contains(CORE_ADDR), 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. Jan> A unit test for non-contiguous blocks will come later in this series. Jan> On Debian x86_64 I see no regressions except Jan> FAIL: gdb.dwarf2/debug-names.exp: print _start Jan> This is caused by discrepancy between the debug info and the debug names Jan> and will be eventually fixed in a separate patch. I glossed over this before but is this patch in this series? Jan> +bool Jan> +block::contains (const CORE_ADDR addr) const Jan> +{ Jan> + if (addr >= start () && addr < end ()) Jan> + { Jan> + if (is_contiguous ()) Jan> + return true; Jan> + Jan> + for (auto range : ranges ()) Jan> + { Jan> + if (range.start () <= addr && addr < range.end ()) Jan> + return true; It took me a long time to understand that this patch was doing the real work in this series... 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. 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. Jan> @@ -857,7 +876,10 @@ blockvector::lookup (CORE_ADDR addr) const Jan> if (b->start () > addr) Jan> return nullptr; Jan> if (b->end () > addr) Jan> - return b; Jan> + { Jan> + if (b->contains (addr)) Jan> + return b; Jan> + } Jan> bot--; Jan> } The heart of the series. I wonder about the efficiency of this. Like how many blocks can we expect to see in the linear phase? I don't know what a representative program might be here. Tom