From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wUq+DobHAWsq9SgAWB0awg (envelope-from ) for ; Sat, 21 Nov 2026 11:32:06 -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=HySrmgrE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 320341E167; Sat, 21 Nov 2026 11:32:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 3F9E21E023 for ; Sat, 21 Nov 2026 11:32:05 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C24B6344112 for ; Sat, 21 Nov 2026 16:31:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C24B6344112 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=HySrmgrE Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 754F64371207 for ; Sat, 21 Nov 2026 16:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 754F64371207 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 754F64371207 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795278691; cv=none; b=g8VB6UItuXepZLipINDXqkK4IX5+CDdB3wus2k9uc50y3zGJ5UxeCJDavH3oe0eL0ZY6zDK1v9/GDBnizFv8qvsWmkPfSSw5sMnN7zxh3KLY8XJlWSGwhNfbdt6CLuRzU+n7s72Vekmx6FpVcpazQDS7tczdUScX3yJdi7qZddo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795278691; c=relaxed/simple; bh=RkHo46+t7FzGVX+T0n8nV3I1V+nJVN2O7NgSi45p4Ps=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nzrbjPlZvctQ1fsHACGzxfuzii3lsjTNCSnSC2KrJI0Uosp4sVf5rf/KVVDSkZPvPuiUNA4SgxZKCfkpOx3QrbRm5uWCxd310jq24p0MmMf5801il26hpTGytSR6uKhkhp2qgxgreBG44IvHpjb7RFR15otnTN0SCcPRXGhsFZ0= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=HySrmgrE reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 754F64371207 Received: from eig-obgw-5003b.ext.cloudfilter.net ([10.0.29.155]) by cmsmtp with ESMTPS id Uht5xAVFIOOJnUnzvxtt02; Sat, 21 Nov 2026 16:31:31 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id UnztxtXsDSgq1UnzuxvjTx; Sat, 21 Nov 2026 16:31:30 +0000 X-Authority-Analysis: v=2.4 cv=c8KrQQ9l c=1 sm=1 tr=0 ts=6b01c762 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=zJRp6_cAMcgA:10 a=ItBw4LHWJt0A:10 a=CCpqsmhAAAAA:8 a=dzWzf_mpAAAA:8 a=wOe-yhOOyIVf9h0MCuEA:9 a=ul9cdbp4aOFLsgKbc677:22 a=b4DR9a7p2ZdsqdHBznES: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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=waMMUgJxDWzH4Te0zrIzPjBpeqWN50LW4pAFd5abpZ0=; b=HySrmgrEXnL6mu7U3fKMaLf33g 0Bnz1Ca/G277poyPNPkTaAVOZKcJfx7dRSW0+vrc7hxDLYmwDZnOejiExWTaOGXU1d+o1rkw9Zn6i nGWtVVdNWmI9LJzWoaviN5Uvn; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:38370 helo=prentzel) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xUnzt-00000002xCc-1xKZ; Sat, 21 Nov 2026 09:31:29 -0700 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Andrew Burgess , Sendao Yan , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/symtab] Fall back to symtabs when the quick lookup misses In-Reply-To: <111d5ee6-2113-408b-8880-e73f2cdf0865@simark.ca> (Simon Marchi's message of "Fri, 20 Nov 2026 22:53:16 -0500") References: <20261120091803.89033-1-yansendao@126.com> <87bj7jros1.fsf@tromey.com> <111d5ee6-2113-408b-8880-e73f2cdf0865@simark.ca> X-Attribution: Tom Date: Sat, 21 Nov 2026 09:31:28 -0700 Message-ID: <874idarvrz.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.129 X-Source-L: No X-Exim-ID: 1xUnzt-00000002xCc-1xKZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (prentzel) [97.122.110.129]:38370 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfOoSOtNzDzY7f4FeSHBdfFtZnuBU7MR3lkALFMaXbVC+INIXwt/XGvcxO0j0ZHk/xdQ8GorFRf9CDxmSludwaHNQYnycPFv0YTNenkefgy2V3AbbnqwX tVF3PEHkf85xSjXFn8SLLxLcO8rAwTGDv628ofHqChAq6TsEF+R9C23UuU5ZllaCrWqsB/Ep2aovyFC3kWS8PPCk0P30Jh/EYCQ= 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> Strictly speaking, S<1> and S<1l> mean two different types. One has Simon> an "int" template parameter and the other a "long int" template Simon> parameter. I don't think it would make sense for them to canonicalize Simon> to the same thing, as (1) the conversion would be lossy and (2) the Simon> type names would become ambiguous. I think that what we want is... more Simon> approximate/fuzzy matching. I don't truly dislike fuzzy matching; but what I do strongly dislike is strcmp_iw, which is basically C++-isms getting into the gdb core. I'd prefer that the symbol tables be dumber and, if necessary, the logic be pushed into the C++ parser or some other place where it doesn't require the core of gdb to have language-specific treatment. I tend to think that instead of "lookup", gdb would be better if access to the symtabs looked more like iteration. Then the C++ parser could do whatever weird stuff it needs -- in the C++ support files. This could maybe be done with some kind of callback thing instead. This would solve the best_symbol thing as well. Simon> - gcc does not put the integer suffix, so gives it DW_AT_name "S<1>" Simon> - clang puts the integer suffix, so gives it DW_AT_name "S<1L>" Simon> So the cooked index contains either "S<1>" or "S<1L>", depending on the Simon> compiler. Knowing this, we want lookups of either "S<1>" or "S<1L>" to Simon> work, because they are both legitimate queries. How do we achieve that? Simon> It does sound tempting to just canonicalize everything to "S<1>" (i.e. Simon> drop the suffixes), but then what if you have both "S<1>" and "S<1L>" in Simon> your program, how do you differentiate them? Perhaps it's fine for the Simon> index to store "simplified" names that don't include the suffixes, Simon> but I wouldn't call that a "canonical" name. Yeah, that's a real problem. I think you hit on a solution below. Simon> Regarding the DW_AT_names given by gcc: given that they lack potentially Simon> crucial information to know the type of the value parameters, maybe we Simon> should consider rebuilding the names from the Simon> DW_TAG_template_value_parameter DIEs. We already need to do this due to -gsimple-template-names. Relevant bugs: https://sourceware.org/bugzilla/show_bug.cgi?id=30023 https://sourceware.org/bugzilla/show_bug.cgi?id=32421 Tom