From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1iOQFAVhkGo76QYAWB0awg (envelope-from ) for ; Thu, 27 Aug 2026 12:08:37 -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=f+MrAPKs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3BD2E1E166; Thu, 27 Aug 2026 12:08:37 -0400 (EDT) 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 [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 685C41E033 for ; Thu, 27 Aug 2026 12:08:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72DDD4BA23DE for ; Thu, 27 Aug 2026 16:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 72DDD4BA23DE 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=f+MrAPKs Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 71C974BA2E1C for ; Thu, 27 Aug 2026 16:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71C974BA2E1C 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 71C974BA2E1C 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=1787846889; cv=none; b=FPlj3GVYbM0Aa4A/wUtE3VR6kbcQuP05OR4fYjXeycycyjDXJYnqbNbm3XgF7uzXw0wTY6R6bA2ApWO+wlu4Lx2SksiF3rK36WlbEc4502YPSeWHh8tP9sj7QRN3i26/r0t5V6mwUf1pMhySnF7E5F5/Cfdz00zQbpR2r6CUKZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787846889; c=relaxed/simple; bh=y/Te+yClDBKDXk+t3ErB6VjxMhDWMDhr20i41or1fN8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jNyhGpWSshfYVR47NVyjX9/9riXU9uK9Ek7Gbm1UDwDtBSLz4vLCwhuBSwE3WXeS54TbOAiSS5ocs6l806y601PgWr0bAlZHYodTBNYg27JV1F3l+ma7YbNiiexFwSJroqxi0+Xb8VoEuy05X+3q92GuPGwI+AgvVWTzQJ3SSPc= 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=f+MrAPKs reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71C974BA2E1C Received: from eig-obgw-5001b.ext.cloudfilter.net ([10.0.29.181]) by cmsmtp with ESMTPS id zPPQwiFiBusRSzce8w567R; Thu, 27 Aug 2026 16:08:08 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id zce7wf6WffDqYzce7wdhRt; Thu, 27 Aug 2026 16:08:07 +0000 X-Authority-Analysis: v=2.4 cv=HKbDFptv c=1 sm=1 tr=0 ts=6a9060e7 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=Sv0fKeRqtYgA:10 a=ItBw4LHWJt0A:10 a=MLN_2C1PsCuS-o5LY5kA:9 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-Subscribe: List-Post:List-Owner:List-Archive; bh=Fx73ZbR6+NoLJJOG9eox30Fo+IDPWepVhFh5TUt4Rpc=; b=f+MrAPKsr0Iwd0IL5P7nmRIiX8 cMJUPfFcI28v1dDSLkVjCdh9mMZxUlAYZmRkAqEYAhe3qm78FFf4l0TnBqxPtQ7z+v4gpRXAzoKsp kIafkfzoFJ/b4Zv/ATSIBJ5Ae; Received: from 97-122-117-2.hlrn.qwest.net ([97.122.117.2]:44424 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.5) (envelope-from ) id 1wzce6-00000003guj-3kmh; Thu, 27 Aug 2026 10:08:06 -0600 From: Tom Tromey To: Tom de Vries Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Check record types for compatibility in ada_type_match In-Reply-To: <8c8a38de-5db7-4857-95d1-4abf2a010d54@suse.de> (Tom de Vries's message of "Thu, 27 Aug 2026 16:17:47 +0200") References: <20260826201312.1120857-1-tromey@adacore.com> <8c8a38de-5db7-4857-95d1-4abf2a010d54@suse.de> X-Attribution: Tom Date: Thu, 27 Aug 2026 10:08:05 -0600 Message-ID: <87bjana6my.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.117.2 X-Source-L: No X-Exim-ID: 1wzce6-00000003guj-3kmh X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-117-2.hlrn.qwest.net (bapiya) [97.122.117.2]:44424 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: MS4xfK7yY5L39sozeGAohH3jvtgnSpr/L69+ETUBpPqZPPmgsxIF8rd/8l5SaZJMOWIhNMIDecIWX4yebMeGhYx4/4B3XTJtnEJDri5DNNvR7NIMCBuRYQdq Cg2KXtwsO2XQXlj0+0gpv3aWrsOw0ByF6Qr2pXNk5NZ7jKiH/qGLZcQKZVf9PrnirpRLkSaJGjJQ0iX0jb9EvLWh5Q9260D3uAY= 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 >>>>> "Tom" == Tom de Vries writes: >> +/* Helper for ada_type_match that checks that two record types >> are >> + compatible. As with that function, FTYPE is the formal type and >> + ATYPE is the actual type. >> + >> + Note that it is ok if this function is not precise, as long as >> + there aren't too many false negatives. That is, it's better to >> + return 'true', because that will result in a menu being presented >> + to the user. */ >> + Tom> I don't fully understand the reasoning here. AFAIU, if there is only Tom> one match, no menu will be presented. In that case, is returning true Tom> still a conservative choice? Returning true means that gdb will consider the types compatible. If there are multiple overloads of some function, ada-lang.c checks them for compatibility with the actual arguments; see ada_resolve_function. If multiple functions then survive this compatibility check, gdb will present a menu. So, if there's some doubt, returning true will mean that more possible overloads will be considered matches; and in this case a menu will be presented. Mainly here we are interested in filtering out the types that definitely do not match. IME it's annoying when debugging Ada to be given nonsensical choices. I'd like to even further refine this code, but Ada is pretty complicated and so it's not easy to do. Tom