From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UGZUBZtoCGiQzgAAWB0awg (envelope-from ) for ; Wed, 23 Apr 2025 00:12:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1745381531; bh=Uu+kAvC6AF9NxlBptBZQSMGzh4oud6T0VIIy+uzGdQk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Xu8JAy+XAWbR+QkL8VfQjZcMJJVEX4csAg7HE3xu8kF+r+Mrm3MpkJKyLh3MJedS7 XdvzXRmdc1GGaXo5T2ddKUsCo1JzvtIxsxbDAAMK+Jo0cBKtPQGf+uml/LDZdUrFHD uu9JqwqYYx7mxZ9a5ySviUq99zRzflIsVKyTnHFo= Received: by simark.ca (Postfix, from userid 112) id 08BB41E0C3; Wed, 23 Apr 2025 00:12:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 autolearn=unavailable autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hip4objW; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hip4objW; dkim-atps=neutral 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 58FF31E05C for ; Wed, 23 Apr 2025 00:12:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8F1B3857BB9 for ; Wed, 23 Apr 2025 04:12:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8F1B3857BB9 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hip4objW; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hip4objW Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 215E63858D38 for ; Wed, 23 Apr 2025 04:11:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 215E63858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 215E63858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745381498; cv=none; b=Sai3IVy/S5eM5/SRcXZDQ79eRYTHSEm3/0DwOvq+iHt1ZTupYVaKqK90mwUsGqigNWbROvDWT9pxAuCj3CLCJCHGIw7UM+KtFZl0bGNh8dshkDA7Yn8pnKf5oDJ0CDcGWRsldh/yZa0IbKLshobbtnjXEsK8UOrSsep9+dyFF9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745381498; c=relaxed/simple; bh=Uu+kAvC6AF9NxlBptBZQSMGzh4oud6T0VIIy+uzGdQk=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=TNTnih9U0gJsqa0CeHnhmfqVNdPa4fw5yQnP60rJAepsO/eSFqtcjKIq3hofpOKEWMh01ygEVy0HyO8NL/HAna1CJWDBy3K7CwT9JVzhN8dKon0OD1xtBjsYyBcVJK/DJDZaqS2N1XVq2EdIfU0dLKnQidog1mnbtJBpqAJ1SwM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 215E63858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1745381497; bh=Uu+kAvC6AF9NxlBptBZQSMGzh4oud6T0VIIy+uzGdQk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hip4objWCEV5EQpeE/uLEPVi8adpFBEqnTvUEX4Ej0bJW2bOXnepgOC4JaA96sCYb iQRa7jUUHRtfhfOPkpdYZsvqF6cGfBVHjahFZuznKJi3fNgMQ61pPioAzNaSxdimEb ltNGnVSaUCGUrdKGBLyUHjv+3q6GQCd/DDIOdd5s= Received: by simark.ca (Postfix, from userid 112) id BDEC31E0C3; Wed, 23 Apr 2025 00:11:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1745381497; bh=Uu+kAvC6AF9NxlBptBZQSMGzh4oud6T0VIIy+uzGdQk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hip4objWCEV5EQpeE/uLEPVi8adpFBEqnTvUEX4Ej0bJW2bOXnepgOC4JaA96sCYb iQRa7jUUHRtfhfOPkpdYZsvqF6cGfBVHjahFZuznKJi3fNgMQ61pPioAzNaSxdimEb ltNGnVSaUCGUrdKGBLyUHjv+3q6GQCd/DDIOdd5s= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 027F91E05C; Wed, 23 Apr 2025 00:11:36 -0400 (EDT) Message-ID: Date: Wed, 23 Apr 2025 00:11:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/28] Emit some type declarations in .gdb_index To: Tom Tromey Cc: gdb-patches@sourceware.org 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> <87v7qx7ena.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87v7qx7ena.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2025-04-21 10:50, Tom Tromey wrote: >>>>>> "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. */ I think this is clear enough once you know the structure of the code in this file (which I didn't know beforehand). It doesn't help that I keep trying to review this series late at night, when my capacity to learn new things it near zero... Simon