From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +OwzAENbBmg2VD4AWB0awg (envelope-from ) for ; Mon, 21 Apr 2025 10:50:43 -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=JqfFzh0K; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EFDD21E0C3; Mon, 21 Apr 2025 10:50:42 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2 autolearn=unavailable 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 82E6E1E0C0 for ; Mon, 21 Apr 2025 10:50:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D0673858C42 for ; Mon, 21 Apr 2025 14:50:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D0673858C42 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=JqfFzh0K Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 8B48D3858D37 for ; Mon, 21 Apr 2025 14:50:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B48D3858D37 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 8B48D3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745247006; cv=none; b=lq57xUfVeu4jlWQhAgL1Dk47typSYSLnsQoQL9a7Ck8qb8fQl3FNY6JnFnmSnGMMlhCwujOTE3WWQVrpiI1q/JCc8UhzQc7Oa0UwTDcp9eFnwKEDxP+zU04HgE4OaYuPNEQ7d3nESiHdlw2yE8w6JBeuTdgLFGFR/QK3eBuq2BE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745247006; c=relaxed/simple; bh=cG8NrooqxBkKYt7evNzRgStxYtSwr2WG9jZtpsnoVNQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GYpZ9OHh34I1BzSSEAX++LJioYmTq0vVMruM1SV+WfIRarn9D1/UE44qcDsUbMrq+GKBaHQqLy6LwqMV8Re6OQnf6CAPP+p1jf+tE0utNqYAQMZ2jZSOBZgaERJglCG+sdem0WjpKId6T3+2mPO55c+YmVVuB/efI5CQl+1gEuM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B48D3858D37 Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id 6s8ZuVHBGMETl6sTFu9dhD; Mon, 21 Apr 2025 14:50:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 6sTEuRWeQ1vNy6sTEu2FoU; Mon, 21 Apr 2025 14:50:04 +0000 X-Authority-Analysis: v=2.4 cv=VMQWnMPX c=1 sm=1 tr=0 ts=68065b1c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=XR8D0OoHHMoA:10 a=ItBw4LHWJt0A:10 a=dzWzf_mpAAAA:8 a=pOwDVph8gUAyf_njLD4A:9 a=b4DR9a7p2ZdsqdHBznES:22 a=6Ogn3jAGHLSNbaov7Orx: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=Rfut/Ah8DCtmXlBB4BxVbJhH9GfgQY4ZJZzCwBzvbmc=; b=JqfFzh0K48lb1mXj8udXGGAMFV pzA2I9pVc3ChEdd1gN0K+pZyJzMR7YzM/WGtFiH4EbUIY4hYzrs6ROiPRthl6Acdf9DXBRl/V8oaD HL2BSpjZaz5PNN/ugk0r7lKSZ; Received: from 97-122-115-172.hlrn.qwest.net ([97.122.115.172]:57788 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1u6sTD-00000000oFk-2A0Z; Mon, 21 Apr 2025 08:50:03 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2 03/28] Emit some type declarations in .gdb_index In-Reply-To: <89815abe-5e45-4db4-8554-55db259ca509@simark.ca> (Simon Marchi's message of "Sun, 20 Apr 2025 22:50:39 -0400") References: <20250402-search-in-psyms-v2-0-ea91704487cb@tromey.com> <20250402-search-in-psyms-v2-3-ea91704487cb@tromey.com> <89815abe-5e45-4db4-8554-55db259ca509@simark.ca> X-Attribution: Tom Date: Mon, 21 Apr 2025 08:50:01 -0600 Message-ID: <87v7qx7ena.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.115.172 X-Source-L: No X-Exim-ID: 1u6sTD-00000000oFk-2A0Z X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-115-172.hlrn.qwest.net (bapiya) [97.122.115.172]:57788 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNOx1D5GfIBy61HhRT6kM2V4U62TP6J/mQJQcRkGnPvrtyHTEXTllo470tUGtgJLJEIEY166sQk94iyOzB4FA9FIoGplqEpM5alCQMnQLmGm+MHlROqV s7+5vyCftE/fjHsOgRlzoAoUXTKJCXaPezRpQkYSNPxqLnr97D9ui2080vnshHPvMEU+/+nZLYwgfjLeUXX+dxodCSk5quOdfTc= 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 >>>>> "Simon" == Simon Marchi writes: Simon> On 2025-04-02 19:45, Tom Tromey wrote: >> If you run struct-decl.exp with the .gdb_index board, you will see >> that "the_type" is not emitted in the index. This would cause a >> failure in this series. The fix is to ensure that certain necessary >> type declarations are emitted. >> >> However, a naive fix here will regress stub-array-size.exp, where a >> type declaration and a type definition are both seen -- but the >> declaration is seen first and causes a failure. This is handled by >> adding some code (including a mild hack) to filter out type >> declarations when a corresponding type definition is seen. Simon> I don't really understand the use of GDB_INDEX_SYMBOL_KIND_UNUSED5, what Simon> does it mean? I thought it was reasonably well explained in the comments. Could you say which part needs more text to be clear? + /* We sort the indexes in a funny way: GDB_INDEX_SYMBOL_KIND_UNUSED5 + is always sorted last; then otherwise we sort by numeric value. + This ensures that we prefer the definition when both a definition + and a declaration (stub type) are seen. */ ... + /* Rewrite GDB_INDEX_SYMBOL_KIND_UNUSED5. This ensures that a type + declaration will be deleted by the subsequent squashing step, if + warranted. */ ... + /* If we added a type declaration, we want to note this + fact for later, because we don't want a type declaration + to cause the real definition to be omitted from the + index. GDB_INDEX_SYMBOL_KIND_UNUSED5 is used here, but + rewritten later before the index is written. */ Tom