From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7A66E3858D1E for ; Mon, 30 Jan 2023 15:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A66E3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 22BA71E112; Mon, 30 Jan 2023 10:15:19 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1675091719; bh=wR+9435gJLDpyNO/cYkdrmQBVqmDz62Jdb9gLZ4fk68=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=vZq92+n0hsyYe5TKGIiYcJRJJnw7CWZ0rOKCA5eyzmy9wxymebehJJrLTzeF86AfO rfCV2ey1iNfrBEVjA+VdxE7Qe9sY8nOZZlWg8tMd9BHXNgx7/X2WcFyvIvihm/Oep/ zxrEpbRJFO0hFzjXtkEaAez8zv7TtLRg2ZhCbQAk= Message-ID: <60b3975e-31ff-19a6-845a-f8f0d2385c19@simark.ca> Date: Mon, 30 Jan 2023 10:15:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] Fix comparator bug in cooked index To: Andrew Burgess , Tom Tromey via Gdb-patches Cc: Tom Tromey References: <20230127195632.1570281-1-tromey@adacore.com> <87ilgouxac.fsf@redhat.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87ilgouxac.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > I think you should replace "template" with "'<'" here. The handling is > not limited to template argument blocks, but to anything after a '<'. > So languages that don't have templates will be impacted, as will things > like 'operator<', 'operator<<', etc in C++. > > This is all fine, returning false positives from the index is clearly > OK, we do the exact matching back in core GDB once the symbols are > expanded, but I don't think we should give the impression that this code > is actually checking for / skipping template arguments, when all it's > really doing is giving up on matching at a '<' (which, again, is fine). > > I don't know if it's worth explicitly stating that the '<' handling is > just a rough heuristic? All the examples you give are template based, > so the comment does leave the impression that the compare function does > some smart detection/handling of template blocks. > > Also, it might be worth saying why its fine that we do this C++ specific > '<' handling for all languages. > > On a similar theme, it might be worth saying why a case-insensitive > match is fine, even for languages where symbols are case-sensitive. > > For me, when I started looking at this code, these were all the > questions that I had. After some thought I figured out the answers, but > I had to dig into other parts of GDB to confirm them. It would have > been useful for me if the comments had covered all this stuff. Thanks for the precisions, I wasn't aware of all of that. Simon