From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CeCxJJTS7GqZXiIAWB0awg (envelope-from ) for ; Thu, 05 Nov 2026 14:01:40 -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=vizdfTCs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8F193378002; Thu, 05 Nov 2026 14:01:40 -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_MSPIKE_H2,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 1906C1E043 for ; Thu, 05 Nov 2026 14:01:40 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBE494BA2E3D for ; Thu, 5 Nov 2026 19:01:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBE494BA2E3D 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=vizdfTCs Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id AC0634BA2E1A for ; Thu, 5 Nov 2026 19:01:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC0634BA2E1A 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 AC0634BA2E1A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793905273; cv=none; b=Nm5n/UQecemLte5XJ9YlHDd+2uOEbdczJxpwBeFT8i6TyNYZcTXVwMTCIYH0mA6UfZwfvUjeDt/ftIXnpctc7F4kkzovxrdLpWyx5cOoGHfl0w/VMPCrtmi8GU76X6plByrtWLwDhqPsH+LZ/rK7AQAZdKH+M97UpuakQSDK5hY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793905273; c=relaxed/simple; bh=k62OEJi9I75nIOsOssoSqW8g9TXumSwImqWsgwqGHmk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AABg9qWi9OeCPg+LcsLwaEnu0z4dQ2dGlL+8m35V3qaaaC+R9cddvnOsh/izb4EgCmsyykUe64uiyppTgTmhroVgdaTglRclolf/kh+/64tTRvKeiaTAsn3vURw4UgiQkkDCJl4k8bgVUp84bwCIBEwCI25OLpiavkBaTFloKSA= 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=vizdfTCs reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC0634BA2E1A Received: from eig-obgw-5002b.ext.cloudfilter.net ([10.0.29.226]) by cmsmtp with ESMTPS id OuqvxYQIMRiNxP2i0xttaa; Thu, 05 Nov 2026 19:01:12 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id P2hyxkm6Bgk6fP2hyxBQiP; Thu, 05 Nov 2026 19:01:10 +0000 X-Authority-Analysis: v=2.4 cv=KM9aDEFo c=1 sm=1 tr=0 ts=6aecd278 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=zJRp6_cAMcgA:10 a=ItBw4LHWJt0A:10 a=dzWzf_mpAAAA:8 a=Z4HOcEYBcDQAlW9_pRsA:9 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=QNDDGYHLxsbLWGdK+nVqy8CudpQTlPC/yMGvXmRrPig=; b=vizdfTCs5m6SqLxQdwEm1XzCAM Rp/DZrBxLCAzdYDySBEfatjuJ06Lx7E4vCmF/zqALCw1EKXrJzdOxQnutZkUywDtIWmEJ1n9a3hou kbK+bz8p6jwlgzPgn9JHgqJ7f; Received: from 97-122-110-129.hlrn.qwest.net ([97.122.110.129]:57890 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xP2hx-00000002emg-2bG5; Thu, 05 Nov 2026 12:01:09 -0700 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 06/13] gdb: check exact results in the canonicalize selftest In-Reply-To: (Simon Marchi's message of "Thu, 22 Oct 2026 12:28:36 -0400") References: <20261020162054.2140671-1-simon.marchi@efficios.com> <20261020162054.2140671-7-simon.marchi@efficios.com> <87wlrbyt86.fsf@tromey.com> <874iefyou5.fsf@tromey.com> <901d45a4-7942-4258-ae4a-9daa2b5e5a6e@simark.ca> <87qzhjx7uq.fsf@tromey.com> X-Attribution: Tom Date: Thu, 05 Nov 2026 12:01:07 -0700 Message-ID: <87y0b7xfv0.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: 1xP2hx-00000002emg-2bG5 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-110-129.hlrn.qwest.net (bapiya) [97.122.110.129]:57890 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNf9ATV++gb4YaCQqoeRXScgIJx1V0Du/0n4Jr68bldpMuDCJA1Sz1RlvyGqjHlhkRhc+GPGpfz4l7d6uxeCSq3cnJ9jSQM74LvGshBb6x0fMdFW0RJW jKx+9HjnAw2e/o/isOjMiIEsadoRB/myrmvm7YyJRC877f86tOO+dPtEPgfhJhjpFowJ8nvhqP0qJ46Ya37VTea8KzFSD8uYdpE= 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: >> What I mean is that my wish is that gdb internals shouldn't care about >> the precise spelling that the canonicalizer spits out. Simon> template Simon> struct C {}; Simon> C<0> c; ... Simon> C<(unsigned char)'\x00'> ... Simon> C<(unsigned char)0> Simon> If the user does: Simon> (gdb) ptype C<0> Simon> GDB does does not find the type. They would have to do: Simon> To implement this, strncmp_iw_with_mode will need to have some form of Simon> integer literal parsing, but it will be limited to just what can Simon> possibly be found in a canonical name. Ok, thanks for the explanation. Let me start by saying I kind of hate making the strcmp*iw* functions more intelligent. I'd rather they not exist at all, though TBH I don't know how achievable that is. I guess my main reason is that they seem fairly hairy and fragile for a task that seems like it could be done more straightforwardly (and maybe, to some degree, this is shown to be true in the cooked indexer). So I'm not exactly neutral. That said, in this particular case it seems to me that the underlying problem is something that can be solved directly in the name canonicalizer. That is, if we want C<(unsigned char) 0> to be equivalent to various other spellings, including C<0>, then a good solution is to use C<0> as the canonical form. This is pretty much the reason canonicalization is done at all: to iron over the differences between the various possible spellings. This makes gdb indifferent to the spelling, but more importantly means that the user doesn't need to know exactly what the compiler decided to emit in the debuginfo. Did you consider this approach and reject it for some reason? I guess a counter to this would be if there is a case where it's important to distinguish C<0> from C<(unsigned char) 0>. But if there is, then maybe the proposed strcmp*iw* patch would be a problem here too? FWIW I also have a dream of making the canonicalizer less intelligent as well. Like I wonder if the parser can be replaced with something closer to a tokenizer. The reason to do this is that C++ keeps growing and the canonicalizer isn't really keeping up. thanks, Tom